preprocessor: simplify writing of NNZDerivatives
parent
fe861fee76
commit
f26551509c
|
@ -2862,20 +2862,17 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
|
||||||
|
|
||||||
// Write number of non-zero derivatives
|
// Write number of non-zero derivatives
|
||||||
// Use -1 if the derivatives have not been computed
|
// Use -1 if the derivatives have not been computed
|
||||||
output << "M_.NNZDerivatives = zeros(3, 1);" << endl
|
output << "M_.NNZDerivatives = [" << NNZDerivatives[0] << "; ";
|
||||||
<< "M_.NNZDerivatives(1) = " << NNZDerivatives[0] << ";" << endl;
|
|
||||||
if (order > 1)
|
if (order > 1)
|
||||||
{
|
output << NNZDerivatives[1] << "; ";
|
||||||
output << "M_.NNZDerivatives(2) = " << NNZDerivatives[1] << ";" << endl;
|
|
||||||
if (order > 2)
|
|
||||||
output << "M_.NNZDerivatives(3) = " << NNZDerivatives[2] << ";" << endl;
|
|
||||||
else
|
|
||||||
output << "M_.NNZDerivatives(3) = -1;" << endl;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
output << "M_.NNZDerivatives(2) = -1;" << endl
|
output << "-1; ";
|
||||||
<< "M_.NNZDerivatives(3) = -1;" << endl;
|
|
||||||
|
|
||||||
|
if (order > 2)
|
||||||
|
output << NNZDerivatives[2];
|
||||||
|
else
|
||||||
|
output << "-1";
|
||||||
|
output << "];" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
map<pair<int, pair<int, int > >, expr_t>
|
map<pair<int, pair<int, int > >, expr_t>
|
||||||
|
|
Loading…
Reference in New Issue