40 inline Term eval_derivative<MathOp::add>(
const Term& first,
56 solution.
a = first.
a +
"+" + second.
a;
60 solution.
a = second.
a;
64 solution.
b = first.
b +
"+" + second.
b;
68 solution.
b = second.
b;
77 inline Term eval_derivative<MathOp::sub>(
const Term& first,
93 solution.
a = first.
a +
"-" + second.
a;
97 solution.
a =
"(-" + second.
a +
")";
101 solution.
b = first.
b +
"-" + second.
b;
103 solution.
b = first.
b;
105 solution.
b =
"(-" + second.
b +
")";
114 inline Term eval_derivative<MathOp::mul>(
const Term& first,
123 solution.
deriv +=
"+(" + first.
expr +
")*(" + second.
deriv +
"))";
133 solution.
a =
"(" + first.
a +
")*(" + second.
b +
")";
135 solution.
a =
"(" + first.
b +
")*(" + second.
a +
")";
139 solution.
b =
"(" + first.
b +
")*(" + second.
b +
")";
152 inline Term eval_derivative<MathOp::div>(
const Term& first,
160 deriv_invalid =
true;
168 solution.
a =
"(" + first.
a +
")/" + second.
expr;
172 solution.
b =
"(" + first.
b +
")/" + second.
expr;
Term eval_derivative(const Term &first, const Term &second, bool &deriv_invalid, bool &eqn_invalid)
MathOp
operators beign supported as part of binary expressions
encapsulates code generation backend implementations
Represent a term in differential equation and it's "current" solution.
std::string expr
expression being solved
bool deriv_nonzero() const
helper routines used in parser
std::string deriv
derivative of the expression