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

◆ elem_text_out()

void SchurRing2::elem_text_out ( buffer & o,
const ring_elem f,
bool p_one = true,
bool p_plus = false,
bool p_parens = false ) const
virtual

Implements Ring.

Definition at line 202 of file schur2.cpp.

207{
208 const schur_poly *g = f.get_schur_poly();
209 size_t n = g->size();
210
211 bool needs_parens = p_parens && (n > 1);
212 if (needs_parens)
213 {
214 if (p_plus) o << '+';
215 o << '(';
216 p_plus = false;
217 }
218
219 p_one = false;
220 for (schur_poly::iterator i = g->begin(); i != g->end(); ++i)
221 {
222 const_schur_partition part = i.getMonomial();
223 int len = *part++;
224 int isone = (len == 1); // the empty partition
225 p_parens = !isone;
226 coefficientRing->elem_text_out(
227 o, i.getCoefficient(), p_one, p_plus, p_parens);
228 o << "{";
229 for (int j = 0; j < len - 1; j++)
230 {
231 if (j > 0) o << ",";
232 o << part[j];
233 }
234 o << "}";
235 p_plus = true;
236 }
237 if (needs_parens) o << ')';
238}
const Ring * coefficientRing
Definition schur2.hpp:154
schur_poly_iterator iterator
Definition schur2.hpp:90
iterator begin() const
Definition schur2.hpp:128
iterator end() const
Definition schur2.hpp:132
size_t size() const
Definition schur2.hpp:94
const schur_word * const_schur_partition
Definition schur2.hpp:52
const schur_poly * get_schur_poly() const
Definition ringelem.hpp:137

References schur_poly::begin(), coefficientRing, schur_poly::end(), ring_elem::get_schur_poly(), and schur_poly::size().