C++ Reference

C++ Reference: Algorithms

BaseKnapsackSolverabstract

Detailed Description

Definition at line 566 of file 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
 
virtual void GetLowerAndUpperBoundWhenItem (int item_id, bool is_item_in, int64 *lower_bound, int64 *upper_bound)
 
virtual int64 Solve (TimeLimit *time_limit, bool *is_solution_optimal)=0
 
virtual bool best_solution (int item_id) const =0
 
virtual std::string GetName () const
 

Constructor & Destructor Documentation

◆ BaseKnapsackSolver()

BaseKnapsackSolver ( const std::string &  solver_name)
inlineexplicit

Definition at line 568 of file knapsack_solver.h.

◆ ~BaseKnapsackSolver()

virtual ~BaseKnapsackSolver ( )
inlinevirtual

Definition at line 570 of file knapsack_solver.h.

Member Function Documentation

◆ best_solution()

virtual bool best_solution ( int  item_id) const
pure virtual

Implemented in KnapsackGenericSolver.

◆ GetLowerAndUpperBoundWhenItem()

virtual void GetLowerAndUpperBoundWhenItem ( int  item_id,
bool  is_item_in,
int64 *  lower_bound,
int64 *  upper_bound 
)
virtual

Reimplemented in KnapsackGenericSolver.

◆ GetName()

virtual std::string GetName ( ) const
inlinevirtual

Definition at line 590 of file knapsack_solver.h.

◆ Init()

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

Implemented in KnapsackGenericSolver.

◆ Solve()

virtual int64 Solve ( TimeLimit *  time_limit,
bool *  is_solution_optimal 
)
pure virtual

Implemented in KnapsackGenericSolver.


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