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

◆ isparallel()

bool isparallel ( M2_arrayint w,
int * e,
int * f )
static

Definition at line 473 of file gbring.cpp.

475{
476 // true if e-f is a positive multiple of w
477
478 int i, j, a = 0, b;
479 int nvars = w->len;
480 for (i = 0; i < nvars; i++)
481 {
482 a = e[i] - f[i];
483 if (a) break;
484 if (w->array[i] != 0) return false;
485 }
486 // i is the first spot where e, f differ
487 for (j = i + 1; j < nvars; j++)
488 {
489 b = e[j] - f[j];
490 if (a * w->array[j] != b * w->array[i]) return false;
491 }
492 return true;
493}

Referenced by GBRing::gbvector_parallel_lead_terms().