OR-Tools  8.2
KnapsackMIPSolverabstract

Detailed Description

Definition at line 1029 of file knapsack_solver.cc.

Public Member Functions

 KnapsackMIPSolver (MPSolver::OptimizationProblemType problem_type, const std::string &solver_name)
 
void Init (const std::vector< int64 > &profits, const std::vector< std::vector< int64 >> &weights, const std::vector< int64 > &capacities) override
 
int64 Solve (TimeLimit *time_limit, bool *is_solution_optimal) override
 
bool best_solution (int item_id) const override
 
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 std::string GetName () const
 

Constructor & Destructor Documentation

◆ KnapsackMIPSolver()

KnapsackMIPSolver ( MPSolver::OptimizationProblemType  problem_type,
const std::string &  solver_name 
)

Definition at line 1055 of file knapsack_solver.cc.

Member Function Documentation

◆ best_solution()

bool best_solution ( int  item_id) const
inlineoverridevirtual

Implements BaseKnapsackSolver.

Definition at line 1043 of file knapsack_solver.cc.

◆ GetLowerAndUpperBoundWhenItem()

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

Reimplemented in KnapsackGenericSolver.

Definition at line 1372 of file knapsack_solver.cc.

◆ GetName()

virtual std::string GetName ( ) const
inlinevirtualinherited

Definition at line 590 of file knapsack_solver.h.

◆ Init() [1/2]

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

Implemented in KnapsackGenericSolver.

◆ Init() [2/2]

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

Definition at line 1065 of file knapsack_solver.cc.

◆ Solve()

int64 Solve ( TimeLimit time_limit,
bool *  is_solution_optimal 
)
overridevirtual

Implements BaseKnapsackSolver.

Definition at line 1073 of file knapsack_solver.cc.


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