Implements Ring.
Reimplemented in SchurRing.
Definition at line 1308 of file poly.cpp.
1313{
1314 Nterm *t = f;
1315 if (t == nullptr)
1316 {
1317 o << '0';
1318 return;
1319 }
1320
1321 int two_terms = (t->
next !=
nullptr);
1322
1323 int needs_parens = p_parens && two_terms;
1324 if (needs_parens)
1325 {
1326 if (p_plus) o << '+';
1327 o << '(';
1328 p_plus = false;
1329 }
1330
1331 for (t = f; t !=
nullptr; t = t->
next)
1332 {
1333 int isone =
M_->is_one(t->
monom);
1334 p_parens = !isone;
1335 bool p_one_this = (isone && needs_parens) || (isone && p_one);
1336 K_->elem_text_out(o, t->
coeff, p_one_this, p_plus, p_parens);
1337 if (!isone)
1338 {
1339 M_->elem_text_out(o, t->
monom, p_one_this);
1340 }
1341 p_plus = true;
1342 }
1343 if (needs_parens) o << ')';
1344}
References Nterm::coeff, PolynomialRing::K_, PolynomialRing::M_, Nterm::monom, and Nterm::next.