fixed bug: end _dynamic and _static and getPowerDeriv functions with "end" tags to comply with commit d8dbc68e84

time-shift
Houtan Bastani 2010-12-20 14:40:26 +01:00 committed by Sébastien Villemot
parent 6bb8d41909
commit 1a9d6eece5
3 changed files with 7 additions and 4 deletions

View File

@ -659,6 +659,7 @@ DataTree::writePowerDeriv(ostream &output, bool use_dll) const
<< " dxp = dxp*p;" << endl
<< " p = p-1;" << endl
<< " end" << endl
<< " end" << endl;
<< " end" << endl
<< "end" << endl;
}

View File

@ -1530,6 +1530,7 @@ DynamicModel::writeDynamicMFile(const string &dynamic_basename) const
mDynamicModelFile << "global oo_;" << endl << endl;
writeDynamicModel(mDynamicModelFile, false);
mDynamicModelFile << "end" << endl; // Close *_dynamic function
writePowerDeriv(mDynamicModelFile, false);
mDynamicModelFile.close();
}
@ -2213,7 +2214,7 @@ DynamicModel::writeDynamicModel(ostream &DynamicOutput, bool use_dll) const
<< " g2 = sparse(v2(:,1),v2(:,2),v2(:,3)," << nrows << "," << hessianColsNbr << ");" << endl;
else // Either hessian is all zero, or we didn't compute it
DynamicOutput << " g2 = sparse([],[],[]," << nrows << "," << hessianColsNbr << ");" << endl;
DynamicOutput << "end;" << endl;
DynamicOutput << "end" << endl;
// Initialize g3 matrix
DynamicOutput << "if nargout >= 4," << endl
@ -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
DynamicOutput << " g3 = sparse([],[],[]," << nrows << "," << ncols << ");" << endl;
DynamicOutput << "end;" << endl;
DynamicOutput << "end" << endl;
}
else
{

View File

@ -1244,7 +1244,8 @@ StaticModel::writeStaticMFile(const string &func_name) const
else // Either hessian is all zero, or we didn't compute it
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);
output.close();
}