82{
84 {
85 o << '0';
86 return;
87 }
88
89 bool more_than_one_term = (
termCount() >= 2);
90 int needs_parens = print_parens && more_than_one_term;
91
92 if (needs_parens)
93 {
94 if (print_plus) o << '+';
95 o << '(';
96 print_plus = false;
97 }
98
101 {
102 bool monom_is_one = (*monom_loc == 1);
103 print_parens = !monom_is_one;
104 bool p_one_this = (monom_is_one && needs_parens) || (monom_is_one && print_one);
106 if (!monom_is_one)
107 {
109 o << '*';
111 }
112 print_plus = true;
113 monom_loc += *monom_loc;
114 }
115 if (needs_parens) o << ')';
116}
static void displayCoefficient(std::ostream &o, T val, bool print_plus, bool print_one)
std::vector< int > mMonomials
std::vector< mpz_class > mCoefficients
static void display(std::ostream &o, const std::vector< std::string > &varnames, const newf4::MonomialView &m)