Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
more fixing sparsity
Browse files Browse the repository at this point in the history
  • Loading branch information
shueja committed Nov 14, 2023
1 parent dda51c6 commit 4d5abc6
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/optimization/CasADiIterCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,51 @@ 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) {
return Nlpsol::get_sparsity_out(i);
}

// /// Decision variables at the optimal solution (nx x 1)
// NLPSOL_X,
// /// Cost function value at the optimal solution (1 x 1)
// NLPSOL_F,
// // /// Constraints function at the optimal solution (ng x 1)
// // NLPSOL_G,
// // /// Lagrange multipliers for bounds on X at the solution (nx x 1)
// // NLPSOL_LAM_X,
// // /// Lagrange multipliers for bounds on G at the solution (ng x 1)
// // NLPSOL_LAM_G,
// // /// Lagrange multipliers for bounds on P at the solution (np x 1)
// // NLPSOL_LAM_P,
// // NLPSOL_NUM_OUT
// // };

// function v = get_sparsity_in(self, i)

// n = casadi.nlpsol_out(i);

// if n=='f'

// v = casadi.Sparsity.scalar();

// elseif strcmp(n,'x') || strcmp(n,'lam_x')

// v = casadi.Sparsity.dense(self.nx);

// elseif strcmp(n,'g') || strcmp(n,'lam_g')

// v = casadi.Sparsity.dense(self.ng);

// elseif strcmp(n,'lam_p')

// v = casadi.Sparsity.dense(self.np);

// else

// v = casadi.Sparsity(0,0);

// end
}

// Initialize the object
void init() override {
Expand Down

0 comments on commit 4d5abc6

Please sign in to comment.