1704{
1706 if (P == nullptr)
1707 {
1708 const M2FreeAlgebraOrQuotient* Q =
dynamic_cast<const M2FreeAlgebraOrQuotient*
>(
get_ring());
1709 if (Q == nullptr)
1710 {
1711 ERROR(
"expected polynomial ring");
1712 return nullptr;
1713 }
1716
1717
1718
1719
1721
1722
1723
1724
1725
1726 }
1730
1731 for (unsigned int i = 0; i < vars->len; i++)
1732 if (vars->array[i] < 0 || vars->array[i] >= nvars)
1733 {
1734 ERROR(
"expected a list of indices of indeterminates");
1735 return nullptr;
1736 }
1737
1738
1742 exponent_table *E =
1744
1745 for (
int c = 0; c <
n_cols(); c++)
1746 {
1748 for (; v != nullptr; v = v->next)
1749 {
1750 for (Nterm& t : v->coeff)
1751 {
1754 for (unsigned int i = 0; i < vars->len; i++)
1755 exp1[i] = exp[vars->array[i]];
1756 exp1[vars->len] = v->comp;
1758 }
1759 }
1760 }
1761
1762
1765 for (int i = 0; i < nvars; i++) exp[i] = 0;
1766 for (int i = 0; monoms[i] != nullptr; i += 2)
1767 {
1769 for (unsigned int j = 0; j < vars->len; j++)
1770 exp[vars->array[j]] = exp1[j];
1771 int x = exp1[vars->len];
1775 }
1776
1777
1781
1782
1784 M2_arrayint perm =
result->sort(0, -1);
1785 return result->sub_matrix(perm);
1786}
exponents::ConstExponents const_exponents
exponents::Exponents exponents_t
virtual int n_vars() const =0
const Ring * get_ring() const
ring_elem elem(int i, int j) const
friend class MatrixConstructor
const FreeModule * rows() const
void to_expvector(const_monomial m, exponents_t result_exp) const
monomial make_one() const
void remove(monomial d) const
void from_expvector(const_exponents exp, monomial result) const
virtual const Monoid * getMonoid() const
virtual ring_elem make_flat_term(const ring_elem a, const_monomial m) const =0
virtual const Ring * getCoefficients() const
vec make_vec(int r, ring_elem a) const
virtual ring_elem from_long(long n) const =0
virtual const PolynomialRing * cast_to_PolynomialRing() const
void exponent_table_free(exponent_table **E)
const void ** exponent_table_to_array(exponent_table *E)
exponent_table * exponent_table_new(int hint, int nvars)
long exponent_table_put(exponent_table *E, const exponent expon, long value)
VALGRIND_MAKE_MEM_DEFINED & result(result)
Matrix * NCMonomialMatrix(ModuleMonomialSet &H, const FreeModule *target)
void NCMonomials(ModuleMonomialSet &H, const Matrix *M)
IntsSet< ModuleMonomDefaultConfig > ModuleMonomialSet
const mpreal exp(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
#define newarray_atomic(T, len)