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

◆ create()

ReducedGB * ReducedGB::create ( const PolynomialRing * originalR0,
const FreeModule * F0,
const FreeModule * Fsyz0,
const GBWeight * wt0 = nullptr )
static

Definition at line 11 of file reducedgb.cpp.

16{
17 // Depending on whether the ring is over a field, or over ZZ, or
18 // has local variables, we create a different class.
19
20 bool over_ZZ = originalR0->coefficient_type() == Ring::COEFF_ZZ;
21 bool is_local = originalR0->getMonoid()->numNonTermOrderVariables() > 0;
22 GBRing *R = originalR0->get_gb_ring();
23
24 if (over_ZZ)
25 return new ReducedGB_ZZ(R, originalR0, F0, Fsyz0);
26 else
27 {
28 if (is_local)
29 return new ReducedGB_Field_Local(R, originalR0, F0, Fsyz0, wt0);
30 else
31 return new ReducedGB_Field(R, originalR0, F0, Fsyz0);
32 }
33}
int numNonTermOrderVariables() const
Definition monoid.hpp:190
virtual GBRing * get_gb_ring() const
Definition polyring.hpp:276
virtual const Monoid * getMonoid() const
Definition polyring.hpp:282
CoefficientType coefficient_type() const
Definition polyring.hpp:191
GBRing * R
Definition reducedgb.hpp:64
@ COEFF_ZZ
Definition ring.hpp:222

References Ring::COEFF_ZZ, PolynomialRing::coefficient_type(), PolynomialRing::get_gb_ring(), PolynomialRing::getMonoid(), Monoid::numNonTermOrderVariables(), R, and ReducedGB().

Referenced by GBDeclared::GBDeclared(), gbA::initialize(), gbA::minimalize_gb(), and GBinhom_comp::set_up().