preprocessor: clean up writePowerDeriv code. it only writes C code, so no need for use_dll argument
parent
d7d2e4fde3
commit
7cd072e064
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
* Copyright (C) 2003-2016 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -684,9 +684,9 @@ DataTree::writePowerDerivCHeader(ostream &output) const
|
|||
}
|
||||
|
||||
void
|
||||
DataTree::writePowerDeriv(ostream &output, bool use_dll) const
|
||||
DataTree::writePowerDeriv(ostream &output) const
|
||||
{
|
||||
if (use_dll && isBinaryOpUsed(oPowerDeriv))
|
||||
if (isBinaryOpUsed(oPowerDeriv))
|
||||
output << "/*" << endl
|
||||
<< " * The k-th derivative of x^p" << endl
|
||||
<< " */" << endl
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2015 Dynare Team
|
||||
* Copyright (C) 2003-2016 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -235,10 +235,10 @@ public:
|
|||
//! Returns the minimum lag (as a negative number) of the given symbol in the whole data tree (and not only in the equations !!)
|
||||
/*! Returns 0 if the symbol is not used */
|
||||
int minLagForSymbol(int symb_id) const;
|
||||
//! Write the Header for getPowerDeriv when use_dll is used
|
||||
//! Write the C Header for getPowerDeriv when use_dll is used
|
||||
void writePowerDerivCHeader(ostream &output) const;
|
||||
//! Write getPowerDeriv
|
||||
void writePowerDeriv(ostream &output, bool use_dll) const;
|
||||
//! Write getPowerDeriv in C
|
||||
void writePowerDeriv(ostream &output) const;
|
||||
//! Thrown when trying to access an unknown variable by deriv_id
|
||||
class UnknownDerivIDException
|
||||
{
|
||||
|
|
|
@ -1624,7 +1624,7 @@ DynamicModel::writeDynamicCFile(const string &dynamic_basename, const int order)
|
|||
// Writing the function body
|
||||
writeDynamicModel(mDynamicModelFile, true, false);
|
||||
|
||||
writePowerDeriv(mDynamicModelFile, true);
|
||||
writePowerDeriv(mDynamicModelFile);
|
||||
mDynamicModelFile.close();
|
||||
|
||||
mDynamicMexFile.open(filename_mex.c_str(), ios::out | ios::binary);
|
||||
|
@ -4823,7 +4823,7 @@ DynamicModel::writeResidualsC(const string &basename, bool cuda) const
|
|||
<< model_output.str()
|
||||
<< "}" << endl;
|
||||
|
||||
writePowerDeriv(mDynamicModelFile, true);
|
||||
writePowerDeriv(mDynamicModelFile);
|
||||
mDynamicModelFile.close();
|
||||
|
||||
}
|
||||
|
@ -4880,8 +4880,6 @@ DynamicModel::writeFirstDerivativesC(const string &basename, bool cuda) const
|
|||
|
||||
mDynamicModelFile << "}" << endl;
|
||||
|
||||
// already written in writeResidualsC()
|
||||
// writePowerDeriv(mDynamicModelFile, true);
|
||||
mDynamicModelFile.close();
|
||||
|
||||
}
|
||||
|
@ -4984,7 +4982,6 @@ DynamicModel::writeFirstDerivativesC_csr(const string &basename, bool cuda) cons
|
|||
<< "for (i=0; i < " << row_ptr.size() + 1 << "; i++) row_ptr[i] = row_ptr_data[i];" << endl;
|
||||
mDynamicModelFile << "}" << endl;
|
||||
|
||||
// writePowerDeriv(mDynamicModelFile, true);
|
||||
mDynamicModelFile.close();
|
||||
|
||||
}
|
||||
|
@ -5077,7 +5074,7 @@ DynamicModel::writeSecondDerivativesC_csr(const string &basename, bool cuda) con
|
|||
|
||||
mDynamicModelFile << "}" << endl;
|
||||
|
||||
writePowerDeriv(mDynamicModelFile, true);
|
||||
writePowerDeriv(mDynamicModelFile);
|
||||
mDynamicModelFile.close();
|
||||
|
||||
}
|
||||
|
@ -5203,7 +5200,7 @@ DynamicModel::writeThirdDerivativesC_csr(const string &basename, bool cuda) cons
|
|||
|
||||
mDynamicModelFile << "}" << endl;
|
||||
|
||||
writePowerDeriv(mDynamicModelFile, true);
|
||||
writePowerDeriv(mDynamicModelFile);
|
||||
mDynamicModelFile.close();
|
||||
|
||||
}
|
||||
|
|
|
@ -1616,7 +1616,7 @@ StaticModel::writeStaticCFile(const string &func_name) const
|
|||
writeStaticModel(output, true, false);
|
||||
output << "}" << endl << endl;
|
||||
|
||||
writePowerDeriv(output, true);
|
||||
writePowerDeriv(output);
|
||||
output.close();
|
||||
|
||||
output.open(filename_mex.c_str(), ios::out | ios::binary);
|
||||
|
|
Loading…
Reference in New Issue