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

◆ moIsGRevLex()

int moIsGRevLex ( const MonomialOrdering * mo)

Definition at line 401 of file monomial-ordering.cpp.

402{
403 // The monomial order is lex if what?
404 // one lex block, no grevlex blocks, no weightvector blocks.
405 // only: lex block and position blocks are allowed.
406 int ngrevlex = 0;
407 int i;
408 for (i = 0; i < mo->len; i++)
409 {
410 enum MonomialOrdering_type typ = mo->array[i]->type;
411 switch (typ)
412 {
413 case MO_GREVLEX:
414 case MO_GREVLEX2:
415 case MO_GREVLEX4:
416 case MO_GREVLEX_WTS:
417 case MO_GREVLEX2_WTS:
418 case MO_GREVLEX4_WTS:
419 ngrevlex++;
420 break;
421 case MO_POSITION_UP:
422 case MO_POSITION_DOWN:
423 break;
424 default:
425 return 0;
426 }
427 }
428 return (ngrevlex == 1);
429}
MonomialOrdering_type
@ MO_GREVLEX4_WTS
@ MO_POSITION_UP
@ MO_GREVLEX
@ MO_GREVLEX4
@ MO_GREVLEX2_WTS
@ MO_POSITION_DOWN
@ MO_GREVLEX2
@ MO_GREVLEX_WTS

References MonomialOrdering::array, MonomialOrdering::len, MO_GREVLEX, MO_GREVLEX2, MO_GREVLEX2_WTS, MO_GREVLEX4, MO_GREVLEX4_WTS, MO_GREVLEX_WTS, MO_POSITION_DOWN, and MO_POSITION_UP.

Referenced by TEST().