KnapsackState represents a partial solution to the knapsack problem.
More...
KnapsackState represents a partial solution to the knapsack problem.
Definition at line 405 of file knapsack_solver.h.
#include <knapsack_solver.h>
◆ KnapsackState() [1/2]
| operations_research::KnapsackState::KnapsackState |
( |
| ) |
|
◆ KnapsackState() [2/2]
| operations_research::KnapsackState::KnapsackState |
( |
const KnapsackState & | | ) |
|
|
delete |
◆ GetNumberOfItems()
| int operations_research::KnapsackState::GetNumberOfItems |
( |
| ) |
const |
|
inline |
◆ Init()
| void operations_research::KnapsackState::Init |
( |
int | number_of_items | ) |
|
Initializes vectors with number_of_items set to false (i.e. not bound yet).
Definition at line 150 of file knapsack_solver.cc.
◆ is_bound()
| bool operations_research::KnapsackState::is_bound |
( |
int | id | ) |
const |
|
inline |
◆ is_in()
| bool operations_research::KnapsackState::is_in |
( |
int | id | ) |
const |
|
inline |
◆ operator=()
◆ UpdateState()
| bool operations_research::KnapsackState::UpdateState |
( |
bool | revert, |
|
|
const KnapsackAssignment & | assignment ) |
Updates the state by applying or reverting a decision. Returns false if fails, i.e. trying to apply an inconsistent decision to an already assigned item.
Definition at line 156 of file knapsack_solver.cc.
The documentation for this class was generated from the following files: