Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test_MultiKnapsackLagRelax.cpp
Go to the documentation of this file.
1 
7 #include <iostream>
9 
10 
13 void test(std::string const& filename)
14 {
15  typedef limbo::solvers::LinearModel<float, int> model_type;
16  model_type optModel;
17  optModel.read(filename);
18 
19  // print problem
20  optModel.print(std::cout);
21 
23 
24  // solve
25  limbo::solvers::SolverProperty status = solver();
26  std::cout << "Problem solved " << limbo::solvers::toString(status) << "\n";
27 
28  // print solutions
29  optModel.printSolution(std::cout);
30  // print problem
31  optModel.print(std::cout);
32 }
33 
37 int main(int argc, char** argv)
38 {
39  if (argc > 1)
40  {
41  // test file API
42  test(argv[1]);
43  }
44  else std::cout << "at least one argument is required\n";
45 
46  return 0;
47 }
48 
Solve multiple knapsack problem with lagrangian relaxation.
SolverProperty
Some enums used in solver.
Definition: Solvers.h:29
void test(std::string const &filename)
test file API
Solve multiple knapsack problem with lagrangian relaxation.
std::string toString(SolverProperty sp)
Convert limbo::solvers::SolverProperty to std::string.
Definition: Solvers.h:44
int main(int argc, char **argv)
main function
void read(std::string const &filename)
read lp format
Definition: Solvers.h:1464
model to describe an optimization problem
Definition: Solvers.h:80