[TEST] added QPTest. Showcases failure to work on indeterminate linear systems.
parent
15c6aa210b
commit
c98c772017
|
@ -0,0 +1,19 @@
|
||||||
|
NAME QP example
|
||||||
|
ROWS
|
||||||
|
N obj
|
||||||
|
G r1
|
||||||
|
L r2
|
||||||
|
COLUMNS
|
||||||
|
c1 r1 2.0 r2 -1.0
|
||||||
|
c1 obj 1.5
|
||||||
|
c2 r1 1.0 r2 2.0
|
||||||
|
c2 obj -2.0
|
||||||
|
RHS
|
||||||
|
rhs1 r1 2.0 r2 6.0
|
||||||
|
BOUNDS
|
||||||
|
UP bnd1 c1 20.0
|
||||||
|
QUADOBJ
|
||||||
|
c1 c1 8.0
|
||||||
|
c1 c2 2.0
|
||||||
|
c2 c2 10.0
|
||||||
|
ENDATA
|
|
@ -367,6 +367,17 @@ TEST_DISABLED(QPSolver, CONT_050) { // Fails with Indeterminant Linear System er
|
||||||
CHECK(assert_equal(-4.56385090,error_actual, 1e-7))
|
CHECK(assert_equal(-4.56385090,error_actual, 1e-7))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(QPSolver, QPTEST) { // Fails with Indeterminant Linear System error
|
||||||
|
QP problem = QPSParser("QPTEST.QPS").Parse();
|
||||||
|
GTSAM_PRINT(problem.cost);
|
||||||
|
GTSAM_PRINT(problem.equalities);
|
||||||
|
GTSAM_PRINT(problem.inequalities);
|
||||||
|
VectorValues actualSolution;
|
||||||
|
boost::tie(actualSolution, boost::tuples::ignore) = QPSolver(problem).optimize();
|
||||||
|
double error_actual = problem.cost.error(actualSolution);
|
||||||
|
CHECK(assert_equal(0.437187500e01,error_actual, 1e-7))
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
// Create Matlab's test graph as in http://www.mathworks.com/help/optim/ug/quadprog.html
|
// Create Matlab's test graph as in http://www.mathworks.com/help/optim/ug/quadprog.html
|
||||||
QP createTestMatlabQPEx() {
|
QP createTestMatlabQPEx() {
|
||||||
|
|
Loading…
Reference in New Issue