From 494628d961a2876feeb906c03622009cc0d331be Mon Sep 17 00:00:00 2001 From: shueja-personal Date: Tue, 14 Nov 2023 01:24:13 -0800 Subject: [PATCH] maybe this time --- src/optimization/CasADiOpti.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/optimization/CasADiOpti.cpp b/src/optimization/CasADiOpti.cpp index 822534c2..8dda2163 100644 --- a/src/optimization/CasADiOpti.cpp +++ b/src/optimization/CasADiOpti.cpp @@ -24,12 +24,12 @@ void CasADiOpti::SetInitial(const casadi::MX& expression, double value) { opti.set_initial(expression, value); } void CasADiOpti::Solve() { - auto callback = new CasADiIterCallback("f", opti.nx(), opti.ng(), opti.np()); +CasADiIterCallback cb("f", opti.nx(), opti.ng(), opti.np()); #ifdef DEBUG_OUTPUT // I don't try-catch this next line since it should always work. // I'm assuming the dynamic lib is on the path and casadi can find it. auto pluginOptions = casadi::Dict(); - pluginOptions["iteration_callback"] = *callback; + pluginOptions["iteration_callback"] = cb; //auto reference = &pluginOptions["iteration_callback"]; opti.solver("ipopt", pluginOptions); #else