Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eiquadprog
Commits
37134168
Commit
37134168
authored
Oct 04, 2019
by
Gabriele Buondonno
Browse files
[unittest] [eiquadprog-rt] test_unfeasible_constraints
parent
c4cfba97
Pipeline
#6129
passed with stage
in 1 minute and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
unittest/eiquadprog-rt.cpp
View file @
37134168
...
...
@@ -318,6 +318,51 @@ BOOST_AUTO_TEST_CASE(test_unfeasible_inequalities) {
BOOST_CHECK
(
status
!=
RT_EIQUADPROG_OPTIMAL
);
}
// min ||x-x_0||^2, x_0 = (1 1)^T
// s.t.
// x[1] = 1 - x[0]
// x[0] <= 0
// x[1] <= 0
//
// correctly fails, but returns wrong error code
BOOST_AUTO_TEST_CASE
(
test_unfeasible_constraints
)
{
RtEiquadprog
<
2
,
1
,
2
>
qp
;
RtMatrixX
<
2
,
2
>::
d
Q
;
Q
.
setZero
();
Q
(
0
,
0
)
=
1.0
;
Q
(
1
,
1
)
=
1.0
;
RtVectorX
<
2
>::
d
C
;
C
(
0
)
=
-
1.
;
C
(
1
)
=
-
1.
;
RtMatrixX
<
1
,
2
>::
d
Aeq
;
Aeq
(
0
,
0
)
=
1.
;
Aeq
(
0
,
1
)
=
1.
;
RtVectorX
<
1
>::
d
Beq
;
Beq
(
0
)
=
-
1.
;
RtMatrixX
<
2
,
2
>::
d
Aineq
;
Aineq
.
setZero
();
Aineq
(
0
,
0
)
=
-
1.
;
Aineq
(
1
,
1
)
=
-
1.
;
RtVectorX
<
2
>::
d
Bineq
;
Bineq
.
setZero
();
RtVectorX
<
2
>::
d
x
;
RtEiquadprog_status
expected
=
RT_EIQUADPROG_INFEASIBLE
;
RtEiquadprog_status
status
=
qp
.
solve_quadprog
(
Q
,
C
,
Aeq
,
Beq
,
Aineq
,
Bineq
,
x
);
BOOST_WARN_EQUAL
(
status
,
expected
);
BOOST_CHECK
(
status
!=
RT_EIQUADPROG_OPTIMAL
);
}
// min -||x||^2
// DOES NOT WORK!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment