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

◆ create() [2/2]

GBComputation * GBDeclared::create ( const Matrix * m,
const Matrix * gb,
const Matrix * change,
const Matrix * syz )
static

Definition at line 90 of file comp-gb-declared.cpp.

94{
95 // Check:
96 // the rings are all the same, and all are not NULL.
97 // m->rows(), gb->rows() are the same
98 // change->rows(), syz->rows() are the same.
99 assert(m != 0 && gb != 0 && change != 0 && syz != 0);
100 const Ring *R = gb->get_ring();
101 if (R != m->get_ring() || R != change->get_ring() || R != syz->get_ring())
102 {
103 ERROR("expected the same ring");
104 return nullptr;
105 }
106
107 const PolynomialRing *P = R->cast_to_PolynomialRing();
108 if (P == nullptr)
109 {
110 ERROR("declaring a GB requires a polynomial ring");
111 return nullptr;
112 }
113 // Then: create and return the object
114 return new GBDeclared(m, gb, change, syz);
115}
const Matrix * syz
GBDeclared(const Matrix *m0, const Matrix *gb, const Matrix *change, const Matrix *syz0)
const Ring * get_ring() const
Definition matrix.hpp:134
virtual const PolynomialRing * cast_to_PolynomialRing() const
Definition ring.hpp:243
void gb(IntermediateBasis &F, int n)
const int ERROR
Definition m2-mem.cpp:55

References Ring::cast_to_PolynomialRing(), ERROR, gb(), GBComputation::GBComputation(), GBDeclared(), Matrix::get_ring(), Matrix, and syz.

Referenced by IM2_GB_force(), rawMarkedGB(), and GBWalker::start_computation().