Skip to content

Commit

Permalink
Merge pull request #63 from mpowelson/feature/expose_workspace
Browse files Browse the repository at this point in the history
Expose OSQP Workspace
  • Loading branch information
GiulioRomualdi authored Jun 4, 2020
2 parents 21bfc9e + 3d689f2 commit 8aa7b4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/OsqpEigen/Solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ namespace OsqpEigen
* @return the pointer to Data object.
*/
const std::unique_ptr<OsqpEigen::Data>& data() const;

/**
* Get the pointer to the OSQP workspace.
* @return the pointer to Workspace object.
*/
const std::unique_ptr<OSQPWorkspace, std::function<void(OSQPWorkspace *)>>& workspace() const;
};

#include <OsqpEigen/Solver.tpp>
Expand Down
5 changes: 5 additions & 0 deletions src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ const std::unique_ptr<OsqpEigen::Data>& OsqpEigen::Solver::data() const
return m_data;
}

const std::unique_ptr<OSQPWorkspace, std::function<void(OSQPWorkspace *)>>& OsqpEigen::Solver::workspace() const
{
return m_workspace;
}

bool OsqpEigen::Solver::updateGradient(const Eigen::Ref<const Eigen::Matrix<c_float, Eigen::Dynamic, 1>>& gradient)
{
// check if the dimension of the gradient is correct
Expand Down

0 comments on commit 8aa7b4d

Please sign in to comment.