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

◆ NCMonomials()

void NCMonomials ( ModuleMonomialSet & H,
const Matrix * M )

Definition at line 1593 of file matrix.cpp.

1594{
1595 const M2FreeAlgebraOrQuotient* Q = dynamic_cast<const M2FreeAlgebraOrQuotient*>(M->get_ring());
1596 if (Q == nullptr) return;
1597
1598 // should not get here unless 'M' is a matrix over a M2FreeAlgebraOrQuotient
1599
1600 for (int c = 0; c < M->n_cols(); c++)
1601 {
1602 vec v = M->elem(c);
1603 for (; v != nullptr; v = v->next)
1604 {
1605 int comp = v->comp;
1606 auto f = Q->toPoly(v->coeff);
1607 for (auto i = f->cbegin(); i != f->cend(); ++i)
1608 H.insert(i.monom(), comp);
1609 }
1610 }
1611}
bool insert(Monom m, int comp)
const Poly * toPoly(const ring_elem f) const
Abstract Ring subclass that lifts either a FreeAlgebra or a FreeAlgebraQuotient into the engine's Rin...
const Ring * get_ring() const
Definition matrix.hpp:134
ring_elem elem(int i, int j) const
Definition matrix.cpp:307
int n_cols() const
Definition matrix.hpp:147

References Matrix::elem(), Matrix::get_ring(), IntsSet< Configuration >::insert(), Matrix, Matrix::n_cols(), and M2FreeAlgebraOrQuotient::toPoly().

Referenced by Matrix::coeffs(), Matrix::monomials(), and NCCoefficientMatrix().