Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Feb 15, 2024
1 parent 8a20acf commit 011cc22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class SQPCallback
using Ptr = std::shared_ptr<SQPCallback>;
using ConstPtr = std::shared_ptr<const SQPCallback>;

virtual ~SQPCallback() = default;

/**
* @brief This is the function called during the SQP
* @param nlp The ifopt::Problem being optimized
Expand Down
4 changes: 2 additions & 2 deletions trajopt_optimizers/trajopt_sqp/src/ifopt_qp_problem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ double IfoptQPProblem::evaluateTotalConvexCost(const Eigen::Ref<const Eigen::Vec
Eigen::VectorXd IfoptQPProblem::evaluateConvexCosts(const Eigen::Ref<const Eigen::VectorXd>& var_vals)
{
if (num_nlp_costs_ == 0)
return Eigen::VectorXd();
return {};

auto var_block = var_vals.head(num_nlp_vars_);
Eigen::VectorXd result_quad = var_block.transpose() * hessian_.block(0, 0, num_nlp_vars_, num_nlp_vars_) * var_block;
Expand All @@ -445,7 +445,7 @@ double IfoptQPProblem::evaluateTotalExactCost(const Eigen::Ref<const Eigen::Vect
Eigen::VectorXd IfoptQPProblem::evaluateExactCosts(const Eigen::Ref<const Eigen::VectorXd>& var_vals)
{
if (!nlp_->HasCostTerms())
return Eigen::VectorXd();
return {};

nlp_->SetVariables(var_vals.data());
return nlp_->GetCosts().GetValues();
Expand Down

0 comments on commit 011cc22

Please sign in to comment.