16 bool print_parens)
const
19 display(o, varnames, print_one, print_plus, print_parens);
25 return 3 *
sizeof(std::vector<int>)
34 bool first_term =
true;
43 o <<
"]" << std::endl;
48 if (i == nextloc) o <<
" .";
52 o <<
"])" << std::endl;
59 bool is_negative = (val < 0);
60 bool is_one = (val == 1 or val == -1);
62 if (not is_negative and print_plus) o <<
'+';
65 if (is_negative) o <<
'-';
66 if (print_one) o <<
'1';
78 const std::vector<std::string> & varnames,
81 bool print_parens)
const
89 bool more_than_one_term = (
termCount() >= 2);
90 int needs_parens = print_parens && more_than_one_term;
94 if (print_plus) o <<
'+';
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);
113 monom_loc += *monom_loc;
115 if (needs_parens) o <<
')';
Minimal, portable polynomial value type used where heavier engine types would be overkill.
newf4::MonomialView — non-owning view over a [length, var_1, e_1, ...]-encoded monomial.
static void displayCoefficient(std::ostream &o, T val, bool print_plus, bool print_one)
std::vector< int > mMonomials
void display(std::ostream &o, const std::vector< std::string > &varnames, bool print_one, bool print_plus, bool print_parens) const
std::vector< int > mComponents
std::vector< mpz_class > mCoefficients
std::string toString(const std::vector< std::string > &varnames, bool print_one, bool print_plus, bool print_parens) const
void debug_display(std::ostream &o) const
static void display(std::ostream &o, const std::vector< std::string > &varnames, const newf4::MonomialView &m)