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

◆ rawRingM2FreeAlgebra()

const Ring * rawRingM2FreeAlgebra ( const Ring * coefficientRing,
M2_ArrayString names,
const Ring * degreeRing,
M2_arrayint degrees,
M2_arrayint wtvecs,
M2_arrayint heftVector )

Definition at line 223 of file ring.cpp.

229{
230 try {
231 if (coefficientRing == nullptr)
232 {
233 ERROR("internal error: expected non-null Ring!");
234 return nullptr;
235 }
236 const PolynomialRing *P = degreeRing->cast_to_PolynomialRing();
237 if (P == nullptr)
238 {
239 ERROR("expected polynomial ring");
240 return nullptr;
241 }
242 const M2FreeAlgebra* result = M2FreeAlgebra::create(coefficientRing,
244 P,
248 //intern_polyring(result); // we might want to intern our rings (to register a finalizer with the gc)
249 return result;
250 }
251 catch (exc::engine_error& e) {
252 ERROR(e.what());
253 return nullptr;
254 }
255}
static M2FreeAlgebra * create(const Ring *K, const std::vector< std::string > &names, const PolynomialRing *degreeRing, const std::vector< int > &degrees, const std::vector< int > &wtvecs, const std::vector< int > &heftVector)
Concrete Ring wrapper around an owned FreeAlgebra (no quotient).
Abstract base for the engine's polynomial-ring hierarchy.
Definition polyring.hpp:96
const int ERROR
Definition m2-mem.cpp:55
VALGRIND_MAKE_MEM_DEFINED & result(result)
const PolynomialRing * degreeRing(const std::vector< std::string > &names)
void M2_ArrayString_to_stdvector(M2_ArrayString strs, std::vector< std::string > &result)
Definition util.hpp:52
std::vector< T > M2_arrayint_to_stdvector(M2_arrayint arr)
Definition util.hpp:96

References M2FreeAlgebra::create(), degreeRing(), ERROR, M2_arrayint_to_stdvector(), M2_ArrayString_to_stdvector(), and result().