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

◆ sub_space() [2/2]

SchreyerOrder * SchreyerOrder::sub_space ( M2_arrayint a) const

Definition at line 166 of file schorder.cpp.

167{
168 // Since this is called only from FreeModule::sub_space,
169 // the elements of 'a' are all in bounds, and do not need to be checked...
170 // BUT, we check anyway...
172 for (unsigned int i = 0; i < a->len; i++)
173 if (a->array[i] >= 0 && a->array[i] < rank())
174 result->append(compare_num(a->array[i]), base_monom(a->array[i]));
175 else
176 {
177 ERROR("schreyer order subspace: index out of bounds");
179 return nullptr;
180 }
181 return result;
182}
const Monoid * M
Definition schorder.hpp:69
SchreyerOrder(const Monoid *m)
Definition schorder.hpp:77
int rank() const
Definition schorder.hpp:89
int compare_num(int i) const
Definition schorder.hpp:90
const_monomial base_monom(int i) const
Definition schorder.hpp:91
void freemem(void *s)
Definition m2-mem.cpp:103
const int ERROR
Definition m2-mem.cpp:55
VALGRIND_MAKE_MEM_DEFINED & result(result)

References base_monom(), compare_num(), ERROR, freemem(), M, rank(), result(), and SchreyerOrder().