C++ Reference

C++ Reference: Algorithms

Detailed Description

Definition at line 440 of file knapsack_solver.h.

Public Member Functions

 KnapsackPropagator (const KnapsackState &state)
 
virtual ~KnapsackPropagator ()
 
void Init (const std::vector< int64 > &profits, const std::vector< int64 > &weights)
 
bool Update (bool revert, const KnapsackAssignment &assignment)
 
virtual void ComputeProfitBounds ()=0
 
virtual int GetNextItemId () const =0
 
int64 current_profit () const
 
int64 profit_lower_bound () const
 
int64 profit_upper_bound () const
 
void CopyCurrentStateToSolution (bool has_one_propagator, std::vector< bool > *solution) const
 

Protected Member Functions

virtual void InitPropagator ()=0
 
virtual bool UpdatePropagator (bool revert, const KnapsackAssignment &assignment)=0
 
virtual void CopyCurrentStateToSolutionPropagator (std::vector< bool > *solution) const =0
 
const KnapsackStatestate () const
 
const std::vector< KnapsackItemPtr > & items () const
 
void set_profit_lower_bound (int64 profit)
 
void set_profit_upper_bound (int64 profit)
 

Constructor & Destructor Documentation

◆ KnapsackPropagator()

KnapsackPropagator ( const KnapsackState state)
explicit

◆ ~KnapsackPropagator()

virtual ~KnapsackPropagator ( )
virtual

Member Function Documentation

◆ ComputeProfitBounds()

virtual void ComputeProfitBounds ( )
pure virtual

Implemented in KnapsackCapacityPropagator.

◆ CopyCurrentStateToSolution()

void CopyCurrentStateToSolution ( bool  has_one_propagator,
std::vector< bool > *  solution 
) const

◆ CopyCurrentStateToSolutionPropagator()

virtual void CopyCurrentStateToSolutionPropagator ( std::vector< bool > *  solution) const
protectedpure virtual

Implemented in KnapsackCapacityPropagator.

◆ current_profit()

int64 current_profit ( ) const
inline

Definition at line 459 of file knapsack_solver.h.

◆ GetNextItemId()

virtual int GetNextItemId ( ) const
pure virtual

Implemented in KnapsackCapacityPropagator.

◆ Init()

void Init ( const std::vector< int64 > &  profits,
const std::vector< int64 > &  weights 
)

◆ InitPropagator()

virtual void InitPropagator ( )
protectedpure virtual

Implemented in KnapsackCapacityPropagator.

◆ items()

const std::vector< KnapsackItemPtr > & items ( ) const
inlineprotected

Definition at line 491 of file knapsack_solver.h.

◆ profit_lower_bound()

int64 profit_lower_bound ( ) const
inline

Definition at line 460 of file knapsack_solver.h.

◆ profit_upper_bound()

int64 profit_upper_bound ( ) const
inline

Definition at line 461 of file knapsack_solver.h.

◆ set_profit_lower_bound()

void set_profit_lower_bound ( int64  profit)
inlineprotected

Definition at line 493 of file knapsack_solver.h.

◆ set_profit_upper_bound()

void set_profit_upper_bound ( int64  profit)
inlineprotected

Definition at line 494 of file knapsack_solver.h.

◆ state()

const KnapsackState & state ( ) const
inlineprotected

Definition at line 490 of file knapsack_solver.h.

◆ Update()

bool Update ( bool  revert,
const KnapsackAssignment assignment 
)

◆ UpdatePropagator()

virtual bool UpdatePropagator ( bool  revert,
const KnapsackAssignment assignment 
)
protectedpure virtual

Implemented in KnapsackCapacityPropagator.


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