Dip
0.92.4
|
#include <GAP_Knapsack.h>
Public Member Functions | |
Access get methods. | |
const int | getLength () const |
const double | getCapacity () const |
const double * | getProfit () const |
const double * | getWeight () const |
const double * | getProfitSort () const |
const double * | getWeightSort () const |
const int * | getSolution () const |
const double | getOptObj () const |
const SOR_IntDblArr * | getRatio () const |
double * | getMutableProfit () |
double * | getMutableWeight () |
Set methods. | |
void | setLength (const int length) |
Helper Methods. | |
void | populateAndSortRatio (const double *profit=0, const double *weight=0) |
int | solveKnapsack () |
Constructor and Destructor | |
GAP_Knapsack (const int length, const double capacity, const double *profit, const double *weight) | |
Default constructor. More... | |
~GAP_Knapsack () | |
Default constructor. More... | |
Private Member Functions | |
Copy Constructors | |
Disable the default copy constructors. | |
GAP_Knapsack (const GAP_Knapsack &) | |
GAP_Knapsack & | operator= (const GAP_Knapsack &) |
Private Attributes | |
int | m_length |
GAP_Knapsack problem instance data. More... | |
double | m_capacity |
double * | m_profit |
double * | m_weight |
double * | m_profitSort |
double * | m_weightSort |
int * | m_solution |
double | m_optObj |
SOR_IntDblArr * | m_ratio |
A class to store an instance of the Knapsack Problem
max sum{j = 0..n-1} p[j] x[j] s.t. sum{j = 0..n-1} w[j] x[j] <= b x binary
Definition at line 34 of file GAP_Knapsack.h.
|
private |
|
inline |
Default constructor.
Takes an instance of UtilParameters
Definition at line 106 of file GAP_Knapsack.h.
References CoinAssert, CoinAssertHint, m_profit, m_profitSort, m_ratio, m_solution, m_weight, m_weightSort, and SOR_IntDblArrNew().
|
inline |
Default constructor.
Takes an instance of UtilParameters
Definition at line 136 of file GAP_Knapsack.h.
References m_profit, m_profitSort, m_ratio, m_solution, m_weight, m_weightSort, SOR_IntDblArrFree(), and UTIL_DELARR.
|
inline |
Definition at line 50 of file GAP_Knapsack.h.
References m_length.
|
inline |
Definition at line 51 of file GAP_Knapsack.h.
References m_capacity.
|
inline |
Definition at line 52 of file GAP_Knapsack.h.
References m_profit.
|
inline |
Definition at line 53 of file GAP_Knapsack.h.
References m_weight.
|
inline |
Definition at line 54 of file GAP_Knapsack.h.
References m_profitSort.
|
inline |
Definition at line 55 of file GAP_Knapsack.h.
References m_weightSort.
|
inline |
Definition at line 56 of file GAP_Knapsack.h.
References m_solution.
|
inline |
Definition at line 57 of file GAP_Knapsack.h.
References m_optObj.
|
inline |
Definition at line 58 of file GAP_Knapsack.h.
References m_ratio.
|
inline |
Definition at line 59 of file GAP_Knapsack.h.
References m_profit.
|
inline |
Definition at line 60 of file GAP_Knapsack.h.
References m_weight.
|
inline |
Definition at line 63 of file GAP_Knapsack.h.
References m_length.
|
inline |
Definition at line 67 of file GAP_Knapsack.h.
References SOR_IntDblArrT::arr, KnapsackSortRatioOut(), m_length, m_profit, m_profitSort, m_ratio, m_weight, and m_weightSort.
|
inline |
Definition at line 81 of file GAP_Knapsack.h.
References CoinAssert, KnapsackOptimizeHS(), m_capacity, m_length, m_optObj, m_profitSort, m_solution, and m_weightSort.
|
private |
|
private |
GAP_Knapsack problem instance data.
Definition at line 38 of file GAP_Knapsack.h.
Referenced by getLength(), populateAndSortRatio(), setLength(), and solveKnapsack().
|
private |
Definition at line 39 of file GAP_Knapsack.h.
Referenced by getCapacity(), and solveKnapsack().
|
private |
Definition at line 40 of file GAP_Knapsack.h.
Referenced by GAP_Knapsack(), getMutableProfit(), getProfit(), populateAndSortRatio(), and ~GAP_Knapsack().
|
private |
Definition at line 41 of file GAP_Knapsack.h.
Referenced by GAP_Knapsack(), getMutableWeight(), getWeight(), populateAndSortRatio(), and ~GAP_Knapsack().
|
private |
Definition at line 42 of file GAP_Knapsack.h.
Referenced by GAP_Knapsack(), getProfitSort(), populateAndSortRatio(), solveKnapsack(), and ~GAP_Knapsack().
|
private |
Definition at line 43 of file GAP_Knapsack.h.
Referenced by GAP_Knapsack(), getWeightSort(), populateAndSortRatio(), solveKnapsack(), and ~GAP_Knapsack().
|
private |
Definition at line 44 of file GAP_Knapsack.h.
Referenced by GAP_Knapsack(), getSolution(), solveKnapsack(), and ~GAP_Knapsack().
|
private |
Definition at line 45 of file GAP_Knapsack.h.
Referenced by getOptObj(), and solveKnapsack().
|
private |
Definition at line 46 of file GAP_Knapsack.h.
Referenced by GAP_Knapsack(), getRatio(), populateAndSortRatio(), and ~GAP_Knapsack().