Dip  0.92.4
Public Member Functions | Private Attributes | List of all members
MMKP_DecompApp Class Reference

#include <MMKP_DecompApp.h>

Inheritance diagram for MMKP_DecompApp:
Inheritance graph
[legend]
Collaboration diagram for MMKP_DecompApp:
Collaboration graph
[legend]

Public Member Functions

virtual DecompSolverStatus solveRelaxed (const int whichBlock, const double *redCostX, const double convexDual, DecompVarList &varList)
 Solve the relaxed problem. More...
 
virtual void printOriginalColumn (const int index, ostream *os=&cout) const
 Print an original column (format for this app). More...
 
Helper functions (public).
void initializeApp ()
 Initialize application. More...
 
void createModels ()
 Initialize application. More...
 
void createModelPartMCP (DecompConstraintSet *model)
 Initialize application. More...
 
void createModelPartMCKP (DecompConstraintSet *model, int whichKnap=0)
 Initialize application. More...
 
void createModelPartMC2KP (DecompConstraintSet *model, int whichKnap1, int whichKnap2)
 Initialize application. More...
 
void createModelPartMCKP (DecompConstraintSet *model, vector< int > &whichKnaps)
 Initialize application. More...
 
void createModelPartMMKPHalf (DecompConstraintSet *model)
 Initialize application. More...
 
void createModelPartMMKP (DecompConstraintSet *model)
 Initialize application. More...
 
void createModelPartMDKPCompl (DecompConstraintSet *model, int whichKnap=0)
 Initialize application. More...
 
void createModelPartMDKP (DecompConstraintSet *model)
 Initialize application. More...
 
void createModelPartMDKPHalf (DecompConstraintSet *model)
 Initialize application. More...
 
void createModelPartMDKP (DecompConstraintSet *model, vector< int > &whichKnaps)
 Initialize application. More...
 
Constructor and Destructor
 MMKP_DecompApp (UtilParameters &utilParam)
 Default constructor. More...
 
virtual ~MMKP_DecompApp ()
 Default constructor. More...
 
- Public Member Functions inherited from DecompApp
void createModels ()
 Create model parts. More...
 
DecompConstraintSetcreateModelPart (const int nRowsPart, const int *rowsPart)
 
void createModelPart (DecompConstraintSet *model, const int nRowsPart, const int *rowsPart)
 
void createModelPartSparse (DecompConstraintSet *model, const int nRowsPart, const int *rowsPart)
 
void readInitSolutionFile (DecompVarList &initVars)
 
void readBlockFile ()
 Read block file. More...
 
void readProblem ()
 Read Problem. More...
 
void singlyBorderStructureDetection ()
 Automatically detect singly bordered structure. More...
 
void findActiveColumns (const std::vector< int > &rowsPart, std::set< int > &activeColsSet)
 Find the active columns for some block. More...
 
const std::string getInstanceName ()
 Get Intance name. More...
 
const CoinPackedMatrixgetMatrix ()
 Get constraint matrix for analysis. More...
 
void setInfinity ()
 Set the value of infinity. More...
 
 DecompApp (UtilParameters &utilParam)
 Constructor for base DecompApp class. More...
 
virtual ~DecompApp ()
 Destructor. More...
 
void startupLog ()
 Initialize the DecompApp data. More...
 
int createModel ()
 
virtual void APPcreateModel (double *&objCoeff, map< int, DecompConstraintSet * > &modelCore, map< int, DecompConstraintSet * > &modelRelax)=0
 
virtual bool APPisUserFeasible (const double *x, const int n_cols, const double tolZero)
 
virtual int APPheuristics (const double *xhat, vector< DecompSolution * > &xhatIPFeas)
 
virtual int generateInitVars (DecompVarList &initVars, int whichModel)
 
virtual int generateCuts (const double *x, const DecompConstraintSet &modelCore, const DecompConstraintSet &modelRelax, DecompCutList &newCuts)
 
virtual decompStat APPsolveRelaxed (const int whichModel, const double *redCostX, const double *origCost, const double alpha, const int n_origCols, const bool checkRC, const bool checkDup, OsiSolverInterface *m_subprobSI, list< DecompVar * > &vars)
 
virtual void printOriginalSolution (const int n_cols, const double *solution, ostream *os=&cout) const
 
 DecompApp (UtilParameters &utilParam)
 
virtual ~DecompApp ()
 
void preprocess ()
 Preprocess (standard ): on the TODO list. More...
 
void startupLog ()
 Print startup message to log. More...
 
