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

◆ compare()

int ModuleMonom::compare ( const ModuleMonom & m1,
const ModuleMonom & m2 )
inlinestatic

Definition at line 149 of file Polynomial.hpp.

150 {
151 if (m1[2] > m2[2]) return GT;
152 if (m1[2] < m2[2]) return LT;
153 if (m1[3] > m2[3]) return GT;
154 if (m1[3] < m2[3]) return LT;
155 // at this stage, they have the same degree, so use lex order
156 for (int j = 4; j < m1[0]; j++)
157 {
158 if (m1[j] > m2[j]) return LT;
159 if (m1[j] < m2[j]) return GT;
160 }
161 // if we are here, the monomials are the same.
162 return EQ;
163 }
const int EQ
Definition style.hpp:40
const int GT
Definition style.hpp:41
const int LT
Definition style.hpp:39

References EQ, GT, LT, and ModuleMonom().

Referenced by ModuleMonomLessThan::operator()().