24 std::cout <<
"-----------------------------------------" << std::endl;
25 if (status == paal::lp::OPTIMAL) {
26 std::cout <<
"Optimal solution cost: " << lp_instance.get_obj_value()
29 std::cout <<
"Optimal solution not found" << std::endl;
31 std::cout << lp_instance << std::endl;
40 lp_instance.set_optimization_type(paal::lp::MAXIMIZE);
42 auto X = lp_instance.
add_column(500, 0, paal::lp::lp_traits::PLUS_INF,
"x");
43 auto Y = lp_instance.
add_column(300, 0, paal::lp::lp_traits::PLUS_INF,
"y");
49 std::cout << expr << std::endl;
50 std::cout << (expr >= 7) << std::endl;
52 auto row = lp_instance.
add_row(expr <= 10);
53 lp_instance.
add_row(15 <= 200 *
X + 100 * Y <= 1200);
56 auto status = lp_instance.solve_simplex();
57 print_solution(status, lp_instance);
61 lp_instance.
add_row(expr == 12);
63 lp_instance.set_row_upper_bound(row, 20);
65 lp_instance.set_col_lower_bound(
X, -50);
67 lp_instance.set_row_expression(row,
X + Y * 1.01);
70 status = lp_instance.resolve_simplex(paal::lp::DUAL);
71 print_solution(status, lp_instance);
77 status = lp_instance.resolve_simplex();
78 print_solution(status, lp_instance);
The common LP solvers base class. Responsible for:
col_id add_column(double cost_coef=0, double lb=0., double ub=lp_traits::PLUS_INF, const std::string &name="")
problem_type
LP problem type.
RowIter delete_row(RowIter row)
row_id add_row(const double_bounded_expression &constraint=double_bounded_expression{}, const std::string &name="")