int createModel ()
 Preprocess (standard ): on the TODO list. More...
 
const double getBestKnownLB () const
 Preprocess (standard ): on the TODO list. More...
 
const double getBestKnownUB () const
 Preprocess (standard ): on the TODO list. More...
 
void setBestKnownLB (const double bestKnownLB)
 Preprocess (standard ): on the TODO list. More...
 
void setBestKnownUB (const double bestKnownUB)
 Preprocess (standard ): on the TODO list. More...
 
void setModelObjective (const double *objective, const int length)
 Set the model objective function. More...
 
void setModelCore (DecompConstraintSet *model, const std::string modelName)
 Set the model core constraint matrix. More...
 
void setModelRelax (DecompConstraintSet *model, const std::string modelName="", const int blockId=0)
 Set the model relaxed constraint matrix (for a particular block). More...
 
void setModelRelaxNest (DecompConstraintSet *model, const std::string modelName, const int blockId=0)
 Set the model relaxed (nested) constraint matrix (for a particular block). More...
 
DecompAlgogetDecompAlgo () const
 Get a pointer to the base algorithm class. More...
 
virtual void initDualVector (std::vector< double > &dualVector)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual bool APPisUserFeasible (const double *x, const int numCols, const double tolZero)
 Method to determine if the solution (x) is feasible to the original model. More...
 
virtual int APPheuristics (const double *xhat, const double *origCost, std::vector< DecompSolution * > &xhatIPFeas)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual const double * getDualForGenerateVars (const double *dual)
 This function allows the user to return their own dual vector to be used in the generation of new variables (in the reduced-cost calculation). More...
 
virtual int generateInitVars (DecompVarList &initVars)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual int generateCuts (const double *x, DecompCutList &newCuts)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual void solveRelaxedWhich (std::vector< int > &blocksToSolve, std::map< int, std::vector< double > > &userDualsByBlock)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual DecompSolverStatus solveRelaxedNest (const int whichBlock, const double *redCostX, const double target, DecompVarList &varList)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual void printOriginalColumn (const int index, std::ostream *os=&std::cout) const
 Initialize the dual vector for PhaseII of PC. More...
 
virtual void printOriginalSolution (const int n_cols, const std::vector< std::string > &colNames, const double *solution, std::ostream *os=&std::cout) const
 Initialize the dual vector for PhaseII of PC. More...
 

Private Attributes

const string m_classTag
 Class id tag (for log / debugging). More...
 
MMKP_Param m_appParam
 Application specific parameters. More...
 
MMKP_Instance m_instance
 MMKP problem instance data. More...
 
vector< MMKP_MCKnap * > m_mcknap
 MMKP_MCKnap object for each knapsack row. More...
 
double * m_objective
 The model objective coefficients (original space). More...
 
vector< DecompConstraintSet * > m_models
 The various model constraint systems used for different algos. More...
 
MMKP_MemPool m_auxMemPool
 Auxiliary memory storage. More...
 

Additional Inherited Members

- Public Attributes inherited from DecompApp
int NumBlocks
 Number of Blocks defalut value 0 set by BlockNumInput parameter. More...
 
DecompParam m_param
 Parameters. More...
 
UtilParametersm_utilParam
 
const double * m_objective
 Model data: objective function. More...
 
DecompModel m_modelCore
 Model data: the core model (A'') More...
 
