File tree Expand file tree Collapse file tree 4 files changed +20
-15
lines changed Expand file tree Collapse file tree 4 files changed +20
-15
lines changed Original file line number Diff line number Diff line change 66#define PROXSUITE_PROXQP_DENSE_FWD_HPP
77
88#include < Eigen/Sparse>
9+ #include " proxsuite/helpers/common.hpp"
910
1011namespace proxsuite {
1112namespace proxqp {
Original file line number Diff line number Diff line change 66#define PROXSUITE_PROXQP_DENSE_MODEL_HPP
77
88#include < Eigen/Core>
9- #include < proxsuite/linalg/veg/type_traits/core.hpp>
9+ #include " proxsuite/linalg/veg/type_traits/core.hpp"
1010#include " proxsuite/proxqp/dense/fwd.hpp"
11- #include < proxsuite/proxqp/sparse/model.hpp>
11+ #include " proxsuite/proxqp/sparse/model.hpp"
1212
1313namespace proxsuite {
1414namespace proxqp {
@@ -61,17 +61,18 @@ struct Model
6161 std::invalid_argument,
6262 " wrong argument size: the dimension wrt the primal "
6363 " variable x should be strictly positive." );
64+
65+ const T infinite_bound_value = helpers::infinite_bound<T>::value ();
66+
6467 H.setZero ();
6568 g.setZero ();
6669 A.setZero ();
6770 C.setZero ();
6871 b.setZero ();
69- u.setZero ();
70- u.array () += 1 .E10 ; // in case it appears u is nullopt (i.e., the problem is
71- // only lower bounded)
72- l.setZero ();
73- l.array () -= 1 .E10 ; // in case it appears l is nullopt (i.e., the problem is
74- // only upper bounded)
72+ u.fill (+infinite_bound_value); // in case it appears u is nullopt (i.e., the
73+ // problem is only lower bounded)
74+ l.fill (-infinite_bound_value); // in case it appears l is nullopt (i.e., the
75+ // problem is only upper bounded)
7576 }
7677
7778 proxsuite::proxqp::sparse::SparseModel<T> to_sparse ()
Original file line number Diff line number Diff line change 66#define PROXSUITE_PROXQP_SPARSE_FWD_HPP
77
88#include < Eigen/Sparse>
9- #include < proxsuite/linalg/veg/vec.hpp>
10- #include < proxsuite/proxqp/dense/views.hpp>
9+ #include " proxsuite/linalg/veg/vec.hpp"
10+ #include " proxsuite/proxqp/dense/views.hpp"
11+ #include " proxsuite/helpers/common.hpp"
1112
1213namespace proxsuite {
1314namespace proxqp {
Original file line number Diff line number Diff line change @@ -60,14 +60,16 @@ struct Model
6060 std::invalid_argument,
6161 " wrong argument size: the dimension wrt primal "
6262 " variable x should be strictly positive." );
63+
64+ const T infinite_bound_value = helpers::infinite_bound<T>::value ();
65+
6366 g.setZero ();
6467 b.setZero ();
6568 u.setZero ();
66- u.array () += 1 .E10 ; // in case it appears u is nullopt (i.e., the problem is
67- // only lower bounded)
68- l.setZero ();
69- l.array () -= 1 .E10 ; // in case it appears l is nullopt (i.e., the problem is
70- // only upper bounded)
69+ u.fill (+infinite_bound_value); // in case it appears u is nullopt (i.e., the
70+ // problem is only lower bounded)
71+ l.fill (-infinite_bound_value); // in case it appears l is nullopt (i.e., the
72+ // problem is only upper bounded)
7173 }
7274 /* !
7375 * Returns the current (scaled) KKT matrix of the problem.
You can’t perform that action at this time.
0 commit comments