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

◆ elem_text_out()

void FreeMonoid::elem_text_out ( buffer & o,
const Monom & m1 ) const

Definition at line 181 of file FreeMonoid.cpp.

182{
183 auto word_length = wordLength(m);
184 auto word_ptr = m + mNumWeights + 1;
185 for (auto j = 0; j < word_length; j++)
186 {
187 // for now, just output the string.
188 int curvar = word_ptr[j];
189 int curvarPower = 0;
190 o << mVariableNames[curvar];
191 while ((j < word_length) && (word_ptr[j] == curvar))
192 {
193 j++;
194 curvarPower++;
195 }
196 if (curvarPower > 1) o << "^" << curvarPower;
197 // back j up one since we went too far looking ahead.
198 j--;
199 }
200}
const int mNumWeights
const std::vector< std::string > mVariableNames
int wordLength(const Monom &m) const

References mNumWeights, mVariableNames, and wordLength().

Referenced by NCF4::displayF4Matrix(), NCF4::displayFullF4Matrix(), and FreeAlgebra::elem_text_out().