std::map< int, DecompModelm_modelRelax
 Model data: the relaxed model(s) (A') More...
 
std::map< int, std::vector
< DecompModel > > 
m_modelRelaxNest
 Model data: the relaxed (nested) model(s) (A') More...
 
DecompAlgom_decompAlgo
 Pointer to the base algorithmic object. More...
 
CoinMpsIO m_mpsIO
 MPS object for reading instances. More...
 
CoinLpIO m_lpIO
 LP object for reading instances. More...
 
const CoinPackedMatrixm_matrix
 Original constraint matrix for the instance. More...
 
DecompConstraintSetm_modelC
 The model constraint systems used for different algos. More...
 
std::map< int,
DecompConstraintSet * > 
m_modelR
 
std::map< int, std::vector< int > > m_blocks
 Definition of blocks (by rows) More...
 
int m_threadIndex
 serves as an index to track different DecompApp object during Concurrent process, where when m_threadIndex is 0, problem is solved by cutting plance from standalone solver, when it is greater than 0, it is solved by branch-and-price, More...
 
double m_infinity
 The value of infinity. More...
 
DecompModel m_model
 
map< int, DecompConstraintSet * > m_modelCore
 
map< int, DecompConstraintSet * > m_modelRelax
 
- Protected Attributes inherited from DecompApp
std::ostream * m_osLog
 Log file. More...
 
double m_bestKnownLB
 The best known LB/UB for this application (if known, for debugging). More...
 
double m_bestKnownUB
 
ostream * m_osLog
 

Detailed Description

A DecompApp for solving the Multi-Dimensional Mulit-Choice Knapsack Problem (MMKP).

See Also
DecompApp

Definition at line 40 of file MMKP_DecompApp.h.

Constructor & Destructor Documentation

MMKP_DecompApp::MMKP_DecompApp ( UtilParameters utilParam)
inline

Default constructor.

Takes an instance of UtilParameters

Definition at line 109 of file MMKP_DecompApp.h.

References MMKP_Param::dumpSettings(), MMKP_Param::getSettings(), initializeApp(), MMKP_Param::LogLevel, and m_appParam.

virtual MMKP_DecompApp::~MMKP_DecompApp ( )
inlinevirtual

Default constructor.

Takes an instance of UtilParameters

Definition at line 128 of file MMKP_DecompApp.h.

References m_mcknap, m_models, m_objective, UTIL_DELARR, and UtilDeleteVectorPtr().

Member Function Documentation

virtual DecompSolverStatus MMKP_DecompApp::solveRelaxed ( const int  whichBlock,
const double *  redCostX,
const double  convexDual,
DecompVarList varList 
)
virtual

Solve the relaxed problem.

Reimplemented from DecompApp.

virtual void MMKP_DecompApp::printOriginalColumn ( const int  index,
ostream *  os = &cout 
) const
virtual

Print an original column (format for this app).

Reimplemented from DecompApp.

void MMKP_DecompApp::initializeApp ( )
virtual

Initialize application.

Reimplemented from DecompApp.

Referenced by MMKP_DecompApp().

void MMKP_DecompApp::createModels ( )

Initialize application.

void MMKP_DecompApp::createModelPartMCP ( DecompConstraintSet model)

Initialize application.

void MMKP_DecompApp::createModelPartMCKP ( DecompConstraintSet model,
int  whichKnap = 0 
)

Initialize application.

void MMKP_DecompApp::createModelPartMC2KP ( DecompConstraintSet model,
int  whichKnap1,
int  whichKnap2 
)

Initialize application.

void MMKP_DecompApp::createModelPartMCKP ( DecompConstraintSet model,
vector< int > &  whichKnaps 
)

Initialize application.

void MMKP_DecompApp::createModelPartMMKPHalf ( DecompConstraintSet model)

Initialize application.

void MMKP_DecompApp::createModelPartMMKP ( DecompConstraintSet model)

Initialize application.

void MMKP_DecompApp::createModelPartMDKPCompl ( DecompConstraintSet model,
int  whichKnap = 0 
)

Initialize application.

void MMKP_DecompApp::createModelPartMDKP ( DecompConstraintSet model)

Initialize application.

void MMKP_DecompApp::createModelPartMDKPHalf ( DecompConstraintSet model)

Initialize application.

void MMKP_DecompApp::createModelPartMDKP ( DecompConstraintSet model,
vector< int > &  whichKnaps 
)

Initialize application.

Member Data Documentation

const string MMKP_DecompApp::m_classTag
private

Class id tag (for log / debugging).

Definition at line 43 of file MMKP_DecompApp.h.

MMKP_Param MMKP_DecompApp::m_appParam
private

Application specific parameters.

Definition at line 46 of file MMKP_DecompApp.h.

Referenced by MMKP_DecompApp().

MMKP_Instance MMKP_DecompApp::m_instance
private

MMKP problem instance data.

Definition at line 49 of file MMKP_DecompApp.h.

vector<MMKP_MCKnap*> MMKP_DecompApp::m_mcknap
private

MMKP_MCKnap object for each knapsack row.

Definition at line 52 of file MMKP_DecompApp.h.

Referenced by ~MMKP_DecompApp().

double* MMKP_DecompApp::m_objective
private

The model objective coefficients (original space).

Definition at line 55 of file MMKP_DecompApp.h.

Referenced by ~MMKP_DecompApp().

vector<DecompConstraintSet*> MMKP_DecompApp::m_models
private

The various model constraint systems used for different algos.

Definition at line 58 of file MMKP_DecompApp.h.

Referenced by ~MMKP_DecompApp().

MMKP_MemPool MMKP_DecompApp::m_auxMemPool
private

Auxiliary memory storage.

Definition at line 61 of file MMKP_DecompApp.h.


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