diff --git a/include/OsqpEigen/Solver.hpp b/include/OsqpEigen/Solver.hpp index 4f29acd..3f483af 100644 --- a/include/OsqpEigen/Solver.hpp +++ b/include/OsqpEigen/Solver.hpp @@ -231,6 +231,12 @@ namespace OsqpEigen * @return the pointer to Data object. */ const std::unique_ptr& data() const; + + /** + * Get the pointer to the OSQP workspace. + * @return the pointer to Workspace object. + */ + const std::unique_ptr>& workspace() const; }; #include diff --git a/src/Solver.cpp b/src/Solver.cpp index 768d430..e1961aa 100644 --- a/src/Solver.cpp +++ b/src/Solver.cpp @@ -159,6 +159,11 @@ const std::unique_ptr& OsqpEigen::Solver::data() const return m_data; } +const std::unique_ptr>& OsqpEigen::Solver::workspace() const +{ + return m_workspace; +} + bool OsqpEigen::Solver::updateGradient(const Eigen::Ref>& gradient) { // check if the dimension of the gradient is correct