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

◆ is_borel()

bool MonomialIdeal::is_borel ( ) const

Definition at line 955 of file monideal.cpp.

956{
957 exponents_t bexp = newarray_atomic(int, get_ring()->n_vars());
958 for (Bag& b : *this)
959 {
960 Bag *c;
961 varpower::to_expvector(get_ring()->n_vars(), b.monom().data(), bexp);
962 for (int j = get_ring()->n_vars() - 1; j >= 1; j--)
963 if (bexp[j] > 0)
964 {
965 bexp[j]--;
966 bexp[j - 1]++;
967 int isthere = search_expvector(bexp, c);
968 bexp[j]++;
969 bexp[j - 1]--;
970 if (!isthere) return 0;
971 }
972 }
973 freemem(bexp);
974 return 1;
975}
exponents::Exponents exponents_t
static void to_expvector(int n, ConstExponents a, exponents::Exponents result)
int search_expvector(const_exponents m, Bag *&b) const
Definition monideal.cpp:214
const PolynomialRing * get_ring() const
Definition monideal.hpp:190
gc_vector< int > & monom()
Definition int-bag.hpp:60
int_bag Bag
Definition int-bag.hpp:70
void freemem(void *s)
Definition m2-mem.cpp:103
#define newarray_atomic(T, len)
Definition newdelete.hpp:91

References freemem(), get_ring(), int_bag::monom(), newarray_atomic, search_expvector(), and ExponentList< int, true >::to_expvector().

Referenced by IM2_MonomialIdeal_is_borel().