Fix output of external functions (and their derivatives) in LaTeX.
parent
8d042b8121
commit
380df90748
25
ExprNode.cc
25
ExprNode.cc
|
@ -4385,9 +4385,12 @@ ExternalFunctionNode::writeOutput(ostream &output, ExprNodeOutputType output_typ
|
||||||
const temporary_terms_t &temporary_terms,
|
const temporary_terms_t &temporary_terms,
|
||||||
deriv_node_temp_terms_t &tef_terms) const
|
deriv_node_temp_terms_t &tef_terms) const
|
||||||
{
|
{
|
||||||
if (output_type == oMatlabOutsideModel || output_type == oSteadyStateFile || output_type == oCSteadyStateFile)
|
if (output_type == oMatlabOutsideModel || output_type == oSteadyStateFile
|
||||||
|
|| output_type == oCSteadyStateFile || IS_LATEX(output_type))
|
||||||
{
|
{
|
||||||
output << datatree.symbol_table.getName(symb_id) << "(";
|
string name = IS_LATEX(output_type) ? datatree.symbol_table.getTeXName(symb_id)
|
||||||
|
: datatree.symbol_table.getName(symb_id);
|
||||||
|
output << name << "(";
|
||||||
writeExternalFunctionArguments(output, output_type, temporary_terms, tef_terms);
|
writeExternalFunctionArguments(output, output_type, temporary_terms, tef_terms);
|
||||||
output << ")";
|
output << ")";
|
||||||
return;
|
return;
|
||||||
|
@ -4924,6 +4927,15 @@ FirstDerivExternalFunctionNode::writeOutput(ostream &output, ExprNodeOutputType
|
||||||
{
|
{
|
||||||
assert(output_type != oMatlabOutsideModel);
|
assert(output_type != oMatlabOutsideModel);
|
||||||
|
|
||||||
|
if (IS_LATEX(output_type))
|
||||||
|
{
|
||||||
|
output << "\\frac{\\partial " << datatree.symbol_table.getTeXName(symb_id)
|
||||||
|
<< "}{\\partial " << inputIndex << "}(";
|
||||||
|
writeExternalFunctionArguments(output, output_type, temporary_terms, tef_terms);
|
||||||
|
output << ")";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If current node is a temporary term
|
// If current node is a temporary term
|
||||||
temporary_terms_t::const_iterator it = temporary_terms.find(const_cast<FirstDerivExternalFunctionNode *>(this));
|
temporary_terms_t::const_iterator it = temporary_terms.find(const_cast<FirstDerivExternalFunctionNode *>(this));
|
||||||
if (it != temporary_terms.end())
|
if (it != temporary_terms.end())
|
||||||
|
@ -5179,6 +5191,15 @@ SecondDerivExternalFunctionNode::writeOutput(ostream &output, ExprNodeOutputType
|
||||||
{
|
{
|
||||||
assert(output_type != oMatlabOutsideModel);
|
assert(output_type != oMatlabOutsideModel);
|
||||||
|
|
||||||
|
if (IS_LATEX(output_type))
|
||||||
|
{
|
||||||
|
output << "\\frac{\\partial^2 " << datatree.symbol_table.getTeXName(symb_id)
|
||||||
|
<< "}{\\partial " << inputIndex1 << "\\partial " << inputIndex2 << "}(";
|
||||||
|
writeExternalFunctionArguments(output, output_type, temporary_terms, tef_terms);
|
||||||
|
output << ")";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If current node is a temporary term
|
// If current node is a temporary term
|
||||||
temporary_terms_t::const_iterator it = temporary_terms.find(const_cast<SecondDerivExternalFunctionNode *>(this));
|
temporary_terms_t::const_iterator it = temporary_terms.find(const_cast<SecondDerivExternalFunctionNode *>(this));
|
||||||
if (it != temporary_terms.end())
|
if (it != temporary_terms.end())
|
||||||
|
|
Loading…
Reference in New Issue