Changeset 1ca2af in git for kernel


Ignore:
Timestamp:
Sep 9, 2016, 3:32:25 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
43fbe81b86fe54b355223a6f9816365e92f73b93551a9120fd6fbba9a370f8ea17855840e2bafafd
Parents:
dd930e594c1cd299f2e2b78fe5444de64aede28a
Message:
use p_Compare
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    rdd930e5 r1ca2af  
    25412541}
    25422542
    2543 /*
    2544 * compare the leading terms of a and b
    2545 */
    2546 static int tCompare(const poly a, const poly b)
    2547 {
    2548   if (b == NULL) return(a != NULL);
    2549   if (a == NULL) return(-1);
    2550 
    2551   /* a != NULL && b != NULL */
    2552   int r = pLmCmp(a, b);
    2553   if (r != 0) return(r);
    2554   number h = nSub(pGetCoeff(a), pGetCoeff(b));
    2555   r = -1 + nIsZero(h) + 2*nGreaterZero(h);   /* -1: <, 0:==, 1: > */
    2556   nDelete(&h);
    2557   return(r);
    2558 }
    2559 
    2560 /*
    2561 * compare a and b (rev-lex on terms)
    2562 */
    2563 static int pCompare(const poly a, const poly b)
    2564 {
    2565   int r = tCompare(a, b);
    2566   if (r != 0) return(r);
    2567 
    2568   poly aa = a;
    2569   poly bb = b;
    2570   while (r == 0 && aa != NULL && bb != NULL)
    2571   {
    2572     pIter(aa);
    2573     pIter(bb);
    2574     r = tCompare(aa, bb);
    2575   }
    2576   return(r);
    2577 }
    2578 
    25792543typedef struct
    25802544{
     
    25852549int pCompare_qsort(const void *a, const void *b)
    25862550{
    2587   int res = pCompare(((poly_sort *)a)->p, ((poly_sort *)b)->p);
     2551  int res = p_Compare(((poly_sort *)a)->p, ((poly_sort *)b)->p,currRing);
    25882552  return(res);
    25892553}
  • kernel/ideals.h

    rdd930e5 r1ca2af  
    187187ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
    188188
    189 
    190189#endif
Note: See TracChangeset for help on using the changeset viewer.