Dip  0.92.4
Public Types | Public Member Functions | Protected Attributes | Private Attributes | List of all members
MAD_DecompApp Class Reference

#include <MAD_DecompApp.h>

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

Public Types

enum  ModelType { MODEL_CLIQUE }
 Model types. More...
 

Public Member Functions

void APPcreateModel (double *&objCoeff, map< int, DecompConstraintSet * > &modelCore, map< int, vector< DecompConstraintSet * > > &modelRelax)
 Create the application model(s). More...
 
DecompStatus APPsolveRelaxed (const int whichModel, const double *redCostX, const double *origCost, const double alpha, const int n_origCols, const bool checkRC, const bool checkDup, bool &isExact, OsiSolverInterface *m_subprobSI, list< DecompVar * > &vars)
 Solve the relaxed problem. More...
 
int APPheuristics (const double *xhat, const double *origCost, vector< DecompSolution * > &xhatIPFeas)
 TODO. More...
 
int generateInitVars (DecompVarList &initVars)
 TODO. More...
 
void printOriginalColumn (const int index, ostream *os=&cout) const
 Print an original column (format for this app). More...
 
void printOriginalSolution (const int n_cols, const double *solution, ostream *os) const
 Print the full original column (format for this app). More...
 
Helper functions (public).
const int xIndex (const int i, const int b) const
 Global index for column x[i,b]. More...
 
pair< int, int > xIndexInv (const int index) const
 Return the indices (i,b) given the index. More...
 
int isOrtho (const int *rowInd1, const int *rowInd2, const int rowLen1, const int rowLen2)
 Are the two vectors orthogonal? More...
 
void initializeApp (UtilParameters &utilParam)
 Guts of constructor. More...
 
int heuristicGreedy (vector< GreedyPoint > &greedyPoints, const MAD_HeurSortDir sortDir, const double *sortValues, const double *origCost, const double *redCost=NULL)
 TODO. More...
 
int heuristicGreedy (const MAD_HeurSortDir sortDir, const double *sortValues, const double *origCost, vector< DecompSolution * > &solVec)
 Global index for column x[i,b]. More...
 
void printRowMarks (const int *rowInd, const int rowLen) const
 Global index for column x[i,b]. More...
 
const int getNOrigRows () const
 Access method for member data. More...
 
const int getBeta () const
 Global index for column x[i,b]. More...
 
const int getKappa () const
 Global index for column x[i,b]. More...
 
Constructor and Destructor
 MAD_DecompApp (UtilParameters &utilParam)
 Default constructor. More...
 
virtual ~MAD_DecompApp ()
 Default constructor. More...
 
- Public Member Functions inherited from DecompApp
virtual void initializeApp ()
 Initialize applications. More...
 
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)
 
 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 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 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 solveRelaxed (const int whichBlock, const double *redCostX, const double target, DecompVarList &varList)
 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...
 

Protected Attributes

MAD_DecompParam m_appParam
 Application specific parameters. More...
 
- 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
 

Private Member Functions

Copy Constructors

Disable the default copy constructors.

 MAD_DecompApp (const MAD_DecompApp &)
 
MAD_DecompAppoperator= (const MAD_DecompApp &)
 

Private Attributes

const string m_classTag
 Class id tag (for log / debugging). More...
 
CoinLpIO m_instance
 MAD problem instance data. More...
 
int m_nOrigRows
 
int m_beta
 
int m_kappa
 
cliquer_tm_cliquer
 Storage for cliquer graph. More...
 
MAD_Qualexm_qualex
 Storage for MAD_Qualex interface. More...
 
graph_tm_conflictGraph
 
MAD_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
 

Detailed Description

A DecompApp for solving the Matrix Decomposition Problem (MAD).

See Also
DecompApp

Definition at line 70 of file MAD_DecompApp.h.

Member Enumeration Documentation

Model types.

Enumerator
MODEL_CLIQUE 

Relaxation is a Maximum Weighted Clique Problem.

Definition at line 102 of file MAD_DecompApp.h.

Constructor & Destructor Documentation

MAD_DecompApp::MAD_DecompApp ( const MAD_DecompApp )
private
MAD_DecompApp::MAD_DecompApp ( UtilParameters utilParam)
inline

Default constructor.

Takes an instance of UtilParameters

Definition at line 210 of file MAD_DecompApp.h.

References DecompApp::initializeApp().

virtual MAD_DecompApp::~MAD_DecompApp ( )
inlinevirtual

Default constructor.

Takes an instance of UtilParameters

Definition at line 225 of file MAD_DecompApp.h.

References graph_free(), m_cliquer, m_conflictGraph, m_qualex, and UTIL_DELPTR.

Member Function Documentation

void MAD_DecompApp::APPcreateModel ( double *&  objCoeff,
map< int, DecompConstraintSet * > &  modelCore,
map< int, vector< DecompConstraintSet * > > &  modelRelax 
)

