13 #ifndef MMKP_MCKNAP_INCLUDED
14 #define MMKP_MCKNAP_INCLUDED
38 #include "UtilMacros.h"
70 void solveTrivialMaxSum(
const double * redCost,
71 const double * origCost,
74 double & varOrigCost);
78 return (i * m_nGroupCols) + j;
82 return make_pair(index / m_nGroupCols, index % m_nGroupCols);
85 void setMCKnapData(
const double capacity,
86 const double * weight);
88 void solveMCKnap(
const double * redCost,
89 const double * origCost,
91 vector<double> & solEls,
93 double & varOrigCost);
97 const int nGroupCols) :
102 m_nCols (nGroupRows * nGroupCols),
103 m_nGroupRows(nGroupRows),
104 m_nGroupCols(nGroupCols),
109 m_costDbl =
new double[m_nCols];
110 m_cost =
new int[m_nCols];
111 m_weight =
new int[m_nCols];
112 assert(m_costDbl && m_cost && m_weight);
119 for(i = 0; i < m_setset->size; i++){
124 free(m_setset->fset);
const int getIndexIJ(const int i, const int j) const
pair< int, int > getIndexInv(const int index) const
MMKP_MCKnap(const int nGroupRows, const int nGroupCols)