preprocessor: split equation output into lhs and rhs. #1387
parent
425bab1461
commit
e2b30857a0
|
@ -1939,12 +1939,12 @@ ModelTree::writeJsonModelEquations(ostream &output, bool residuals) const
|
||||||
if (eq > 0)
|
if (eq > 0)
|
||||||
output << ", ";
|
output << ", ";
|
||||||
|
|
||||||
if (residuals)
|
|
||||||
{
|
|
||||||
BinaryOpNode *eq_node = equations[eq];
|
BinaryOpNode *eq_node = equations[eq];
|
||||||
expr_t lhs = eq_node->get_arg1();
|
expr_t lhs = eq_node->get_arg1();
|
||||||
expr_t rhs = eq_node->get_arg2();
|
expr_t rhs = eq_node->get_arg2();
|
||||||
|
|
||||||
|
if (residuals)
|
||||||
|
{
|
||||||
output << "{\"residual\": {"
|
output << "{\"residual\": {"
|
||||||
<< "\"lhs\": \"";
|
<< "\"lhs\": \"";
|
||||||
lhs->writeJsonOutput(output, temporary_terms, tef_terms);
|
lhs->writeJsonOutput(output, temporary_terms, tef_terms);
|
||||||
|
@ -1970,8 +1970,10 @@ ModelTree::writeJsonModelEquations(ostream &output, bool residuals) const
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
output << "{\"equation\": \"";
|
output << "{\"lhs\": \"";
|
||||||
equations[eq]->writeJsonOutput(output, tt_empty, tef_terms);
|
lhs->writeJsonOutput(output, tt_empty, tef_terms);
|
||||||
|
output << "\", \"rhs\": \"";
|
||||||
|
rhs->writeJsonOutput(output, tt_empty, tef_terms);
|
||||||
output << "\""
|
output << "\""
|
||||||
<< ", \"line\": " << equations_lineno[eq];
|
<< ", \"line\": " << equations_lineno[eq];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue