Skip to content

Commit 7012786

Browse files
authored
Merge branch 'devel' into topic/msvc
2 parents 05958c2 + f654fa9 commit 7012786

File tree

70 files changed

+13558
-6965
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+13558
-6965
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Build ${{ matrix.os }} ${{ matrix.python-version }}
1313
strategy:
1414
matrix:
15-
python-version: ["3.8", "3.9", "3.10"]
15+
python-version: ["3.7", "3.8", "3.9", "3.10"]
1616
os: [ubuntu-latest, macos-latest]
1717

1818
steps:
@@ -58,17 +58,17 @@ jobs:
5858
run: |
5959
pip wheel . -w dist
6060
61-
- name: Keep only proxsuite in dist
61+
- name: Move proxsuite to specific dist folder
6262
shell: bash -l {0}
6363
run: |
64-
rm dist/cmeel*.whl
65-
rm dist/tomli*.whl
64+
mkdir -p dist_proxsuite
65+
mv dist/proxsuite*.whl dist_proxsuite
6666
6767
- name: Archive artifacts
6868
uses: actions/upload-artifact@v3
6969
with:
7070
name: dist
71-
path: dist
71+
path: dist_proxsuite
7272

7373
release:
7474
needs: "build-wheel"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
hooks:
1212
- id: trailing-whitespace
1313
- repo: https://github.com/psf/black
14-
rev: 22.6.0
14+
rev: 22.8.0
1515
hooks:
1616
- id: black
1717
- repo: https://github.com/cheshirekow/cmake-format-precommit

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Through **ProxSuite**, we aim at offering to the community scalable optimizers w
1414

1515
**ProxSuite** is actively developped and supported by the [Willow](https://www.di.ens.fr/willow/) and [Sierra](https://www.di.ens.fr/sierra/) research groups, joint research teams between [Inria](https://www.inria.fr/en), [École Normale Supérieure de Paris](https://www.ens.fr) and [Centre National de la Recherche Scientifique](https://www.cnrs.fr).
1616

17+
**ProxSuite** is integrated into the [cvxpy](https://www.cvxpy.org/) modeling language for convex optimization problems.
18+
1719
## Quick install
1820

1921
**ProxSuite** is distributed on many well-known package managers.
@@ -36,6 +38,28 @@ This approach is available on Linux, Windows and Mac OS X.
3638

3739
Alternative installation procedures are presented in the [Installation Procedure](#installation-procedure) section.
3840

41+
## ProxSuite main features
42+
43+
**Proxsuite** is fast:
44+
45+
- C++ template library,
46+
- cache friendly.
47+
48+
**Proxsuite** is versatile, offering through a unified API advanced algorithms specialized for efficiently exploiting problem structures:
49+
50+
- dense, sparse and matrix free matrix factorization backends,
51+
- advanced warm-starting options (e.g., equality-constrained initial guess, warm-start or cold-start options from previous results).
52+
53+
**Proxsuite** is flexible:
54+
55+
- header only,
56+
- C++ 17/20 compliant,
57+
- Python and Julia bindings for easy code prototyping without sacrificing performances.
58+
59+
**Proxsuite** is extensible.
60+
**Proxsuite** is reliable and extensively tested, showing the best performances on the hardest problems of the literature.
61+
**Proxsuite** is supported and tested on Windows, Mac OS X, Unix and Linux.
62+
3963
## **ProxQP**
4064

4165
The **ProxQP** algorithm is a numerical optimization approach for solving quadratic programming problems of the form:

bindings/python/src/expose-settings.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ exposeSettings(pybind11::module_ m)
2828

2929
::pybind11::class_<Settings<T>>(m, "Settings", pybind11::module_local())
3030
.def(::pybind11::init(), "Default constructor.") // constructor
31+
.def_readwrite("default_rho", &Settings<T>::default_rho)
32+
.def_readwrite("default_mu_eq", &Settings<T>::default_mu_eq)
33+
.def_readwrite("default_mu_in", &Settings<T>::default_mu_in)
3134
.def_readwrite("alpha_bcl", &Settings<T>::alpha_bcl)
3235
.def_readwrite("beta_bcl", &Settings<T>::beta_bcl)
3336
.def_readwrite("refactor_dual_feasibility_threshold",

doc/2-PROXQP_API/2-ProxQP_api.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ In this table you have on the three columns from left to right: the name of the
302302
| eps_abs | 1.E-3 | Asbolute stopping criterion of the solver.
303303
| eps_rel | 0 | Relative stopping criterion of the solver.
304304
| VERBOSE | False | If set to true, the solver prints information at each loop.
305+
| default_rho | 1.E-6 | Default rho parameter of result class (i.e., for each initial guess, except WARM_START_WITH_PREVIOUS_RESULT, after a new solve or update, the solver initializes rho to this value).
306+
| default_mu_eq | 1.E-3 | Default mu_eq parameter of result class (i.e., for each initial guess, except WARM_START_WITH_PREVIOUS_RESULT, after a new solve or update, the solver initializes mu_eq to this value).
307+
| default_mu_in | 1.E-1 | Default mu_in parameter of result class (i.e., for each initial guess, except WARM_START_WITH_PREVIOUS_RESULT, after a new solve or update, the solver initializes mu_in to this value).
305308
| compute_timings | True | If set to true, timings will be computed by the solver (setup time, solving time, and run time = setup time + solving time).
306309
| max_iter | 1.E4 | Maximal number of authorized outer iterations.
307310
| max_iter_in | 1500 | Maximal number of authorized inner iterations.
@@ -430,6 +433,25 @@ In this table you have on the three columns from left to right: the name of the
430433
| pri_res | 0 | The primal residual.
431434
| dua_res | 0 | The dual residual.
432435

436+
437+
Note finally that when initializing a QP object, by default the proximal step sizes (i.e., rho, mu_eq and mu_in) are set up by the default values defined in the Setting class. Hence, when doing multiple solves, if not specified, their values are re-set respectively to default_rho, default_mu_eq and default_mu_in. A small example is given below in c++ and python.
438+
439+
<table class="manual">
440+
<tr>
441+
<th>examples/cpp/init_with_default_options.cpp</th>
442+
<th>examples/python/init_with_default_options.py</th>
443+
</tr>
444+
<tr>
445+
<td valign="top">
446+
\include init_with_default_options.cpp
447+
</td>
448+
<td valign="top">
449+
\include init_with_default_options.py
450+
</td>
451+
</tr>
452+
</table>
453+
454+
433455
\subsection OverviewSolverStatus The solver's status
434456

435457
The solver has four status:

examples/cpp/init_dense_qp.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <proxsuite/proxqp/dense/dense.hpp> // load the dense solver backend
2-
#include <proxsuite/proxqp/utils/random_qp_problems.hpp> // used for generating a random convex Qp
2+
#include <proxsuite/proxqp/utils/random_qp_problems.hpp> // used for generating a random convex qp
33

44
using namespace proxsuite::proxqp;
55
using T = double;
@@ -13,9 +13,15 @@ main()
1313
// generate a random qp
1414
T sparsity_factor(0.15);
1515
T strong_convexity_factor(1.e-2);
16-
dense::Model<T> qp = utils::dense_strongly_convex_qp(
16+
dense::Model<T> qp_random = utils::dense_strongly_convex_qp(
1717
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
1818

19-
dense::QP<T> Qp(dim, n_eq, n_in); // create the QP object
20-
Qp.init(qp.H, qp.g, qp.A, qp.b, qp.C, qp.u, qp.l); // initialize the model
19+
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
20+
qp.init(qp_random.H,
21+
qp_random.g,
22+
qp_random.A,
23+
qp_random.b,
24+
qp_random.C,
25+
qp_random.u,
26+
qp_random.l); // initialize the model
2127
}

examples/cpp/init_dense_qp_with_other_options.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <proxsuite/proxqp/dense/dense.hpp> // load the dense solver backend
2-
#include <proxsuite/proxqp/utils/random_qp_problems.hpp> // used for generating a random convex Qp
2+
#include <proxsuite/proxqp/utils/random_qp_problems.hpp> // used for generating a random convex qp
33

44
using namespace proxsuite::proxqp;
55
using T = double;
@@ -12,13 +12,21 @@ main()
1212
// generate a random qp
1313
T sparsity_factor(0.15);
1414
T strong_convexity_factor(1.e-2);
15-
dense::Model<T> qp = utils::dense_strongly_convex_qp(
15+
dense::Model<T> qp_random = utils::dense_strongly_convex_qp(
1616
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
1717

18-
dense::QP<T> Qp(
18+
dense::QP<T> qp(
1919
dim, n_eq, n_in); // create the QP
2020
// initialize the model, along with another rho parameter
21-
Qp.init(qp.H, qp.g, qp.A, qp.b, qp.C, qp.u, qp.l, true, /*rho*/ 1.e-7);
21+
qp.init(qp_random.H,
22+
qp_random.g,
23+
qp_random.A,
24+
qp_random.b,
25+
qp_random.C,
26+
qp_random.u,
27+
qp_random.l,
28+
true,
29+
/*rho*/ 1.e-7);
2230
// in c++ you must follow the order speficied in the API for the parameters
2331
// if you don't want to change one parameter (here compute_preconditioner),
2432
// just let it be std::nullopt
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <proxsuite/proxqp/dense/dense.hpp> // load the dense solver backend
2-
#include <proxsuite/proxqp/utils/random_qp_problems.hpp> // used for generating a random convex Qp
2+
#include <proxsuite/proxqp/utils/random_qp_problems.hpp> // used for generating a random convex qp
33

44
using namespace proxsuite::proxqp;
55
using T = double;
@@ -12,10 +12,16 @@ main()
1212
// generate a random qp
1313
T sparsity_factor(0.15);
1414
T strong_convexity_factor(1.e-2);
15-
dense::Model<T> qp = utils::dense_strongly_convex_qp(
15+
dense::Model<T> qp_random = utils::dense_strongly_convex_qp(
1616
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
1717

18-
dense::QP<T> Qp(dim, n_eq, n_in); // create the QP object
19-
Qp.settings.compute_timings = true; // compute all timings
20-
Qp.init(qp.H, qp.g, qp.A, qp.b, qp.C, qp.u, qp.l); // initialize the model
18+
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
19+
qp.settings.compute_timings = true; // compute all timings
20+
qp.init(qp_random.H,
21+
qp_random.g,
22+
qp_random.A,
23+
qp_random.b,
24+
qp_random.C,
25+
qp_random.u,
26+
qp_random.l); // initialize the model
2127
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#include <proxsuite/proxqp/dense/dense.hpp> // load the dense solver backend
2+
#include <proxsuite/proxqp/utils/random_qp_problems.hpp> // used for generating a random convex qp
3+
4+
using namespace proxsuite::proxqp;
5+
using T = double;
6+
int
7+
main()
8+
{
9+
isize dim = 10;
10+
isize n_eq(dim / 4);
11+
isize n_in(dim / 4);
12+
// generate a random qp
13+
T sparsity_factor(0.15);
14+
T strong_convexity_factor(1.e-2);
15+
dense::Model<T> qp_random = utils::dense_strongly_convex_qp(
16+
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
17+
18+
dense::QP<T> qp(
19+
dim, n_eq, n_in); // create the QP
20+
// initialize the model, along with another rho parameter
21+
qp.settings.initial_guess = InitialGuessStatus::NO_INITIAL_GUESS;
22+
qp.init(qp_random.H,
23+
qp_random.g,
24+
qp_random.A,
25+
qp_random.b,
26+
qp_random.C,
27+
qp_random.u,
28+
qp_random.l,
29+
true,
30+
/*rho*/ 1.e-7,
31+
/*mu_eq*/ 1.e-4);
32+
// Initializing rho sets in practive qp.settings.default_rho value,
33+
// hence, after each solve or update method, the qp.results.info.rho value
34+
// will be reset to qp.settings.default_rho value.
35+
qp.solve();
36+
// So if we redo a solve, qp.settings.default_rho value = 1.e-7, hence
37+
// qp.results.info.rho restarts at 1.e-7 The same occurs for mu_eq.
38+
qp.solve();
39+
// There might be a different result with WARM_START_WITH_PREVIOUS_RESULT
40+
// initial guess option, as by construction, it reuses the last proximal step
41+
// sizes of the last solving method.
42+
}

0 commit comments

Comments
 (0)