13 #ifndef GAP_KNAPSACK_INCLUDED
14 #define GAP_KNAPSACK_INCLUDED
68 const double * weight = 0){
69 const double * p = profit;
70 const double * w = weight;
107 const double capacity,
108 const double * profit,
109 const double * weight) :
128 "Error: Out of Memory");
129 memcpy(
m_profit, profit, length *
sizeof(
double));
130 memcpy(
m_weight, weight, length *
sizeof(
double));
double * getMutableProfit()
void SOR_IntDblArrFree(SOR_IntDblArrPtr *A)
void KnapsackSortRatioOut(const int n, const double *p, const double *w, double *psort, double *wsort, SOR_IntDbl *ratio)
int m_length
GAP_Knapsack problem instance data.
const SOR_IntDblArr * getRatio() const
int KnapsackOptimizeHS(const int n, const double c, double *p, double *w, int *x, double *z, int *pstatus)
const double * getProfitSort() const
const int * getSolution() const
const int getLength() const
#define CoinAssertHint(expression, hint)
GAP_Knapsack(const GAP_Knapsack &)
const double * getProfit() const
void populateAndSortRatio(const double *profit=0, const double *weight=0)
const double getOptObj() const
double * getMutableWeight()
GAP_Knapsack(const int length, const double capacity, const double *profit, const double *weight)
Default constructor.
SOR_IntDblArrPtr SOR_IntDblArrNew(int size, int *pstatus)
~GAP_Knapsack()
Default constructor.
const double getCapacity() const
const double * getWeight() const
#define CoinAssert(expression)
GAP_Knapsack & operator=(const GAP_Knapsack &)
const double * getWeightSort() const
void setLength(const int length)