Exemple #1
0
 int compare(value a, value b)
 {
   // returns: LT if a < b, EQ if a == b, GT if a > b.
   ncmps ++;
   /* Compare using degree, then type, then lead term of spoly */
   int result;
   int cmp = a->deg - b->deg;
   if (cmp < 0) result = GT;
     else if (cmp > 0) result = LT;
     else
       {
         gbvector *a1 = (a->type > gbB::SPAIR_SKEW ? a->f() : a->lead_of_spoly);
         gbvector *b1 = (b->type > gbB::SPAIR_SKEW ? b->f() : b->lead_of_spoly);
         if (a1 == 0)
           {
             if (b1 == 0) result = EQ;
             else result = LT;
           }
         else
           {
             if (!b1) result = GT;
             else result = R->gbvector_compare(F,a1, b1);
           }
       }
   return result;
 }