From 0a3a5a0a03c300746a801ddc21fea40bce4825df Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Wed, 29 Jul 2015 10:40:30 +0200 Subject: [PATCH] bug fix in writing of dynamic params derivs file --- DynamicModel.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/DynamicModel.cc b/DynamicModel.cc index 29f478f0..1c9a2db7 100644 --- a/DynamicModel.cc +++ b/DynamicModel.cc @@ -3882,8 +3882,9 @@ DynamicModel::writeParamsDerivativesFile(const string &basename, bool julia) con paramsDerivsFile << ";" << endl; } - // If nargout >= 3... - paramsDerivsFile << "if nargout >= 3" << endl; + if (!julia) + // If nargout >= 3... + paramsDerivsFile << "if nargout >= 3" << endl; // Write parameter second derivatives (only if nargout >= 3) paramsDerivsFile << "rpp = zeros(" << residuals_params_second_derivatives.size() @@ -3945,9 +3946,10 @@ DynamicModel::writeParamsDerivativesFile(const string &basename, bool julia) con paramsDerivsFile << ";" << endl; } - // If nargout >= 5... - paramsDerivsFile << "end" << endl - << "if nargout >= 5" << endl; + if (!julia) + // If nargout >= 5... + paramsDerivsFile << "end" << endl + << "if nargout >= 5" << endl; // Write hessian derivatives (only if nargout >= 5) paramsDerivsFile << "hp = zeros(" << hessian_params_derivatives.size() << ",5);" << endl;