|
|
@ -14,7 +14,9 @@ TEST(GurobiLpSolver, LPOptimizeMax) { |
|
|
|
ASSERT_NO_THROW(yIndex = solver.createContinuousVariable("y", storm::solver::LpSolver::VariableType::LOWER_BOUND, 0, 0, 2)); |
|
|
|
uint_fast64_t zIndex; |
|
|
|
ASSERT_NO_THROW(zIndex = solver.createContinuousVariable("z", storm::solver::LpSolver::VariableType::LOWER_BOUND, 0, 0, 1)); |
|
|
|
|
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.update()); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {xIndex, yIndex, zIndex}, {1, 1, 1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 12)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, zIndex, xIndex}, {0.5, 1, -1}, storm::solver::LpSolver::BoundType::EQUAL, 5)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, xIndex}, {1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 5.5)); |
|
|
@ -50,6 +52,8 @@ TEST(GurobiLpSolver, LPOptimizeMin) { |
|
|
|
uint_fast64_t zIndex; |
|
|
|
ASSERT_NO_THROW(zIndex = solver.createContinuousVariable("z", storm::solver::LpSolver::VariableType::BOUNDED, 1, 5.7, -1)); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.update()); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {xIndex, yIndex, zIndex}, {1, 1, 1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 12)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, zIndex, xIndex}, {0.5, 1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 5)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, xIndex}, {1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 5.5)); |
|
|
@ -85,6 +89,8 @@ TEST(GurobiLpSolver, MILPOptimizeMax) { |
|
|
|
uint_fast64_t zIndex; |
|
|
|
ASSERT_NO_THROW(zIndex = solver.createContinuousVariable("z", storm::solver::LpSolver::VariableType::LOWER_BOUND, 0, 0, 1)); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.update()); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {xIndex, yIndex, zIndex}, {1, 1, 1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 12)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, zIndex, xIndex}, {0.5, 1, -1}, storm::solver::LpSolver::BoundType::EQUAL, 5)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, xIndex}, {1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 5.5)); |
|
|
@ -120,6 +126,8 @@ TEST(GurobiLpSolver, MILPOptimizeMin) { |
|
|
|
uint_fast64_t zIndex; |
|
|
|
ASSERT_NO_THROW(zIndex = solver.createIntegerVariable("z", storm::solver::LpSolver::VariableType::BOUNDED, 0, 5.7, -1)); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.update()); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {xIndex, yIndex, zIndex}, {1, 1, 1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 12)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, zIndex, xIndex}, {0.5, 1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 5)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, xIndex}, {1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 5.5)); |
|
|
@ -155,6 +163,8 @@ TEST(GurobiLpSolver, LPInfeasible) { |
|
|
|
uint_fast64_t zIndex; |
|
|
|
ASSERT_NO_THROW(zIndex = solver.createContinuousVariable("z", storm::solver::LpSolver::VariableType::LOWER_BOUND, 0, 0, 1)); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.update()); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {xIndex, yIndex, zIndex}, {1, 1, 1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 12)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, zIndex, xIndex}, {0.5, 1, -1}, storm::solver::LpSolver::BoundType::EQUAL, 5)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, xIndex}, {1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 5.5)); |
|
|
@ -187,6 +197,8 @@ TEST(GurobiLpSolver, MILPInfeasible) { |
|
|
|
uint_fast64_t zIndex; |
|
|
|
ASSERT_NO_THROW(zIndex = solver.createContinuousVariable("z", storm::solver::LpSolver::VariableType::LOWER_BOUND, 0, 0, 1)); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.update()); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {xIndex, yIndex, zIndex}, {1, 1, 1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 12)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, zIndex, xIndex}, {0.5, 1, -1}, storm::solver::LpSolver::BoundType::EQUAL, 5)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, xIndex}, {1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 5.5)); |
|
|
@ -219,6 +231,8 @@ TEST(GurobiLpSolver, LPUnbounded) { |
|
|
|
uint_fast64_t zIndex; |
|
|
|
ASSERT_NO_THROW(zIndex = solver.createContinuousVariable("z", storm::solver::LpSolver::VariableType::LOWER_BOUND, 0, 0, 1)); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.update()); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {xIndex, yIndex, zIndex}, {1, 1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 12)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, xIndex}, {1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 5.5)); |
|
|
|
|
|
|
@ -249,6 +263,8 @@ TEST(GurobiLpSolver, MILPUnbounded) { |
|
|
|
uint_fast64_t zIndex; |
|
|
|
ASSERT_NO_THROW(zIndex = solver.createContinuousVariable("z", storm::solver::LpSolver::VariableType::LOWER_BOUND, 0, 0, 1)); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.update()); |
|
|
|
|
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {xIndex, yIndex, zIndex}, {1, 1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 12)); |
|
|
|
ASSERT_NO_THROW(solver.addConstraint("", {yIndex, xIndex}, {1, -1}, storm::solver::LpSolver::BoundType::LESS_EQUAL, 5.5)); |
|
|
|
|
|
|
|