Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set
// doxy/ or-tools/ src/ algorithms/

operations_research::KnapsackState Class Reference

KnapsackState KnapsackState represents a partial solution to the knapsack problem. More...

#include <knapsack_solver.h>

List of all members.

Public Member Functions

 KnapsackState ()
 KnapsackState.
void Init (int number_of_items)
 Initializes vectors with number_of_items set to false (i.e. not bound yet).
bool UpdateState (bool revert, const KnapsackAssignment &assignment)
 Updates the state by applying or reverting a decision.
int GetNumberOfItems () const
bool is_bound (int id) const
bool is_in (int id) const


Detailed Description

KnapsackState KnapsackState represents a partial solution to the knapsack problem.

Definition at line 312 of file knapsack_solver.h.


Constructor & Destructor Documentation

operations_research::KnapsackState::KnapsackState (  ) 

KnapsackState.

Definition at line 144 of file knapsack_solver.cc.


Member Function Documentation

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 146 of file knapsack_solver.cc.

bool operations_research::KnapsackState::UpdateState ( bool  revert,
const KnapsackAssignment assignment 
)

Updates the state by applying or reverting a decision.

Returns false when the state is invalid.

Returns false if fails, i.e. trying to apply an inconsistent decision to an already assigned item.

Definition at line 152 of file knapsack_solver.cc.

int operations_research::KnapsackState::GetNumberOfItems (  )  const [inline]

Definition at line 323 of file knapsack_solver.h.

bool operations_research::KnapsackState::is_bound ( int  id  )  const [inline]

Definition at line 324 of file knapsack_solver.h.

bool operations_research::KnapsackState::is_in ( int  id  )  const [inline]

Definition at line 325 of file knapsack_solver.h.


The documentation for this class was generated from the following files: