Commit 1a9d6eec authored by Houtan Bastani's avatar Houtan Bastani Committed by Sébastien Villemot

fixed bug: end _dynamic and _static and getPowerDeriv functions with "end"...

fixed bug: end _dynamic and _static and getPowerDeriv functions with "end" tags to comply with commit d8dbc68e
parent 6bb8d419
...@@ -659,6 +659,7 @@ DataTree::writePowerDeriv(ostream &output, bool use_dll) const ...@@ -659,6 +659,7 @@ DataTree::writePowerDeriv(ostream &output, bool use_dll) const
<< " dxp = dxp*p;" << endl << " dxp = dxp*p;" << endl
<< " p = p-1;" << endl << " p = p-1;" << endl
<< " end" << endl << " end" << endl
<< " end" << endl; << " end" << endl
<< "end" << endl;
} }
...@@ -1530,6 +1530,7 @@ DynamicModel::writeDynamicMFile(const string &dynamic_basename) const ...@@ -1530,6 +1530,7 @@ DynamicModel::writeDynamicMFile(const string &dynamic_basename) const
mDynamicModelFile << "global oo_;" << endl << endl; mDynamicModelFile << "global oo_;" << endl << endl;
writeDynamicModel(mDynamicModelFile, false); writeDynamicModel(mDynamicModelFile, false);
mDynamicModelFile << "end" << endl; // Close *_dynamic function
writePowerDeriv(mDynamicModelFile, false); writePowerDeriv(mDynamicModelFile, false);
mDynamicModelFile.close(); mDynamicModelFile.close();
} }
...@@ -2213,7 +2214,7 @@ DynamicModel::writeDynamicModel(ostream &DynamicOutput, bool use_dll) const ...@@ -2213,7 +2214,7 @@ DynamicModel::writeDynamicModel(ostream &DynamicOutput, bool use_dll) const
<< " g2 = sparse(v2(:,1),v2(:,2),v2(:,3)," << nrows << "," << hessianColsNbr << ");" << endl; << " g2 = sparse(v2(:,1),v2(:,2),v2(:,3)," << nrows << "," << hessianColsNbr << ");" << endl;
else // Either hessian is all zero, or we didn't compute it else // Either hessian is all zero, or we didn't compute it
DynamicOutput << " g2 = sparse([],[],[]," << nrows << "," << hessianColsNbr << ");" << endl; DynamicOutput << " g2 = sparse([],[],[]," << nrows << "," << hessianColsNbr << ");" << endl;
DynamicOutput << "end;" << endl; DynamicOutput << "end" << endl;
// Initialize g3 matrix // Initialize g3 matrix
DynamicOutput << "if nargout >= 4," << endl DynamicOutput << "if nargout >= 4," << endl
...@@ -2229,7 +2230,7 @@ DynamicModel::writeDynamicModel(ostream &DynamicOutput, bool use_dll) const ...@@ -2229,7 +2230,7 @@ DynamicModel::writeDynamicModel(ostream &DynamicOutput, bool use_dll) const
else // Either 3rd derivatives is all zero, or we didn't compute it else // Either 3rd derivatives is all zero, or we didn't compute it
DynamicOutput << " g3 = sparse([],[],[]," << nrows << "," << ncols << ");" << endl; DynamicOutput << " g3 = sparse([],[],[]," << nrows << "," << ncols << ");" << endl;
DynamicOutput << "end;" << endl; DynamicOutput << "end" << endl;
} }
else else
{ {
......
...@@ -1244,7 +1244,8 @@ StaticModel::writeStaticMFile(const string &func_name) const ...@@ -1244,7 +1244,8 @@ StaticModel::writeStaticMFile(const string &func_name) const
else // Either hessian is all zero, or we didn't compute it else // Either hessian is all zero, or we didn't compute it
output << " g2 = sparse([],[],[]," << equations.size() << "," << g2ncols << ");" << endl; output << " g2 = sparse([],[],[]," << equations.size() << "," << g2ncols << ");" << endl;
output << "end;" << endl; // Close the if nargout >= 3 statement output << "end" << endl; // Close the if nargout >= 3 statement
output << "end" << endl; // Close the *_static function
writePowerDeriv(output, false); writePowerDeriv(output, false);
output.close(); output.close();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment