Julia: drop get_power_deriv function from module
The function is now provided separately by Dynare.jl.master
parent
4ae6df494d
commit
762243c705
|
@ -917,26 +917,6 @@ DataTree::writePowerDeriv(ostream &output) const
|
|||
<< "}" << endl;
|
||||
}
|
||||
|
||||
void
|
||||
DataTree::writePowerDerivJulia(ostream &output) const
|
||||
{
|
||||
if (isBinaryOpUsed(BinaryOpcode::powerDeriv))
|
||||
output << "nearbyint(x::T) where T <: Real = (abs((x)-floor(x)) < abs((x)-ceil(x)) ? floor(x) : ceil(x))" << endl
|
||||
<< endl
|
||||
<< "function get_power_deriv(x::T, p::T, k::Int64) where T <: Real" << endl
|
||||
<< " if (abs(x) < 1e-12 && p > 0 && k > p && abs(p-nearbyint(p)) < 1e-12 )" << endl
|
||||
<< " return 0.0" << endl
|
||||
<< " else" << endl
|
||||
<< " dxp = x^(p-k)" << endl
|
||||
<< " for i = 1:k" << endl
|
||||
<< " dxp *= p" << endl
|
||||
<< " p -= 1" << endl
|
||||
<< " end" << endl
|
||||
<< " return dxp" << endl
|
||||
<< " end" << endl
|
||||
<< "end" << endl;
|
||||
}
|
||||
|
||||
void
|
||||
DataTree::writePowerDerivHeader(ostream &output) const
|
||||
{
|
||||
|
|
|
@ -281,8 +281,6 @@ public:
|
|||
void writePowerDeriv(ostream &output) const;
|
||||
//! Write getPowerDeriv in C (prototype)
|
||||
void writePowerDerivHeader(ostream &output) const;
|
||||
//! Write getPowerDeriv in Julia
|
||||
void writePowerDerivJulia(ostream &output) const;
|
||||
//! Thrown when trying to access an unknown variable by deriv_id
|
||||
class UnknownDerivIDException
|
||||
{
|
||||
|
|
|
@ -930,12 +930,7 @@ DynamicModel::writeDynamicJuliaFile(const string &basename) const
|
|||
<< " dynamicResid!(T, residual, y, x, params, steady_state, it_, false)" << endl
|
||||
<< " return nothing" << endl
|
||||
<< "end" << endl
|
||||
<< endl;
|
||||
|
||||
// Write function definition if BinaryOpcode::powerDeriv is used
|
||||
writePowerDerivJulia(output);
|
||||
|
||||
output << "end" << endl;
|
||||
<< "end" << endl;
|
||||
|
||||
writeToFileIfModified(output, basename + "Dynamic.jl");
|
||||
}
|
||||
|
|
|
@ -818,12 +818,7 @@ StaticModel::writeStaticJuliaFile(const string &basename) const
|
|||
<< " staticResid!(T, residual, y, x, params, false)" << endl
|
||||
<< " return nothing" << endl
|
||||
<< "end" << endl
|
||||
<< endl;
|
||||
|
||||
// Write function definition if BinaryOpcode::powerDeriv is used
|
||||
writePowerDerivJulia(output);
|
||||
|
||||
output << "end" << endl;
|
||||
<< "end" << endl;
|
||||
|
||||
writeToFileIfModified(output, basename + "Static.jl");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue