Skip to content

Commit 7e77a56

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2fd0251 commit 7e77a56

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

include/proxsuite/proxqp/dense/model.hpp

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,26 +103,40 @@ struct Model
103103
// check that all matrices and vectors of qpmodel have the correct size
104104
// and that H and C have expected properties
105105
PROXSUITE_CHECK_ARGUMENT_SIZE(g.size(), dim, "g has not the expected size.")
106-
PROXSUITE_CHECK_ARGUMENT_SIZE(b.size(), n_eq, "b has not the expected size.")
107-
PROXSUITE_CHECK_ARGUMENT_SIZE(l.size(), n_in, "l has not the expected size.")
108-
PROXSUITE_CHECK_ARGUMENT_SIZE(u.size(), n_in, "u has not the expected size.")
106+
PROXSUITE_CHECK_ARGUMENT_SIZE(
107+
b.size(), n_eq, "b has not the expected size.")
108+
PROXSUITE_CHECK_ARGUMENT_SIZE(
109+
l.size(), n_in, "l has not the expected size.")
110+
PROXSUITE_CHECK_ARGUMENT_SIZE(
111+
u.size(), n_in, "u has not the expected size.")
109112
if (box_constraints) {
110-
PROXSUITE_CHECK_ARGUMENT_SIZE(u_box.size(), dim, "u_box has not the expected size");
111-
PROXSUITE_CHECK_ARGUMENT_SIZE(l_box.size(), dim, "l_box has not the expected size");
113+
PROXSUITE_CHECK_ARGUMENT_SIZE(
114+
u_box.size(), dim, "u_box has not the expected size");
115+
PROXSUITE_CHECK_ARGUMENT_SIZE(
116+
l_box.size(), dim, "l_box has not the expected size");
112117
}
113118
if (H.size()) {
114-
PROXSUITE_CHECK_ARGUMENT_SIZE(H.rows(), dim, "H has not the expected number of rows.");
115-
PROXSUITE_CHECK_ARGUMENT_SIZE(H.cols(), dim, "H has not the expected number of cols.");
116-
PROXSUITE_THROW_PRETTY((!H.isApprox(H.transpose(), 0.0)), std::invalid_argument, "H is not symmetric.");
119+
PROXSUITE_CHECK_ARGUMENT_SIZE(
120+
H.rows(), dim, "H has not the expected number of rows.");
121+
PROXSUITE_CHECK_ARGUMENT_SIZE(
122+
H.cols(), dim, "H has not the expected number of cols.");
123+
PROXSUITE_THROW_PRETTY((!H.isApprox(H.transpose(), 0.0)),
124+
std::invalid_argument,
125+
"H is not symmetric.");
117126
}
118127
if (A.size()) {
119-
PROXSUITE_CHECK_ARGUMENT_SIZE(A.rows(), n_eq, "A has not the expected number of rows.");
120-
PROXSUITE_CHECK_ARGUMENT_SIZE(A.cols(), dim, "A has not the expected number of cols.");
128+
PROXSUITE_CHECK_ARGUMENT_SIZE(
129+
A.rows(), n_eq, "A has not the expected number of rows.");
130+
PROXSUITE_CHECK_ARGUMENT_SIZE(
131+
A.cols(), dim, "A has not the expected number of cols.");
121132
}
122133
if (C.size()) {
123-
PROXSUITE_CHECK_ARGUMENT_SIZE(C.rows(), n_in, "C has not the expected number of rows.");
124-
PROXSUITE_CHECK_ARGUMENT_SIZE(C.cols(), dim, "C has not the expected number of cols.");
125-
PROXSUITE_THROW_PRETTY(C.isZero(), std::invalid_argument, "C is zero, while n_in != 0.");
134+
PROXSUITE_CHECK_ARGUMENT_SIZE(
135+
C.rows(), n_in, "C has not the expected number of rows.");
136+
PROXSUITE_CHECK_ARGUMENT_SIZE(
137+
C.cols(), dim, "C has not the expected number of cols.");
138+
PROXSUITE_THROW_PRETTY(
139+
C.isZero(), std::invalid_argument, "C is zero, while n_in != 0.");
126140
}
127141
return true;
128142
}

include/proxsuite/proxqp/dense/solver.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ iterative_residual(const Model<T>& qpmodel,
260260
break;
261261
case HessianType::Diagonal:
262262
#ifndef NDEBUG
263-
PROXSUITE_THROW_PRETTY(!qpwork.H_scaled.isDiagonal(), std::invalid_argument, "H is not diagonal.");
263+
PROXSUITE_THROW_PRETTY(!qpwork.H_scaled.isDiagonal(),
264+
std::invalid_argument,
265+
"H is not diagonal.");
264266
#endif
265267
Hdx.array() = qpwork.H_scaled.diagonal().array() *
266268
qpwork.dw_aug.head(qpmodel.dim).array();

0 commit comments

Comments
 (0)