Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
7f7c648
osqp/: Create dense, solver, wrapper files
Lucas-Haubert Jul 25, 2025
d13970b
osqp/dense/wrapper: Function init_osqp_settings to call after constru…
Lucas-Haubert Jul 26, 2025
8cb3373
osqp/utils/prints: Add print preambule function
Lucas-Haubert Jul 26, 2025
d1af1c4
proxqp/dense/workspace: Add OSQP material
Lucas-Haubert Jul 26, 2025
2f526b4
Copyright date in osqp/utils/prints
Lucas-Haubert Jul 26, 2025
b29525b
bindings: Add OSQP
Lucas-Haubert Jul 28, 2025
9cfb1cb
Moved zeta_eq and zeta_in in results
Lucas-Haubert Jul 28, 2025
e94d0c9
osqp/dense/solver: Structure of the function qp_solve
Lucas-Haubert Jul 29, 2025
4283781
osqp/dense/solver: Coded ADMM with no mu update
Lucas-Haubert Jul 29, 2025
f138426
test: Add unit tests for ADMM only
Lucas-Haubert Jul 29, 2025
51a052a
Add remove columns step in setup_factorisation_complete_kkt i ncase o…
Lucas-Haubert Jul 30, 2025
8deb560
Renamed setup_factorisation_somplete_kkt into factorization_complete_kkt
Lucas-Haubert Jul 30, 2025
5a11ca3
Removed assrt on type_check in exposeAndExportValues
Lucas-Haubert Jul 30, 2025
af937a9
Mu update
Lucas-Haubert Jul 30, 2025
0bde22f
Polishing
Lucas-Haubert Aug 3, 2025
bbbaaa1
Tests: Set precision 1e-3 in unit tests
Lucas-Haubert Aug 3, 2025
37fe3aa
Polishing: Perform polishing factorization and solve in separate ldl …
Lucas-Haubert Aug 3, 2025
b1f5f94
Fix unit tests before calibration with osqp source
Lucas-Haubert Aug 6, 2025
c2355ff
Test osqp_dense_maros_meszaros: Comparaison of OSQP proxsuite and sou…
Lucas-Haubert Aug 6, 2025
d3757eb
Renamed examples/python/osqp_calibration.py into examples/python/osqp…
Lucas-Haubert Aug 6, 2025
ca166eb
tests osqp: print iter_ext instead of iter
Lucas-Haubert Aug 6, 2025
ba49e80
unit test: degenerate: File to compare proxsuite vs source
Lucas-Haubert Aug 6, 2025
712723a
osqp solver header: Documentation of the code blocks
Lucas-Haubert Aug 7, 2025
2474724
unit test: Add tests for solution polishing
Lucas-Haubert Aug 7, 2025
240aefe
Failing tests in wrapper: document them
Lucas-Haubert Aug 7, 2025
df89f37
calibration: Compare the rho_estimate values instead of mu_eq and mu_…
Lucas-Haubert Aug 7, 2025
d615a34
solver: Correction in ADMM update
Lucas-Haubert Aug 8, 2025
cf2e508
Setup of calibration tests
Lucas-Haubert Aug 8, 2025
af7f19e
Calibration strongly convex qp, not strongly convex, degenerate
Lucas-Haubert Aug 8, 2025
fd2a7d7
examples/python/osqp_calibration: Refactor code
Lucas-Haubert Aug 12, 2025
02c6474
Calibration: Add primal and dual infeasibility detection, box_constra…
Lucas-Haubert Aug 12, 2025
f86b15b
Calibration maros meszaros: Add skipped problems in unit test
Lucas-Haubert Aug 13, 2025
83fb76f
Calibration: Add comments on results
Lucas-Haubert Aug 13, 2025
5380e40
Calibration: Add arguments eps primal and dual inf
Lucas-Haubert Aug 13, 2025
3b270a2
Calibration: Add comments on box constrained and not strongly convex …
Lucas-Haubert Aug 13, 2025
adea884
Bindings: Expose polishing results
Lucas-Haubert Aug 13, 2025
e811bee
Solver: Removed use of status NO_ACTIVE_SET_FOUND to get close to the…
Lucas-Haubert Aug 13, 2025
6072439
Calibration: Add calibration on polishing, and passed tests on strong…
Lucas-Haubert Aug 13, 2025
c3009fd
Calibration; Reshaped calibration_base
Lucas-Haubert Aug 14, 2025
71270dd
Rafactoring: timings
Lucas-Haubert Aug 14, 2025
6a97de3
Calibration: Comment tests (temp) before to integrate them in ctest
Lucas-Haubert Aug 14, 2025
3b7538e
Refactoring: Remove useless includes in status header
Lucas-Haubert Aug 14, 2025
7085ef3
Refactoring: Changed PROXSUITE_PROXQP_TIMINGS_HPP into PROXSUITE_COMM…
Lucas-Haubert Aug 14, 2025
b896f30
Refactoring: using namespace common before proxqp (convention)
Lucas-Haubert Aug 14, 2025
3cbfb16
Refactoring: status
Lucas-Haubert Aug 14, 2025
0ab520d
Refactoring: Views + call using namespace proxsuite and using proxsui…
Lucas-Haubert Aug 15, 2025
15c4d61
Refactoring: Settings
Lucas-Haubert Aug 15, 2025
7a34e36
dense/fwd.hpp: Add include of linalg for using proxsuite::linalg
Lucas-Haubert Aug 15, 2025
6ad0ed1
Refactoring: dense/fwd
Lucas-Haubert Aug 15, 2025
1fa42b7
Refactoring: Results
Lucas-Haubert Aug 15, 2025
81bd4da
Refactoring: Preconditioner
Lucas-Haubert Aug 15, 2025
85b0013
Refactoring: Workspace
Lucas-Haubert Aug 15, 2025
8aecc9c
Refactoring: Backward data
Lucas-Haubert Aug 16, 2025
0effb5f
Refactoring: Move save_data in helpers
Lucas-Haubert Aug 16, 2025
69aaca2
Refactoring: Move mu_update in helpers
Lucas-Haubert Aug 16, 2025
17425e1
Refactoring: Moved functions for iterative solve from proxqp/dense/so…
Lucas-Haubert Aug 16, 2025
1bf2448
Refactoring: print_setup_header function and add enum Solver to mutua…
Lucas-Haubert Aug 16, 2025
fd8bac3
Refactoring: Put new function for print iteration line
Lucas-Haubert Aug 16, 2025
75fdc52
Refactoring: Model
Lucas-Haubert Aug 16, 2025
d4b6334
Refactoring: helpers
Lucas-Haubert Aug 16, 2025
5554b8c
Refactoring: utils
Lucas-Haubert Aug 16, 2025
195655a
Refactoring: osqp utils
Lucas-Haubert Aug 16, 2025
d751dd7
Refactoring: random_qp_problems
Lucas-Haubert Aug 16, 2025
79bc71e
Refactoring: Rename enum Solver into QPSolver
Lucas-Haubert Aug 16, 2025
8f9e713
Refactoring: Constants for QPSolverOutput with common name, not PROXQ…
Lucas-Haubert Aug 16, 2025
0b524a2
Refactoring: Updates dates relative to this PR in 2025
Lucas-Haubert Aug 16, 2025
182df4a
Refactoring: Update namespaces in bindings for common content
Lucas-Haubert Aug 16, 2025
870fb6e
Refactoring: Put in common functions in osqp and proxqp dense/solver …
Lucas-Haubert Aug 16, 2025
cce4849
Refactoring: Removed the using proxsuite::common aliases in each file…
Lucas-Haubert Aug 17, 2025
1f5f43c
Organize calls to namespace common via, for headers: alias for struct…
Lucas-Haubert Aug 17, 2025
f8ace40
Clean code: English mistake in polish status suceed changed into suce…
Lucas-Haubert Aug 17, 2025
de4678b
Clean code: Removed remaining mentions to proxqp in common code
Lucas-Haubert Aug 17, 2025
4863cb2
Refactoring: CRTP to refactor dense wrapper
Lucas-Haubert Aug 17, 2025
efa29a8
Clean code: renamed alpha_osqp and delta_osqp into alpha and delta
Lucas-Haubert Aug 17, 2025
bf43369
Clean code: Remove deprecated use of proxqp:: in a commented example
Lucas-Haubert Aug 17, 2025
64a7561
Refactoring: common/results: Noticed that values of mu are arbitrary,…
Lucas-Haubert Aug 17, 2025
4919fc2
Refactoring: Comment note regarding the defaults values in headers re…
Lucas-Haubert Aug 17, 2025
14b1fd7
osqp::dense::solve: Add polishing options
Lucas-Haubert Aug 17, 2025
ab212bf
Clean code: Renamed option polishing into polish
Lucas-Haubert Aug 17, 2025
613e6c5
Clean code: Specify solver name in unit tests
Lucas-Haubert Aug 18, 2025
71a0d78
Refactoring: Split folders in examples/ and test/
Lucas-Haubert Aug 18, 2025
ecfab7f
test/src/osqp/: Comments on failing test on degenerate
Lucas-Haubert Aug 18, 2025
d692bec
test/src/osqp/dense_qp_wrapper.py: Corrected proxsuite.proxqp into pr…
Lucas-Haubert Aug 18, 2025
141e622
unit test: Commented failed tests in osqp/dense_qp_wrapper
Lucas-Haubert Aug 18, 2025
011ff5a
Coded check_termination option inspired from OSQP source code
Lucas-Haubert Aug 20, 2025
4cb5127
Rename PolishStatus into PolishOutput
Lucas-Haubert Aug 20, 2025
28fefee
test: Updates comments on option primal_infeasibility_solving in OSQP…
Lucas-Haubert Aug 20, 2025
18c557e
osqp/calibration: Deactivate run of calibration tests in ctest
Lucas-Haubert Aug 21, 2025
60bf717
README: Add WIP: OSQP section
Lucas-Haubert Aug 21, 2025
8243def
ci: run_test option in test_calibration_qp and test_calibration_maros…
Lucas-Haubert Aug 21, 2025
f4e71b0
ci: Remove calibration from tests in CI and ctest
Lucas-Haubert Aug 21, 2025
1674789
osqp/dense/solver.hpp: Removed unsuded variable sqrt_mu_update
Lucas-Haubert Aug 21, 2025
7c54e21
ci: expose-all.cpp: changed dense_module into proxqp_dense_module in …
Lucas-Haubert Aug 21, 2025
5de0d7f
ci: Add osqp in environment.yml
Lucas-Haubert Aug 21, 2025
5d1ea08
ci: Management of proxqp and common namespace in test proxqp/parallel…
Lucas-Haubert Aug 21, 2025
ce44c56
Unit tests OSQP: eps_abs = 1e-5 (high precision), except for dense_qp…
Lucas-Haubert Aug 21, 2025
d5d312c
changelog: Add entry
Lucas-Haubert Aug 22, 2025
4cb0ad0
cmake: Use patched jrl-cmakemodules
jorisv Sep 3, 2025
16e1df9
python: Remove useless include
jorisv Sep 3, 2025
19d40da
python: Use nanobind function instead of CPython API
jorisv Sep 3, 2025
ae4014b
python: Fix type_name_short to return type name without module
jorisv Sep 4, 2025
db0936b
packaging: Fix build
jorisv Sep 4, 2025
a39f5ee
cmake: jrl-cmakemodules patch is merged
jorisv Sep 8, 2025
b637337
cmake-module: update
Lucas-Haubert Sep 15, 2025
835228b
Removed useless REGEX in string(REGEX REPLACE
Lucas-Haubert Sep 15, 2025
546cd1e
Fix memory: Init values of active_set_up and active_set_low
Lucas-Haubert Sep 24, 2025
7ed3af0
cmake: Update jrl-cmakemodules
jorisv Sep 24, 2025
ae6e22d
osqp/dense/solver.hpp: Add computation of active set up and low to ev…
Lucas-Haubert Sep 24, 2025
949a726
Initialization of actiev_set_up and low in proxqp
Lucas-Haubert Sep 24, 2025
fbcb95f
cmake: update jrl-cmakemodule
Lucas-Haubert Sep 24, 2025
271b2f9
test/src/osqp/dense_qp_wrapper.cpp: Coherent values of mu_eq in unit …
Lucas-Haubert Oct 1, 2025
b3b493e
Revert "test/src/osqp/dense_qp_wrapper.cpp: Coherent values of mu_eq …
Lucas-Haubert Oct 2, 2025
ac75c61
OSQP: Do not allow update of mu at iter = 0
Lucas-Haubert Oct 2, 2025
805d6f7
test/src/osqp/dense_qp_solve.py: print expected x in failing unit test
Lucas-Haubert Oct 2, 2025
229d7a4
OSQP unit tests: dense_qp_solve.py and dense_qp_wrapper.py: Relax pre…
Lucas-Haubert Oct 2, 2025
eaab9cd
OSQP: Unit test: dense: check ordering of z when there are box constr…
Lucas-Haubert Oct 2, 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
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added
- Recursive stub generation for Python bindings ([#419](https://github.com/Simple-Robotics/proxsuite/pull/419))
- 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))
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
Loading