C++ Reference

C++ Reference: Algorithms

Detailed Description

Definition at line 526 of file knapsack_solver.h.

Public Member Functions

 KnapsackCapacityPropagator (const KnapsackState &state, int64 capacity)
 
 ~KnapsackCapacityPropagator () override
 
void ComputeProfitBounds () override
 
int GetNextItemId () const override
 
void Init (const std::vector< int64 > &profits, const std::vector< int64 > &weights)
 
bool Update (bool revert, const KnapsackAssignment &assignment)
 
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

void InitPropagator () override
 
bool UpdatePropagator (bool revert, const KnapsackAssignment &assignment) override
 
void CopyCurrentStateToSolutionPropagator (std::vector< bool > *solution) const override
 
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

◆ KnapsackCapacityPropagator()

KnapsackCapacityPropagator ( const KnapsackState state,
int64  capacity 
)

◆ ~KnapsackCapacityPropagator()

Member Function Documentation

◆ ComputeProfitBounds()

void ComputeProfitBounds ( )
overridevirtual

Implements KnapsackPropagator.

◆ CopyCurrentStateToSolution()

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

◆ CopyCurrentStateToSolutionPropagator()

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

Implements KnapsackPropagator.

◆ current_profit()

int64 current_profit ( ) const
inlineinherited

Definition at line 459 of file knapsack_solver.h.

◆ GetNextItemId()

int GetNextItemId ( ) const
inlineoverridevirtual

Implements KnapsackPropagator.

Definition at line 531 of file knapsack_solver.h.

◆ Init()

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

◆ InitPropagator()

void InitPropagator ( )
overrideprotectedvirtual

Implements KnapsackPropagator.

◆ items()

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

Definition at line 491 of file knapsack_solver.h.

◆ profit_lower_bound()

int64 profit_lower_bound ( ) const
inlineinherited

Definition at line 460 of file knapsack_solver.h.

◆ profit_upper_bound()

int64 profit_upper_bound ( ) const
inlineinherited

Definition at line 461 of file knapsack_solver.h.

◆ set_profit_lower_bound()

void set_profit_lower_bound ( int64  profit)
inlineprotectedinherited

Definition at line 493 of file knapsack_solver.h.

◆ set_profit_upper_bound()

void set_profit_upper_bound ( int64  profit)
inlineprotectedinherited

Definition at line 494 of file knapsack_solver.h.

◆ state()

const KnapsackState& state ( ) const
inlineprotectedinherited

Definition at line 490 of file knapsack_solver.h.

◆ Update()

bool Update ( bool  revert,
const KnapsackAssignment assignment 
)
inherited

◆ UpdatePropagator()

bool UpdatePropagator ( bool  revert,
const KnapsackAssignment assignment 
)
overrideprotectedvirtual

Implements KnapsackPropagator.


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