Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose OSQP Workspace #63

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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