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

◆ is_equal()

bool DPoly::is_equal ( int level,
const TowerPolynomial f,
const TowerPolynomial g )
static

Definition at line 459 of file dpoly.cpp.

460{
461 if (f == nullptr)
462 {
463 if (g == nullptr) return true;
464 return false;
465 }
466 if (g == nullptr || f->deg != g->deg) return false;
467 if (level == 0)
468 {
469 long *fp = f->arr.ints;
470 long *gp = g->arr.ints;
471 for (int i = 0; i <= f->deg; i++)
472 if (fp[i] != gp[i]) return false;
473 return true;
474 }
475 // level > 0
476 TowerPolynomial *fp = f->arr.polys;
477 TowerPolynomial *gp = g->arr.polys;
478 for (int i = 0; i <= f->deg; i++)
479 if (!is_equal(level - 1, fp[i], gp[i])) return false;
480 return true;
481}
static bool is_equal(int level, const TowerPolynomial f, const TowerPolynomial g)
Definition dpoly.cpp:459

References is_equal().

Referenced by is_equal().