--— BaseKnapsackSolver --— This is the base class for knapsack solvers. More...
#include <knapsack_solver.h>

Public Member Functions | |
| BaseKnapsackSolver (const std::string &solver_name) | |
| virtual | ~BaseKnapsackSolver () |
| virtual void | Init (const std::vector< int64 > &profits, const std::vector< std::vector< int64 > > &weights, const std::vector< int64 > &capacities)=0 |
| Initializes the solver and enters the problem to be solved. More... | |
| virtual void | GetLowerAndUpperBoundWhenItem (int item_id, bool is_item_in, int64 *lower_bound, int64 *upper_bound) |
| Gets the lower and upper bound when the item is in or out of the knapsack. More... | |
| virtual int64 | Solve (TimeLimit *time_limit, bool *is_solution_optimal)=0 |
| Solves the problem and returns the profit of the optimal solution. More... | |
| virtual bool | best_solution (int item_id) const =0 |
| Returns true if the item 'item_id' is packed in the optimal knapsack. More... | |
| virtual std::string | GetName () const |
--— BaseKnapsackSolver --— This is the base class for knapsack solvers.
Definition at line 494 of file knapsack_solver.h.
|
inlineexplicit |
Definition at line 496 of file knapsack_solver.h.
|
inlinevirtual |
Definition at line 498 of file knapsack_solver.h.
|
pure virtual |
Returns true if the item 'item_id' is packed in the optimal knapsack.
Implemented in operations_research::KnapsackGenericSolver.
|
virtual |
Gets the lower and upper bound when the item is in or out of the knapsack.
To ensure objects are correctly initialized, this method should not be called before ::Init.
Reimplemented in operations_research::KnapsackGenericSolver.
|
inlinevirtual |
Definition at line 518 of file knapsack_solver.h.
|
pure virtual |
Initializes the solver and enters the problem to be solved.
Implemented in operations_research::KnapsackGenericSolver.
|
pure virtual |
Solves the problem and returns the profit of the optimal solution.
Implemented in operations_research::KnapsackGenericSolver.