Macaulay2 Engine
Loading...
Searching...
No Matches

◆ compare_schreyer()

Definition at line 466 of file res-moninfo-sparse.hpp.

472 {
473 // REWRITE
475#if 0
476 printf("compare_schreyer: ");
477 printf(" m=");
478 showAlpha(m);
479 printf(" n=");
480 showAlpha(n);
481 printf(" m0=");
482 showAlpha(m0);
483 printf(" n0=");
484 showAlpha(n0);
485 printf(" tiebreakers: %ld %ld\n", tie1, tie2);
486#endif
487 int* m1 = new int[*m + *m0]; // need less than this
488 int* n1 = new int[*n + *n0]; // need less than this
489 mult(m, m0, m1);
490 mult(n, n0, n1);
491 int cmp = compare_grevlex(m1, n1);
492 if (cmp == 0)
493 {
494 if (tie1 > tie2)
495 cmp = -1;
496 else if (tie1 < tie2)
497 cmp = 1;
498 else
499 cmp = 0;
500 }
501 delete[] m1;
502 delete[] n1;
503 return cmp;
504 }
void showAlpha(res_const_packed_monomial m) const
unsigned long ncalls_compare
bool mult(res_const_packed_monomial m, res_const_packed_monomial n, res_packed_monomial result) const
int compare_grevlex(res_const_packed_monomial m, res_const_packed_monomial n) const

References compare_grevlex(), mult(), ncalls_compare, and showAlpha().