Limbo
3.5.4
Toggle main menu visibility
Loading...
Searching...
No Matches
test
solvers
test_MultiKnapsackLagRelax.cpp
Go to the documentation of this file.
1
7
#include <iostream>
8
#include <
limbo/solvers/MultiKnapsackLagRelax.h
>
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
22
limbo::solvers::MultiKnapsackLagRelax<float, int>
solver (&optModel);
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
MultiKnapsackLagRelax.h
Solve multiple knapsack problem with lagrangian relaxation.
limbo::solvers::LinearModel
model to describe an optimization problem
Definition
Solvers.h:1161
limbo::solvers::LinearModel::read
void read(std::string const &filename)
read lp format
Definition
Solvers.h:1464
limbo::solvers::MultiKnapsackLagRelax
Solve multiple knapsack problem with lagrangian relaxation.
Definition
MultiKnapsackLagRelax.h:67
limbo::solvers::SolverProperty
SolverProperty
Some enums used in solver.
Definition
Solvers.h:30
limbo::solvers::toString
std::string toString(SolverProperty sp)
Convert limbo::solvers::SolverProperty to std::string.
Definition
Solvers.h:44
main
int main()
Definition
test_ChromaticNumber.cpp:78
test
void test(std::string const &filename)
test file API
Definition
test_MultiKnapsackLagRelax.cpp:13
Generated on
for Limbo by
1.17.0