diff --git a/src/optimization/CasADiIterCallback.h b/src/optimization/CasADiIterCallback.h index cd1788a2..e04f6edf 100644 --- a/src/optimization/CasADiIterCallback.h +++ b/src/optimization/CasADiIterCallback.h @@ -1,5 +1,6 @@ #include "casadi/casadi.hpp" #include "casadi/core/nlpsol.hpp" +#include "casadi/core/sparsity.hpp" using namespace casadi; class CasADiIterCallback : public Callback { // Data members @@ -20,18 +21,18 @@ class CasADiIterCallback : public Callback { // Number of inputs and outputs casadi_int get_n_in() override { return 6;} casadi_int get_n_out() override { return 1;} - Sparsity get_sparsity_in(casadi_int i) { + Sparsity get_sparsity_in(casadi_int i) override { switch (static_cast(i)) { case NLPSOL_F: - return Sparsity.scalar(); + return Sparsity::scalar(); case NLPSOL_X: case NLPSOL_LAM_X: - return Sparsity.dense(nx); + return Sparsity::dense(nx); case NLPSOL_LAM_G: case NLPSOL_G: - return Sparsity.dense(ng); + return Sparsity::dense(ng); case NLPSOL_LAM_P: - return Sparsity.dense(np); + return Sparsity::dense(np); case NLPSOL_NUM_OUT: break; } return Sparsity();