16 #ifndef DECOMP_APP_INCLUDED 
   17 #define DECOMP_APP_INCLUDED 
   29 #if defined (COIN_HAS_METIS) 
  192       double* obj = 
new double[length];
 
  193       memcpy(obj, objective, length * 
sizeof(
double));
 
  206                             const std::string          modelName) {
 
  242               const std::string    modelName = 
"",
 
  243               const int            blockId   = 0);
 
  250               const std::string    modelName,
 
  251               const int            blockId = 0);
 
  312                                   const double   tolZero) {
 
  317                              const double*             origCost,
 
  318                              std::vector<DecompSolution*>& xhatIPFeas) {
 
  341                   std::vector<double> >& userDualsByBlock) {
 
  345                                            const double*      redCostX,
 
  351                            const double*      redCostX,
 
  359                                     std::ostream*    os = &std::cout) 
const;
 
  364                                       const std::vector<std::string>& colNames,
 
  365                                       const double*          solution,
 
  366                                       std::ostream*          os = &std::cout) 
const;
 
  384                                         const int* rowsPart);
 
  388                         const int*            rowsPart);
 
  392                               const int*            rowsPart);
 
  410                           std::set<int>&           activeColsSet);
 
std::list< DecompCut * > DecompCutList
 
const CoinPackedMatrix * getMatrix()
Get constraint matrix for analysis. 
 
const CoinPackedMatrix * m_matrix
Original constraint matrix for the instance. 
 
void setModelObjective(const double *objective, const int length)
Set the model objective function. 
 
std::map< int, DecompConstraintSet * > m_modelR
 
virtual void solveRelaxedWhich(std::vector< int > &blocksToSolve, std::map< int, std::vector< double > > &userDualsByBlock)
Initialize the dual vector for PhaseII of PC. 
 
void setModelName(const std::string modelName)
 
virtual void initDualVector(std::vector< double > &dualVector)
Initialize the dual vector for PhaseII of PC. 
 
DecompAlgo * m_decompAlgo
Pointer to the base algorithmic object. 
 
const double getBestKnownUB() const 
Preprocess (standard ): on the TODO list. 
 
Class to read and write Lp files. 
 
std::string m_classTag
Store the name of the class (for logging/debugging) - "who am I?". 
 
void setBestKnownLB(const double bestKnownLB)
Preprocess (standard ): on the TODO list. 
 
std::map< int, DecompModel > m_modelRelax
Model data: the relaxed model(s) (A') 
 
void dumpSettings(const std::string &sec, std::ostream *os=&std::cout)
 
virtual void printOriginalColumn(const int index, std::ostream *os=&std::cout) const 
Initialize the dual vector for PhaseII of PC. 
 
DecompApp(UtilParameters &utilParam)
Constructor for base DecompApp class. 
 
void singlyBorderStructureDetection()
Automatically detect singly bordered structure. 
 
void setModelRelaxNest(DecompConstraintSet *model, const std::string modelName, const int blockId=0)
Set the model relaxed (nested) constraint matrix (for a particular block). 
 
Sparse Matrix Base Class. 
 
void setModelCore(DecompConstraintSet *model, const std::string modelName)
Set the model core constraint matrix. 
 
double m_infinity
The value of infinity. 
 
int m_threadIndex
serves as an index to track different DecompApp object during Concurrent process, where when m_thread...
 
void setBestKnownUB(const double bestKnownUB)
Preprocess (standard ): on the TODO list. 
 
void readBlockFile()
Read block file. 
 
int LogLevel
0: print nothing 1: print the node objective history 
 
void preprocess()
Preprocess (standard ): on the TODO list. 
 
const double * m_objective
Model data: objective function. 
 
DecompModel m_modelCore
Model data: the core model (A'') 
 
std::map< int, std::vector< int > > m_blocks
Definition of blocks (by rows) 
 
virtual int generateCuts(const double *x, DecompCutList &newCuts)
Initialize the dual vector for PhaseII of PC. 
 
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. 
 
virtual ~DecompApp()
Destructor. 
 
std::ostream * m_osLog
Log file. 
 
void getSettings(UtilParameters ¶m)
 
void createModelPartSparse(DecompConstraintSet *model, const int nRowsPart, const int *rowsPart)
 
void startupLog()
Print startup message to log. 
 
const std::string getInstanceName()
Get Intance name. 
 
CoinLpIO m_lpIO
LP object for reading instances. 
 
virtual void initializeApp()
Initialize applications. 
 
DecompAlgo * getDecompAlgo() const 
Get a pointer to the base algorithm class. 
 
void setInfinity()
Set the value of infinity. 
 
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 var...
 
virtual int generateInitVars(DecompVarList &initVars)
Initialize the dual vector for PhaseII of PC. 
 
UtilParameters * m_utilParam
 
std::map< int, std::vector< DecompModel > > m_modelRelaxNest
Model data: the relaxed (nested) model(s) (A') 
 
void findActiveColumns(const std::vector< int > &rowsPart, std::set< int > &activeColsSet)
Find the active columns for some block. 
 
double m_bestKnownLB
The best known LB/UB for this application (if known, for debugging). 
 
void setModel(DecompConstraintSet *model)
 
DecompParam m_param
Parameters. 
 
void prepareModel(double infinity, bool modelIsCore=false)
 
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. 
 
int createModel()
Preprocess (standard ): on the TODO list. 
 
virtual int APPheuristics(const double *xhat, const double *origCost, std::vector< DecompSolution * > &xhatIPFeas)
Initialize the dual vector for PhaseII of PC. 
 
virtual DecompSolverStatus solveRelaxedNest(const int whichBlock, const double *redCostX, const double target, DecompVarList &varList)
Initialize the dual vector for PhaseII of PC. 
 
Base class for DECOMP algorithms. 
 
virtual DecompSolverStatus solveRelaxed(const int whichBlock, const double *redCostX, const double target, DecompVarList &varList)
Initialize the dual vector for PhaseII of PC. 
 
void readInitSolutionFile(DecompVarList &initVars)
 
std::string Instance
0: print nothing 1: print the node objective history 
 
CoinMpsIO m_mpsIO
MPS object for reading instances. 
 
void createModels()
Create model parts. 
 
const double getBestKnownLB() const 
Preprocess (standard ): on the TODO list. 
 
const bool hasPrepRun() const 
 
void setModelRelax(DecompConstraintSet *model, const std::string modelName="", const int blockId=0)
Set the model relaxed constraint matrix (for a particular block). 
 
std::list< DecompVar * > DecompVarList
 
void readProblem()
Read Problem. 
 
DecompConstraintSet * createModelPart(const int nRowsPart, const int *rowsPart)
 
void UtilDeleteMapPtr(std::map< S, T * > &mapPtr, typename std::map< S, T * >::iterator first, typename std::map< S, T * >::iterator last)
 
DecompConstraintSet * m_modelC
The model constraint systems used for different algos. 
 
The main application class. 
 
int NumBlocks
Number of Blocks defalut value 0 set by BlockNumInput parameter.