Create the application model(s).

DecompStatus MAD_DecompApp::APPsolveRelaxed ( const int  whichModel,
const double *  redCostX,
const double *  origCost,
const double  alpha,
const int  n_origCols,
const bool  checkRC,
const bool  checkDup,
bool &  isExact,
OsiSolverInterface m_subprobSI,
list< DecompVar * > &  vars 
)

Solve the relaxed problem.

int MAD_DecompApp::APPheuristics ( const double *  xhat,
const double *  origCost,
vector< DecompSolution * > &  xhatIPFeas 
)
virtual

TODO.

Reimplemented from DecompApp.

int MAD_DecompApp::generateInitVars ( DecompVarList initVars)
virtual

TODO.

Reimplemented from DecompApp.

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

Print an original column (format for this app).

Reimplemented from DecompApp.

void MAD_DecompApp::printOriginalSolution ( const int  n_cols,
const double *  solution,
ostream *  os 
) const
virtual

Print the full original column (format for this app).

Reimplemented from DecompApp.

const int MAD_DecompApp::xIndex ( const int  i,
const int  b 
) const
inline

Global index for column x[i,b].

Definition at line 153 of file MAD_DecompApp.h.

References m_beta.

Referenced by MAD_DecompSolution::print().

pair<int,int> MAD_DecompApp::xIndexInv ( const int  index) const
inline

Return the indices (i,b) given the index.

Definition at line 159 of file MAD_DecompApp.h.

References m_beta.

int MAD_DecompApp::isOrtho ( const int *  rowInd1,
const int *  rowInd2,
const int  rowLen1,
const int  rowLen2 
)

Are the two vectors orthogonal?

void MAD_DecompApp::initializeApp ( UtilParameters utilParam)

Guts of constructor.

int MAD_DecompApp::heuristicGreedy ( vector< GreedyPoint > &  greedyPoints,
const MAD_HeurSortDir  sortDir,
const double *  sortValues,
const double *  origCost,
const double *  redCost = NULL 
)

TODO.

int MAD_DecompApp::heuristicGreedy ( const MAD_HeurSortDir  sortDir,
const double *  sortValues,
const double *  origCost,
vector< DecompSolution * > &  solVec 
)

Global index for column x[i,b].

void MAD_DecompApp::printRowMarks ( const int *  rowInd,
const int  rowLen 
) const

Global index for column x[i,b].

const int MAD_DecompApp::getNOrigRows ( ) const
inline

Access method for member data.

Definition at line 191 of file MAD_DecompApp.h.

References m_nOrigRows.

Referenced by MAD_DecompSolution::print().

const int MAD_DecompApp::getBeta ( ) const
inline

Global index for column x[i,b].

Definition at line 192 of file MAD_DecompApp.h.

References m_beta.

Referenced by MAD_DecompSolution::print().

const int MAD_DecompApp::getKappa ( ) const
inline

Global index for column x[i,b].

Definition at line 193 of file MAD_DecompApp.h.

References m_kappa.

MAD_DecompApp& MAD_DecompApp::operator= ( const MAD_DecompApp )
private

Member Data Documentation

const string MAD_DecompApp::m_classTag
private

Class id tag (for log / debugging).

Definition at line 73 of file MAD_DecompApp.h.

CoinLpIO MAD_DecompApp::m_instance
private

MAD problem instance data.

Definition at line 77 of file MAD_DecompApp.h.

int MAD_DecompApp::m_nOrigRows
private

Definition at line 78 of file MAD_DecompApp.h.

Referenced by getNOrigRows().

int MAD_DecompApp::m_beta
private

Definition at line 79 of file MAD_DecompApp.h.

Referenced by getBeta(), xIndex(), and xIndexInv().

int MAD_DecompApp::m_kappa
private

Definition at line 80 of file MAD_DecompApp.h.

Referenced by getKappa().

cliquer_t* MAD_DecompApp::m_cliquer
private

Storage for cliquer graph.

Definition at line 83 of file MAD_DecompApp.h.

Referenced by ~MAD_DecompApp().

MAD_Qualex* MAD_DecompApp::m_qualex
private

Storage for MAD_Qualex interface.

Definition at line 86 of file MAD_DecompApp.h.

Referenced by ~MAD_DecompApp().

graph_t* MAD_DecompApp::m_conflictGraph
private

Definition at line 90 of file MAD_DecompApp.h.

Referenced by ~MAD_DecompApp().

MAD_MemPool MAD_DecompApp::m_auxMemPool
private

Auxiliary memory storage.

Definition at line 93 of file MAD_DecompApp.h.

MAD_DecompParam MAD_DecompApp::m_appParam
protected

Application specific parameters.

Definition at line 98 of file MAD_DecompApp.h.


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