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

◆ elem_text_out()

void Monoid::elem_text_out ( buffer & o,
const_monomial m,
bool p_one = true ) const

Definition at line 575 of file monoid.cpp.

576{
578 to_expvector(m, EXP1);
579// elem_text_out(o, EXP1, p_one);
580// }
581// void Monoid::elem_text_out(buffer &o, const_exponents EXP1, bool p_one) const
582// {
583 int len_ = 0;
584 for (unsigned int v = 0; v < mVariableCount; v++)
585 if (EXP1[v] != 0)
586 {
587 len_++;
588 if (mVariableNames.size() < v)
589 o << ".";
590 else
591 o << mVariableNames[v];
592 int e = EXP1[v];
593 int single = (mVariableNames[v].size() == 1);
594 if (e > 1 && single)
595 o << e;
596 else if (e > 1)
597 o << "^" << e;
598 else if (e < 0)
599 o << "^(" << e << ")";
600 }
601 if (len_ == 0 && p_one) o << "1";
602}
exponents::Exponents exponents_t
void to_expvector(const_monomial m, exponents_t result_exp) const
Definition monoid.cpp:747
size_t exp_size
Definition monoid.hpp:120
const int mVariableCount
number of variables
Definition monoid.hpp:99
const std::vector< std::string > mVariableNames
names of variables
Definition monoid.hpp:101
#define ALLOCATE_EXPONENTS(byte_len)
Definition monoid.hpp:62

References ALLOCATE_EXPONENTS, exp_size, mVariableCount, mVariableNames, and to_expvector().

Referenced by MonomialIdeal::text_out().