ModelTree: fix call to ExprNode::computeTemporaryTerms()

The first argument to ExprNode::computeTemporaryTerms() is supposed to be a
pair (endo derivation order, param derivation order). The two elements were
interverted in the call. This would not affect the result, because parameter
derivatives are not computed there and what matters is the lexical ordering
which remains the same. But fixing the order is better, for consistency with
the method description.
master
Sébastien Villemot 2023-03-27 17:07:27 +02:00
parent 34c37cfd01
commit 3b20f835db
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 2 additions and 2 deletions

View File

@ -932,7 +932,7 @@ ModelTree::computeTemporaryTerms(bool is_matlab, bool no_tmp_terms)
for (int order = 1; order < static_cast<int>(derivatives.size()); order++)
for (const auto &it : derivatives[order])
it.second->computeTemporaryTerms({ 0, order },
it.second->computeTemporaryTerms({ order, 0 },
temp_terms_map,
reference_count,
is_matlab);
@ -949,7 +949,7 @@ ModelTree::computeTemporaryTerms(bool is_matlab, bool no_tmp_terms)
temporary_terms_derivatives.clear();
temporary_terms_derivatives.resize(derivatives.size());
for (int order = 0; order < static_cast<int>(derivatives.size()); order++)
temporary_terms_derivatives[order] = move(temp_terms_map[{ 0, order }]);
temporary_terms_derivatives[order] = move(temp_terms_map[{ order, 0 }]);
// Compute indices in MATLAB/Julia vector
for (int order {0}, idx {0}; order < static_cast<int>(derivatives.size()); order++)