diff --git a/src/DataTree.cc b/src/DataTree.cc index e97204f70dd89aa6ea72cd60f67c30c79b5e2d94..0dde566463cce33598a2aaa92a1e5f8d646f09a6 100644 --- a/src/DataTree.cc +++ b/src/DataTree.cc @@ -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 { diff --git a/src/DataTree.hh b/src/DataTree.hh index 5e8ad6d70c73200f896c2d2ce13b241443a821c3..8afab57caa9aee9b01d7ce158b3df1e44b62bddd 100644 --- a/src/DataTree.hh +++ b/src/DataTree.hh @@ -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 { diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index a8eac14688ce5f3ab4d063141962c27aa1be015c..965ddc7c1e14a286f1d4fd7186ab405e19990699 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -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"); } diff --git a/src/StaticModel.cc b/src/StaticModel.cc index b9faf9d093ebfe93ceb4c93d40531650425b3583..ad672e87d902f2eb9c65578c439ede70b9a52745 100644 --- a/src/StaticModel.cc +++ b/src/StaticModel.cc @@ -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"); }