47 if ((
b != 0 && e.
a != 0) || (
a != 0 && e.
b != 0) || (
a != 0 && e.
a != 0)) {
48 std::cout <<
"(" << *
this <<
") * (" << e <<
")" 49 <<
" does not result in a quadratic expression." << std::endl;
55 ret.
b =
c * e.
b +
b * e.
c;
56 ret.
a =
c * e.
a +
a * e.
c +
b * e.
b;
69 return a * x * x +
b * x +
c;
QuadExpr & operator-=(const QuadExpr &e)
QuadExpr operator*(const QuadExpr &e) const
QuadExpr & operator+=(const QuadExpr &e)
std::ostream & operator<<(std::ostream &os, const QuadExpr &e)
QuadExpr operator-(const QuadExpr &e) const
QuadExpr & operator*=(const QuadExpr &e)
double Eval(double x) const
QuadExpr operator+(const QuadExpr &e) const