Skip to content

Commit

Permalink
Add decision variables to SolverIterationInfo (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Dec 6, 2023
1 parent 0bec174 commit 7aa9947
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/sleipnir/optimization/SolverIterationInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ struct SolverIterationInfo {
/// The solver iteration.
int iteration;

/// The decision variables.
const Eigen::VectorXd& x;

/// The gradient of the cost function.
const Eigen::SparseVector<double>& g;

Expand Down
2 changes: 1 addition & 1 deletion src/optimization/OptimizationProblem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ Eigen::VectorXd OptimizationProblem::InteriorPoint(
}

// Call user callback
if (m_callback({iterations, g, H, A_e, A_i})) {
if (m_callback({iterations, x, g, H, A_e, A_i})) {
status->exitCondition = SolverExitCondition::kCallbackRequestedStop;
return x;
}
Expand Down

0 comments on commit 7aa9947

Please sign in to comment.