Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
508bd28
osqp/: Create dense, solver, wrapper files
Lucas-Haubert Jul 25, 2025
4fd1c6e
osqp/dense/wrapper: Function init_osqp_settings to call after constru…
Lucas-Haubert Jul 26, 2025
7b0fe6f
osqp/utils/prints: Add print preambule function
Lucas-Haubert Jul 26, 2025
97204a7
proxqp/dense/workspace: Add OSQP material
Lucas-Haubert Jul 26, 2025
29d794a
Copyright date in osqp/utils/prints
Lucas-Haubert Jul 26, 2025
8c3eee6
bindings: Add OSQP
Lucas-Haubert Jul 28, 2025
4498ae0
Moved zeta_eq and zeta_in in results
Lucas-Haubert Jul 28, 2025
256892f
osqp/dense/solver: Structure of the function qp_solve
Lucas-Haubert Jul 29, 2025
70b660a
osqp/dense/solver: Coded ADMM with no mu update
Lucas-Haubert Jul 29, 2025
fe18192
test: Add unit tests for ADMM only
Lucas-Haubert Jul 29, 2025
7f971c9
Add remove columns step in setup_factorisation_complete_kkt i ncase o…
Lucas-Haubert Jul 30, 2025
739dbe2
Renamed setup_factorisation_somplete_kkt into factorization_complete_kkt
Lucas-Haubert Jul 30, 2025
0ced984
Removed assrt on type_check in exposeAndExportValues
Lucas-Haubert Jul 30, 2025
cc7e3ff
Mu update
Lucas-Haubert Jul 30, 2025
5e3b145
Polishing
Lucas-Haubert Aug 3, 2025
5097cfc
Tests: Set precision 1e-3 in unit tests
Lucas-Haubert Aug 3, 2025
392f988
Polishing: Perform polishing factorization and solve in separate ldl …
Lucas-Haubert Aug 3, 2025
a48d218
Fix unit tests before calibration with osqp source
Lucas-Haubert Aug 6, 2025
9e5b068
Test osqp_dense_maros_meszaros: Comparaison of OSQP proxsuite and sou…
Lucas-Haubert Aug 6, 2025
41996c7
Renamed examples/python/osqp_calibration.py into examples/python/osqp…
Lucas-Haubert Aug 6, 2025
1c0a5e4
tests osqp: print iter_ext instead of iter
Lucas-Haubert Aug 6, 2025
d29e7cf
unit test: degenerate: File to compare proxsuite vs source
Lucas-Haubert Aug 6, 2025
e33f103
osqp solver header: Documentation of the code blocks
Lucas-Haubert Aug 7, 2025
23cd995
unit test: Add tests for solution polishing
Lucas-Haubert Aug 7, 2025
61228de
Failing tests in wrapper: document them
Lucas-Haubert Aug 7, 2025
19773c8
calibration: Compare the rho_estimate values instead of mu_eq and mu_…
Lucas-Haubert Aug 7, 2025
8f7745a
solver: Correction in ADMM update
Lucas-Haubert Aug 8, 2025
ca5d60a
Setup of calibration tests
Lucas-Haubert Aug 8, 2025
311bb5e
Calibration strongly convex qp, not strongly convex, degenerate
Lucas-Haubert Aug 8, 2025
eb465d4
examples/python/osqp_calibration: Refactor code
Lucas-Haubert Aug 12, 2025
a5f15cf
Calibration: Add primal and dual infeasibility detection, box_constra…
Lucas-Haubert Aug 12, 2025
6276769
Calibration maros meszaros: Add skipped problems in unit test
Lucas-Haubert Aug 13, 2025
dfa4c48
Calibration: Add comments on results
Lucas-Haubert Aug 13, 2025
2e57db7
Calibration: Add arguments eps primal and dual inf
Lucas-Haubert Aug 13, 2025
15d1d4e
Calibration: Add comments on box constrained and not strongly convex …
Lucas-Haubert Aug 13, 2025
fdf7f54
Bindings: Expose polishing results
Lucas-Haubert Aug 13, 2025
dacc79c
Solver: Removed use of status NO_ACTIVE_SET_FOUND to get close to the…
Lucas-Haubert Aug 13, 2025
fe2df10
Calibration: Add calibration on polishing, and passed tests on strong…
Lucas-Haubert Aug 13, 2025
2e4bf92
Calibration; Reshaped calibration_base
Lucas-Haubert Aug 14, 2025
acd542c
Rafactoring: timings
Lucas-Haubert Aug 14, 2025
8381a71
Calibration: Comment tests (temp) before to integrate them in ctest
Lucas-Haubert Aug 14, 2025
715b6a1
Refactoring: Remove useless includes in status header
Lucas-Haubert Aug 14, 2025
f13755b
Refactoring: Changed PROXSUITE_PROXQP_TIMINGS_HPP into PROXSUITE_COMM…
Lucas-Haubert Aug 14, 2025
0055b76
Refactoring: using namespace common before proxqp (convention)
Lucas-Haubert Aug 14, 2025
1d74150
Refactoring: status
Lucas-Haubert Aug 14, 2025
fe8412f
Refactoring: Views + call using namespace proxsuite and using proxsui…
Lucas-Haubert Aug 15, 2025
f88fe0d
Refactoring: Settings
Lucas-Haubert Aug 15, 2025
06dcce4
dense/fwd.hpp: Add include of linalg for using proxsuite::linalg
Lucas-Haubert Aug 15, 2025
8a60cc7
Refactoring: dense/fwd
Lucas-Haubert Aug 15, 2025
564ebc6
Refactoring: Results
Lucas-Haubert Aug 15, 2025
a8ab88f
Refactoring: Preconditioner
Lucas-Haubert Aug 15, 2025
0a24d1a
Refactoring: Workspace
Lucas-Haubert Aug 15, 2025
3050940
Refactoring: Backward data
Lucas-Haubert Aug 16, 2025
6d6523c
Refactoring: Move save_data in helpers
Lucas-Haubert Aug 16, 2025
4ff2137
Refactoring: Move mu_update in helpers
Lucas-Haubert Aug 16, 2025
2839515
Refactoring: Moved functions for iterative solve from proxqp/dense/so…
Lucas-Haubert Aug 16, 2025
a054919
Refactoring: print_setup_header function and add enum Solver to mutua…
Lucas-Haubert Aug 16, 2025
1983f9a
Refactoring: Put new function for print iteration line
Lucas-Haubert Aug 16, 2025
58b3016
Refactoring: Model
Lucas-Haubert Aug 16, 2025
0efedb2
Refactoring: helpers
Lucas-Haubert Aug 16, 2025
b1222aa
Refactoring: utils
Lucas-Haubert Aug 16, 2025
4c37cad
Refactoring: osqp utils
Lucas-Haubert Aug 16, 2025
4fed132
Refactoring: random_qp_problems
Lucas-Haubert Aug 16, 2025
8632a86
Refactoring: Rename enum Solver into QPSolver
Lucas-Haubert Aug 16, 2025
2a46ec9
Refactoring: Constants for QPSolverOutput with common name, not PROXQ…
Lucas-Haubert Aug 16, 2025
4e0f4fd
Refactoring: Updates dates relative to this PR in 2025
Lucas-Haubert Aug 16, 2025
4f8fda3
Refactoring: Update namespaces in bindings for common content
Lucas-Haubert Aug 16, 2025
06dfafe
Refactoring: Put in common functions in osqp and proxqp dense/solver …
Lucas-Haubert Aug 16, 2025
2e26851
Refactoring: Removed the using proxsuite::common aliases in each file…
Lucas-Haubert Aug 17, 2025
bedb42f
Organize calls to namespace common via, for headers: alias for struct…
Lucas-Haubert Aug 17, 2025
5cbb4a3
Clean code: English mistake in polish status suceed changed into suce…
Lucas-Haubert Aug 17, 2025
6c9ba5b
Clean code: Removed remaining mentions to proxqp in common code
Lucas-Haubert Aug 17, 2025
5687f1f
Refactoring: CRTP to refactor dense wrapper
Lucas-Haubert Aug 17, 2025
b394c77
Clean code: renamed alpha_osqp and delta_osqp into alpha and delta
Lucas-Haubert Aug 17, 2025
06cdc64
Clean code: Remove deprecated use of proxqp:: in a commented example
Lucas-Haubert Aug 17, 2025
b7bf6f9
Refactoring: common/results: Noticed that values of mu are arbitrary,…
Lucas-Haubert Aug 17, 2025
5c37852
Refactoring: Comment note regarding the defaults values in headers re…
Lucas-Haubert Aug 17, 2025
3022bb1
osqp::dense::solve: Add polishing options
Lucas-Haubert Aug 17, 2025
e2c0935
Clean code: Renamed option polishing into polish
Lucas-Haubert Aug 17, 2025
d760770
Clean code: Specify solver name in unit tests
Lucas-Haubert Aug 18, 2025
01318f5
Refactoring: Split folders in examples/ and test/
Lucas-Haubert Aug 18, 2025
4a3b4ae
test/src/osqp/: Comments on failing test on degenerate
Lucas-Haubert Aug 18, 2025
41da366
test/src/osqp/dense_qp_wrapper.py: Corrected proxsuite.proxqp into pr…
Lucas-Haubert Aug 18, 2025
1d3737c
unit test: Commented failed tests in osqp/dense_qp_wrapper
Lucas-Haubert Aug 18, 2025
850ec14
Coded check_termination option inspired from OSQP source code
Lucas-Haubert Aug 20, 2025
0e7e07b
Rename PolishStatus into PolishOutput
Lucas-Haubert Aug 20, 2025
451ac4d
test: Updates comments on option primal_infeasibility_solving in OSQP…
Lucas-Haubert Aug 20, 2025
6b5c8f8
osqp/calibration: Deactivate run of calibration tests in ctest
Lucas-Haubert Aug 21, 2025
febb65f
README: Add WIP: OSQP section
Lucas-Haubert Aug 21, 2025
545ace5
ci: run_test option in test_calibration_qp and test_calibration_maros…
Lucas-Haubert Aug 21, 2025
b8c26e1
ci: Remove calibration from tests in CI and ctest
Lucas-Haubert Aug 21, 2025
0feedd2
osqp/dense/solver.hpp: Removed unsuded variable sqrt_mu_update
Lucas-Haubert Aug 21, 2025
88eee84
ci: expose-all.cpp: changed dense_module into proxqp_dense_module in …
Lucas-Haubert Aug 21, 2025
705914d
ci: Add osqp in environment.yml
Lucas-Haubert Aug 21, 2025
a8bc5b1
ci: Management of proxqp and common namespace in test proxqp/parallel…
Lucas-Haubert Aug 21, 2025
243d078
Unit tests OSQP: eps_abs = 1e-5 (high precision), except for dense_qp…
Lucas-Haubert Aug 21, 2025
4af963a
changelog: Add entry
Lucas-Haubert Aug 22, 2025
1d0928c
cmake: Use patched jrl-cmakemodules
jorisv Sep 3, 2025
2391a00
python: Remove useless include
jorisv Sep 3, 2025
e0bcfab
python: Use nanobind function instead of CPython API
jorisv Sep 3, 2025
204f70f
python: Fix type_name_short to return type name without module
jorisv Sep 4, 2025
2ea0269
ci: Remove deprecated ROS version
jorisv Sep 4, 2025
77ddd62
packaging: Fix build
jorisv Sep 4, 2025
c68f351
cmake: jrl-cmakemodules patch is merged
jorisv Sep 8, 2025
569c87f
cmake-module: update
Lucas-Haubert Sep 15, 2025
0af2ddb
Removed useless REGEX in string(REGEX REPLACE
Lucas-Haubert Sep 15, 2025
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
8 changes: 0 additions & 8 deletions .github/workflows/ci-linux-ros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,11 @@ jobs:
strategy:
matrix:
env:
# ROS1 Noetic. EOL: May 2025
- {name: "Noetic / Debug", ROS_DISTRO: noetic, CMAKE_BUILD_TYPE: Debug, VECTORIZATION_SUPPORT: OFF}
- {name: "Noetic / Release", ROS_DISTRO: noetic, CMAKE_BUILD_TYPE: Release, VECTORIZATION_SUPPORT: OFF}
# ROS2 Jazzy Jalisco (May 2024 - May 2029)
- {name: "Jazzy / Debug", ROS_DISTRO: jazzy, CMAKE_BUILD_TYPE: Debug, VECTORIZATION_SUPPORT: OFF}
- {name: "Jazzy / Release", ROS_DISTRO: jazzy, CMAKE_BUILD_TYPE: Release, VECTORIZATION_SUPPORT: OFF}
- {name: "Jazzy / Debug / Vectorization", ROS_DISTRO: jazzy, CMAKE_BUILD_TYPE: Debug, VECTORIZATION_SUPPORT: ON}
- {name: "Jazzy / Release / Vectorization", ROS_DISTRO: jazzy, CMAKE_BUILD_TYPE: Release, VECTORIZATION_SUPPORT: ON}
# ROS2 Iron Irwini (May 2023 - November 2024)
- {name: "Iron / Debug", ROS_DISTRO: iron, CMAKE_BUILD_TYPE: Debug, VECTORIZATION_SUPPORT: OFF}
- {name: "Iron / Release", ROS_DISTRO: iron, CMAKE_BUILD_TYPE: Release, VECTORIZATION_SUPPORT: OFF}
- {name: "Iron / Debug / Vectorization", ROS_DISTRO: iron, CMAKE_BUILD_TYPE: Debug, VECTORIZATION_SUPPORT: ON}
- {name: "Iron / Release / Vectorization", ROS_DISTRO: iron, CMAKE_BUILD_TYPE: Release, VECTORIZATION_SUPPORT: ON}
# ROS2 Humble Hawksbill (May 2022 - May 2027)
- {name: "Humble / Debug / Vectorization", ROS_DISTRO: humble, CMAKE_BUILD_TYPE: Debug, VECTORIZATION_SUPPORT: ON}
- {name: "Humble / Release / Vectorization", ROS_DISTRO: humble, CMAKE_BUILD_TYPE: Release, VECTORIZATION_SUPPORT: ON}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dependencies:
- libmatio
- numpy
- scipy
- osqp
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Added
- Add OSQP solver and refactor code ([#415](https://github.com/Simple-Robotics/proxsuite/pull/415))

### Changed
- Change the default branch to `devel` ([#395](https://github.com/Simple-Robotics/proxsuite/pull/395))
- Change `dual_feasibility` test threshold in `sparse_maros_meszaros` unit test ([#403](https://github.com/Simple-Robotics/proxsuite/pull/403))
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ where $x \in \mathbb{R}^n$ is the optimization variable. The objective function
### Citing **QPLayer**

If you are using **QPLayer** for your work, we encourage you to [cite the related paper](https://inria.hal.science/hal-04133055v2/).
## **WIP: OSQP**

The **OSQP** algorithm is a numerical optimization approach for solving quadratic programming problems with the same form as problems treated by **ProxQP**. It is based on the Alternating Direction Method of Multipliers.

### Citing **OSQP**

**OSQP** was developped by B. Stellato, G. Banjac, P. Goulart, A. Bemporad and S. Boyd. Information about the algorithm and the API of **OSQP** are available in the [related paper](https://web.stanford.edu/~boyd/papers/pdf/osqp.pdf) and [related website](https://osqp.org/).
## Installation procedure

Please follow the installation procedure [here](https://github.com/Simple-Robotics/proxsuite/blob/devel/doc/5-installation.md).
24 changes: 12 additions & 12 deletions benchmark/timings-box-constraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
//
#include <iostream>
#include <proxsuite/proxqp/dense/dense.hpp>
#include <proxsuite/proxqp/utils/random_qp_problems.hpp>
#include <proxsuite/common/utils/random_qp_problems.hpp>

using T = double;
using I = long long;

using namespace proxsuite;
using namespace proxsuite::proxqp;
using namespace proxsuite::common;

int
main(int /*argc*/, const char** /*argv*/)
Expand All @@ -20,32 +20,32 @@ main(int /*argc*/, const char** /*argv*/)
T sparsity_factor = 0.75;
T eps_abs = T(1e-9);
T elapsed_time = 0.0;
proxqp::utils::rand::set_seed(1);
common::utils::rand::set_seed(1);
std::cout << "Dense QP" << std::endl;
for (proxqp::isize dim = 100; dim <= 1000; dim = dim + 100) {
for (isize dim = 100; dim <= 1000; dim = dim + 100) {

proxqp::isize n_eq(dim / 2);
proxqp::isize n_in(dim / 2);
isize n_eq(dim / 2);
isize n_in(dim / 2);
std::cout << "dim: " << dim << " n_eq: " << n_eq << " n_in: " << n_in
<< " box: " << dim << std::endl;
T strong_convexity_factor(1.e-2);

proxqp::dense::Model<T> qp_random = proxqp::utils::dense_strongly_convex_qp(
common::dense::Model<T> qp_random = common::utils::dense_strongly_convex_qp(
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
Eigen::Matrix<T, Eigen::Dynamic, 1> x_sol =
utils::rand::vector_rand<T>(dim);
common::utils::rand::vector_rand<T>(dim);
Eigen::Matrix<T, Eigen::Dynamic, 1> delta(n_in);
for (proxqp::isize i = 0; i < n_in; ++i) {
delta(i) = utils::rand::uniform_rand();
for (isize i = 0; i < n_in; ++i) {
delta(i) = common::utils::rand::uniform_rand();
}
qp_random.u = qp_random.C * x_sol + delta;
qp_random.b = qp_random.A * x_sol;
Eigen::Matrix<T, Eigen::Dynamic, 1> u_box(dim);
u_box.setZero();
Eigen::Matrix<T, Eigen::Dynamic, 1> l_box(dim);
l_box.setZero();
for (proxqp::isize i = 0; i < dim; ++i) {
T shift = utils::rand::uniform_rand();
for (isize i = 0; i < dim; ++i) {
T shift = common::utils::rand::uniform_rand();
u_box(i) = x_sol(i) + shift;
l_box(i) = x_sol(i) - shift;
}
Expand Down
32 changes: 17 additions & 15 deletions benchmark/timings-dense-backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
//
#include <iostream>
#include <proxsuite/proxqp/dense/dense.hpp>
#include <proxsuite/proxqp/utils/random_qp_problems.hpp>
#include <proxsuite/common/utils/random_qp_problems.hpp>

using T = double;
using I = long long;

using namespace proxsuite;
using namespace proxsuite::proxqp;
using namespace proxsuite::common;

int
main(int /*argc*/, const char** /*argv*/)
Expand All @@ -20,32 +20,32 @@ main(int /*argc*/, const char** /*argv*/)
T sparsity_factor = 0.75;
T eps_abs = T(1e-9);
T elapsed_time = 0.0;
proxqp::utils::rand::set_seed(1);
common::utils::rand::set_seed(1);
std::cout << "Dense QP" << std::endl;
for (proxqp::isize dim = 100; dim <= 1000; dim = dim + 100) {
for (isize dim = 100; dim <= 1000; dim = dim + 100) {

proxqp::isize n_eq(dim * 2);
proxqp::isize n_in(dim * 2);
isize n_eq(dim * 2);
isize n_in(dim * 2);
std::cout << "dim: " << dim << " n_eq: " << n_eq << " n_in: " << n_in
<< " box: " << dim << std::endl;
T strong_convexity_factor(1.e-2);

proxqp::dense::Model<T> qp_random = proxqp::utils::dense_strongly_convex_qp(
common::dense::Model<T> qp_random = common::utils::dense_strongly_convex_qp(
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
Eigen::Matrix<T, Eigen::Dynamic, 1> x_sol =
utils::rand::vector_rand<T>(dim);
common::utils::rand::vector_rand<T>(dim);
Eigen::Matrix<T, Eigen::Dynamic, 1> delta(n_in);
for (proxqp::isize i = 0; i < n_in; ++i) {
delta(i) = utils::rand::uniform_rand();
for (isize i = 0; i < n_in; ++i) {
delta(i) = common::utils::rand::uniform_rand();
}
qp_random.u = qp_random.C * x_sol + delta;
qp_random.b = qp_random.A * x_sol;
Eigen::Matrix<T, Eigen::Dynamic, 1> u_box(dim);
u_box.setZero();
Eigen::Matrix<T, Eigen::Dynamic, 1> l_box(dim);
l_box.setZero();
for (proxqp::isize i = 0; i < dim; ++i) {
T shift = utils::rand::uniform_rand();
for (isize i = 0; i < dim; ++i) {
T shift = common::utils::rand::uniform_rand();
u_box(i) = x_sol(i) + shift;
l_box(i) = x_sol(i) - shift;
}
Expand All @@ -64,7 +64,9 @@ main(int /*argc*/, const char** /*argv*/)

elapsed_time = 0.0;
timer.stop();
proxqp::dense::QP<T> qp{ dim, n_eq, n_in, true, DenseBackend::PrimalLDLT };
proxqp::dense::QP<T> qp{
dim, n_eq, n_in, true, common::DenseBackend::PrimalLDLT
};
qp.settings.eps_abs = eps_abs;
qp.settings.eps_rel = 0;
// qp.settings.verbose = true;
Expand Down Expand Up @@ -97,7 +99,7 @@ main(int /*argc*/, const char** /*argv*/)

elapsed_time = 0.0;
proxqp::dense::QP<T> qp_compare{
dim, n_eq, n_in, true, DenseBackend::PrimalDualLDLT
dim, n_eq, n_in, true, common::DenseBackend::PrimalDualLDLT
};
qp_compare.settings.eps_abs = eps_abs;
qp_compare.settings.eps_rel = 0;
Expand Down Expand Up @@ -131,7 +133,7 @@ main(int /*argc*/, const char** /*argv*/)
<< elapsed_time * 1e-3 / smooth << "ms" << std::endl;
elapsed_time = 0.0;
proxqp::dense::QP<T> qp_compare_bis{
dim, n_eq, n_in, true, DenseBackend::Automatic
dim, n_eq, n_in, true, common::DenseBackend::Automatic
};
qp_compare_bis.settings.eps_abs = eps_abs;
qp_compare_bis.settings.eps_rel = 0;
Expand Down
40 changes: 16 additions & 24 deletions benchmark/timings-diagonal-hessian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
//
#include <iostream>
#include <proxsuite/proxqp/dense/dense.hpp>
#include <proxsuite/proxqp/utils/random_qp_problems.hpp>
#include <proxsuite/common/utils/random_qp_problems.hpp>

using T = double;
using I = long long;

using namespace proxsuite;
using namespace proxsuite::proxqp;
using namespace proxsuite::common;

int
main(int /*argc*/, const char** /*argv*/)
Expand All @@ -20,32 +20,32 @@ main(int /*argc*/, const char** /*argv*/)
T sparsity_factor = 0.75;
T eps_abs = T(1e-9);
T elapsed_time = 0.0;
proxqp::utils::rand::set_seed(1);
common::utils::rand::set_seed(1);
std::cout << "Dense QP" << std::endl;
for (proxqp::isize dim = 100; dim <= 500; dim = dim + 100) {
for (isize dim = 100; dim <= 500; dim = dim + 100) {

proxqp::isize n_eq(dim / 2);
proxqp::isize n_in(dim / 2);
isize n_eq(dim / 2);
isize n_in(dim / 2);
std::cout << "dim: " << dim << " n_eq: " << n_eq << " n_in: " << n_in
<< " box: " << dim << std::endl;
T strong_convexity_factor(1.e-2);

proxqp::dense::Model<T> qp_random = proxqp::utils::dense_strongly_convex_qp(
common::dense::Model<T> qp_random = common::utils::dense_strongly_convex_qp(
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
Eigen::Matrix<T, Eigen::Dynamic, 1> x_sol =
utils::rand::vector_rand<T>(dim);
common::utils::rand::vector_rand<T>(dim);
Eigen::Matrix<T, Eigen::Dynamic, 1> delta(n_in);
for (proxqp::isize i = 0; i < n_in; ++i) {
delta(i) = utils::rand::uniform_rand();
for (isize i = 0; i < n_in; ++i) {
delta(i) = common::utils::rand::uniform_rand();
}
qp_random.u = qp_random.C * x_sol + delta;
qp_random.b = qp_random.A * x_sol;
Eigen::Matrix<T, Eigen::Dynamic, 1> u_box(dim);
u_box.setZero();
Eigen::Matrix<T, Eigen::Dynamic, 1> l_box(dim);
l_box.setZero();
for (proxqp::isize i = 0; i < dim; ++i) {
T shift = utils::rand::uniform_rand();
for (isize i = 0; i < dim; ++i) {
T shift = common::utils::rand::uniform_rand();
u_box(i) = x_sol(i) + shift;
l_box(i) = x_sol(i) - shift;
}
Expand All @@ -69,12 +69,9 @@ main(int /*argc*/, const char** /*argv*/)

elapsed_time = 0.0;
timer.stop();
proxqp::dense::QP<T> qp{ dim,
n_eq,
n_in,
true,
proxsuite::proxqp::DenseBackend::PrimalDualLDLT,
proxsuite::proxqp::HessianType::Diagonal };
proxqp::dense::QP<T> qp{
dim, n_eq, n_in, true, DenseBackend::PrimalDualLDLT, HessianType::Diagonal
};
qp.settings.eps_abs = eps_abs;
qp.settings.eps_rel = 0;
// qp.settings.verbose = true;
Expand Down Expand Up @@ -107,12 +104,7 @@ main(int /*argc*/, const char** /*argv*/)

elapsed_time = 0.0;
proxqp::dense::QP<T> qp_compare{
dim,
n_eq,
n_in,
true,
proxsuite::proxqp::DenseBackend::PrimalDualLDLT,
proxsuite::proxqp::HessianType::Dense
dim, n_eq, n_in, true, DenseBackend::PrimalDualLDLT, HessianType::Dense
};
qp_compare.settings.eps_abs = eps_abs;
qp_compare.settings.eps_rel = 0;
Expand Down
21 changes: 10 additions & 11 deletions benchmark/timings-lp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
//
#include <iostream>
#include <proxsuite/proxqp/dense/dense.hpp>
#include <proxsuite/proxqp/utils/random_qp_problems.hpp>
#include <proxsuite/common/utils/random_qp_problems.hpp>

using T = double;
using I = long long;

using namespace proxsuite;
using namespace proxsuite::proxqp;
using namespace proxsuite::common;

int
main(int /*argc*/, const char** /*argv*/)
Expand All @@ -20,33 +20,32 @@ main(int /*argc*/, const char** /*argv*/)
T sparsity_factor = 0.75;
T eps_abs = T(1e-9);
T elapsed_time = 0.0;
proxqp::utils::rand::set_seed(1);
common::utils::rand::set_seed(1);
std::cout << "Dense QP" << std::endl;
for (proxqp::isize dim = 10; dim <= 1000;
dim = (dim == 10) ? 100 : dim + 100) {
for (isize dim = 10; dim <= 1000; dim = (dim == 10) ? 100 : dim + 100) {

if (dim == 10 || dim == 100) {
smooth = 1000;
} else {
smooth = 100;
}

proxqp::isize n_eq(dim / 2);
proxqp::isize n_in(dim / 2);
isize n_eq(dim / 2);
isize n_in(dim / 2);
T strong_convexity_factor(1.e-2);
std::cout << "dim: " << dim << " n_eq: " << n_eq << " n_in: " << n_in
<< std::endl;

proxqp::dense::Model<T> qp_random = proxqp::utils::dense_strongly_convex_qp(
common::dense::Model<T> qp_random = common::utils::dense_strongly_convex_qp(
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
qp_random.H.setZero();
auto y_sol = proxqp::utils::rand::vector_rand<T>(n_eq);
auto y_sol = common::utils::rand::vector_rand<T>(n_eq);
qp_random.g = -qp_random.A.transpose() * y_sol;

elapsed_time = 0.0;
timer.stop();
proxqp::dense::QP<T> qp{
dim, n_eq, n_in, false, proxqp::HessianType::Zero
dim, n_eq, n_in, false, common::HessianType::Zero
};
qp.settings.eps_abs = eps_abs;
qp.settings.eps_rel = 0;
Expand Down Expand Up @@ -77,7 +76,7 @@ main(int /*argc*/, const char** /*argv*/)

elapsed_time = 0.0;
proxqp::dense::QP<T> qp_compare{
dim, n_eq, n_in, false, proxqp::HessianType::Dense
dim, n_eq, n_in, false, common::HessianType::Dense
};
qp_compare.settings.eps_abs = eps_abs;
qp_compare.settings.eps_rel = 0;
Expand Down
Loading