bug fix: getPowerDeriv not accessible from modfile.m
parent
ed81eb22e9
commit
1e4c0852f6
22
DataTree.cc
22
DataTree.cc
|
@ -660,10 +660,7 @@ DataTree::writePowerDerivCHeader(ostream &output) const
|
||||||
void
|
void
|
||||||
DataTree::writePowerDeriv(ostream &output, bool use_dll) const
|
DataTree::writePowerDeriv(ostream &output, bool use_dll) const
|
||||||
{
|
{
|
||||||
if (!isBinaryOpUsed(oPowerDeriv))
|
if (use_dll && isBinaryOpUsed(oPowerDeriv))
|
||||||
return;
|
|
||||||
|
|
||||||
if (use_dll)
|
|
||||||
output << "/*" << endl
|
output << "/*" << endl
|
||||||
<< " * The k-th derivative of x^p" << endl
|
<< " * The k-th derivative of x^p" << endl
|
||||||
<< " */" << endl
|
<< " */" << endl
|
||||||
|
@ -683,21 +680,4 @@ DataTree::writePowerDeriv(ostream &output, bool use_dll) const
|
||||||
<< " return dxp;" << endl
|
<< " return dxp;" << endl
|
||||||
<< " }" << endl
|
<< " }" << endl
|
||||||
<< "}" << endl;
|
<< "}" << endl;
|
||||||
else
|
|
||||||
output << endl
|
|
||||||
<< "%" << endl
|
|
||||||
<< "% The k-th derivative of x^p" << endl
|
|
||||||
<< "%" << endl
|
|
||||||
<< "function dxp=getPowerDeriv(x,p,k)" << endl
|
|
||||||
<< " if (abs(x) < " << NEAR_ZERO << ") && (p > 0) && (k >= p) && (abs(p - round(p)) < " << NEAR_ZERO << ")" << endl
|
|
||||||
<< " dxp = 0;" << endl
|
|
||||||
<< " else" << endl
|
|
||||||
<< " dxp = x^(p-k);" << endl
|
|
||||||
<< " for i=0:k-1" << endl
|
|
||||||
<< " dxp = dxp*p;" << endl
|
|
||||||
<< " p = p-1;" << endl
|
|
||||||
<< " end" << endl
|
|
||||||
<< " end" << endl
|
|
||||||
<< "end" << endl;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -780,7 +780,6 @@ DynamicModel::writeModelEquationsOrdered_M(const string &dynamic_basename) const
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
output << "end" << endl;
|
output << "end" << endl;
|
||||||
writePowerDeriv(output, false);
|
|
||||||
output.close();
|
output.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1513,7 +1512,6 @@ DynamicModel::writeDynamicMFile(const string &dynamic_basename) const
|
||||||
|
|
||||||
writeDynamicModel(mDynamicModelFile, false);
|
writeDynamicModel(mDynamicModelFile, false);
|
||||||
mDynamicModelFile << "end" << endl; // Close *_dynamic function
|
mDynamicModelFile << "end" << endl; // Close *_dynamic function
|
||||||
writePowerDeriv(mDynamicModelFile, false);
|
|
||||||
mDynamicModelFile.close();
|
mDynamicModelFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2022,7 +2020,6 @@ DynamicModel::writeSparseDynamicMFile(const string &dynamic_basename, const stri
|
||||||
mDynamicModelFile << " oo_.endo_simul = y';\n";
|
mDynamicModelFile << " oo_.endo_simul = y';\n";
|
||||||
mDynamicModelFile << "return;\n";
|
mDynamicModelFile << "return;\n";
|
||||||
mDynamicModelFile << "end" << endl;
|
mDynamicModelFile << "end" << endl;
|
||||||
writePowerDeriv(mDynamicModelFile, false);
|
|
||||||
|
|
||||||
mDynamicModelFile.close();
|
mDynamicModelFile.close();
|
||||||
|
|
||||||
|
@ -3674,9 +3671,6 @@ DynamicModel::writeParamsDerivativesFile(const string &basename) const
|
||||||
|
|
||||||
paramsDerivsFile << "end" << endl
|
paramsDerivsFile << "end" << endl
|
||||||
<< "end" << endl;
|
<< "end" << endl;
|
||||||
|
|
||||||
writePowerDeriv(paramsDerivsFile, false);
|
|
||||||
|
|
||||||
paramsDerivsFile.close();
|
paramsDerivsFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -396,7 +396,6 @@ StaticModel::writeModelEquationsOrdered_M(const string &static_basename) const
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
output << "end" << endl;
|
output << "end" << endl;
|
||||||
writePowerDeriv(output, false);
|
|
||||||
output.close();
|
output.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1238,7 +1237,6 @@ StaticModel::writeStaticMFile(const string &func_name) const
|
||||||
|
|
||||||
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
|
output << "end" << endl; // Close the *_static function
|
||||||
writePowerDeriv(output, false);
|
|
||||||
output.close();
|
output.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1322,7 +1320,6 @@ StaticModel::writeStaticBlockMFSFile(const string &basename) const
|
||||||
}
|
}
|
||||||
output << " end" << endl
|
output << " end" << endl
|
||||||
<< "end" << endl;
|
<< "end" << endl;
|
||||||
writePowerDeriv(output, false);
|
|
||||||
output.close();
|
output.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue