Skip to content

Commit

Permalink
Fixes two forgotten csc_spfree calls
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoomen authored and Levi-Armstrong committed Dec 8, 2023
1 parent 713cc9d commit d744f46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trajopt_optimizers/trajopt_sqp/src/osqp_eigen_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ bool OSQPEigenSolver::updateLinearConstraintsMatrix(const SparseMatrix& linearCo
bool success = solver_.updateLinearConstraintsMatrix(cleaned);
if (cleaned.nonZeros() == 0) /** @todo Remove when upgrading to OSQP 1.0.0 */
{
csc_spfree(solver_.data()->getData()->A);
csc_spfree_fix(solver_.data()->getData()->A);
solver_.data()->getData()->A = nullptr;
solver_.data()->getData()->A = csc_spalloc_fix(cleaned.rows(), cleaned.cols(), 0, 1, 0);
}
Expand All @@ -322,7 +322,7 @@ bool OSQPEigenSolver::updateLinearConstraintsMatrix(const SparseMatrix& linearCo
bool success = solver_.data()->setLinearConstraintsMatrix(cleaned);
if (cleaned.nonZeros() == 0) /** @todo Remove when upgrading to OSQP 1.0.0 */
{
csc_spfree(solver_.data()->getData()->A);
csc_spfree_fix(solver_.data()->getData()->A);
solver_.data()->getData()->A = nullptr;
solver_.data()->getData()->A = csc_spalloc_fix(cleaned.rows(), cleaned.cols(), 0, 1, 0);
}
Expand Down

0 comments on commit d744f46

Please sign in to comment.