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

◆ rawRingM2FreeAlgebraQuotient()

const Ring * rawRingM2FreeAlgebraQuotient ( const Matrix * GB,
int maxdeg )

Definition at line 285 of file ring.cpp.

286{
287 const Ring* A = GB->get_ring();
288 try {
289 if (A == nullptr)
290 {
291 ERROR("internal error: expected non-null Ring!");
292 return nullptr;
293 }
294 const M2FreeAlgebra* P = A->cast_to_M2FreeAlgebra();
295 if (P == nullptr)
296 {
297 ERROR("expected a free algebra");
298 return nullptr;
299 }
300
302 return result;
303 }
304 catch (exc::engine_error& e) {
305 ERROR(e.what());
306 return nullptr;
307 }
308}
Concrete Ring wrapper around an owned FreeAlgebra (no quotient).
static M2FreeAlgebraQuotient * create(const M2FreeAlgebra &F, const Matrix *GB, int maxdeg)
Concrete Ring wrapper around an owned FreeAlgebraQuotient (the quotient counterpart of M2FreeAlgebra)...
const Ring * get_ring() const
Definition matrix.hpp:134
virtual const M2FreeAlgebra * cast_to_M2FreeAlgebra() const
Definition ring.hpp:256
xxx xxx xxx
Definition ring.hpp:102
const int ERROR
Definition m2-mem.cpp:55
VALGRIND_MAKE_MEM_DEFINED & result(result)

References Ring::cast_to_M2FreeAlgebra(), M2FreeAlgebraQuotient::create(), ERROR, Matrix::get_ring(), Matrix, and result().