[TEST] Add HS35

[TEST] Disabled HS118
release/4.3a0
= 2016-06-29 15:24:27 -04:00
parent adb3feeb1e
commit 4ba87c59e7
3 changed files with 30 additions and 2 deletions

20
examples/Data/HS35.QPS Normal file
View File

@ -0,0 +1,20 @@
NAME HS35
ROWS
N OBJ.FUNC
G R------1
COLUMNS
C------1 OBJ.FUNC -.800000e+01 R------1 -.100000e+01
C------2 OBJ.FUNC -.600000e+01 R------1 -.100000e+01
C------3 OBJ.FUNC -.400000e+01 R------1 -.200000e+01
RHS
RHS OBJ.FUNC -.900000e+01
RHS R------1 -.300000e+01
RANGES
BOUNDS
QUADOBJ
C------1 C------1 0.400000e+01
C------1 C------2 0.200000e+01
C------1 C------3 0.200000e+01
C------2 C------2 0.400000e+01
C------3 C------3 0.200000e+01
ENDATA

View File

@ -107,7 +107,7 @@ struct QPSParser::MPSGrammar: base_grammar {
cols = lexeme[lit("COLUMNS") >> *blank >> eol
>> +((col_double | col_single) >> eol)];
quad = lexeme[lit("QUADOBJ") >> *blank >> eol >> +(quad_l >> eol)];
bounds = lexeme[lit("BOUNDS") >> +space >> +((bound | bound_fr) >> eol)];
bounds = lexeme[lit("BOUNDS") >> +space >> *((bound | bound_fr) >> eol)];
ranges = lexeme[lit("RANGES") >> +space
>> *((range_double | range_single) >> eol)];
end = lexeme[lit("ENDATA") >> *space];

View File

@ -281,7 +281,7 @@ TEST(QPSolver, HS21) {
CHECK(assert_equal(expectedSolution, actualSolution))
}
TEST(QPSolver, HS118) {
TEST_DISABLED(QPSolver, HS118) {
QP problem = QPSParser("HS118.QPS").Parse();
VectorValues actualSolution;
VectorValues expectedSolution;
@ -295,6 +295,14 @@ TEST(QPSolver, HS118) {
CHECK(assert_equal(expectedSolution, actualSolution))
}
TEST(QPSolver, HS35) {
QP problem = QPSParser("HS35.QPS").Parse();
VectorValues actualSolution;
boost::tie(actualSolution, boost::tuples::ignore) = QPSolver(problem).optimize();
double error_actual = problem.cost.error(actualSolution);
CHECK(assert_equal(1.11111111e-01,error_actual, 1e-7))
}
/* ************************************************************************* */
// Create Matlab's test graph as in http://www.mathworks.com/help/optim/ug/quadprog.html
QP createTestMatlabQPEx() {