16#ifndef DECOMP_APP_INCLUDED
17#define DECOMP_APP_INCLUDED
29#if defined (COIN_HAS_METIS)
54 std::string m_classTag;
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);
443 m_classTag (
"D-APP"),
458 m_param.getSettings(utilParam);
461 m_param.dumpSettings();
@ DecompSolStatNoSolution
std::list< DecompVar * > DecompVarList
std::list< DecompCut * > DecompCutList
void UtilDeleteMapPtr(std::map< S, T * > &mapPtr, typename std::map< S, T * >::iterator first, typename std::map< S, T * >::iterator last)
Base class for DECOMP algorithms.
std::map< int, DecompConstraintSet * > m_modelR
DecompAlgo * m_decompAlgo
Pointer to the base algorithmic object.
void setModelObjective(const double *objective, const int length)
Set the model objective function.
void setInfinity()
Set the value of infinity.
void findActiveColumns(const std::vector< int > &rowsPart, std::set< int > &activeColsSet)
Find the active columns for some block.
void readProblem()
Read Problem.
void setModelCore(DecompConstraintSet *model, const std::string modelName)
Set the model core constraint matrix.
void createModelPartSparse(DecompConstraintSet *model, const int nRowsPart, const int *rowsPart)
DecompConstraintSet * m_modelC
The model constraint systems used for different algos.
virtual void solveRelaxedWhich(std::vector< int > &blocksToSolve, std::map< int, std::vector< double > > &userDualsByBlock)
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.
int NumBlocks
Number of Blocks defalut value 0 set by BlockNumInput parameter.
virtual int generateInitVars(DecompVarList &initVars)
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...
DecompParam m_param
Parameters.
void setModelRelaxNest(DecompConstraintSet *model, const std::string modelName, const int blockId=0)
Set the model relaxed (nested) constraint matrix (for a particular block).
virtual int generateCuts(const double *x, DecompCutList &newCuts)
void setBestKnownLB(const double bestKnownLB)
double m_infinity
The value of infinity.
virtual ~DecompApp()
Destructor.
void createModels()
Create model parts.
virtual DecompSolverStatus solveRelaxed(const int whichBlock, const double *redCostX, const double target, DecompVarList &varList)
int m_threadIndex
serves as an index to track different DecompApp object during Concurrent process, where when m_thread...
const double getBestKnownUB() const
void readBlockFile()
Read block file.
const CoinPackedMatrix * getMatrix()
Get constraint matrix for analysis.
const double * m_objective
Model data: objective function.
std::map< int, std::vector< int > > m_blocks
Definition of blocks (by rows)
virtual void initDualVector(std::vector< double > &dualVector)
Initialize the dual vector for PhaseII of PC.
std::map< int, std::vector< DecompModel > > m_modelRelaxNest
Model data: the relaxed (nested) model(s) (A')
virtual void printOriginalColumn(const int index, std::ostream *os=&std::cout) const
virtual void printOriginalSolution(const int n_cols, const std::vector< std::string > &colNames, const double *solution, std::ostream *os=&std::cout) const
virtual int APPheuristics(const double *xhat, const double *origCost, std::vector< DecompSolution * > &xhatIPFeas)
void setModelRelax(DecompConstraintSet *model, const std::string modelName="", const int blockId=0)
Set the model relaxed constraint matrix (for a particular block).
void createModelPart(DecompConstraintSet *model, const int nRowsPart, const int *rowsPart)
virtual DecompSolverStatus solveRelaxedNest(const int whichBlock, const double *redCostX, const double target, DecompVarList &varList)
const std::string getInstanceName()
Get Intance name.
CoinMpsIO m_mpsIO
MPS object for reading instances.
std::map< int, DecompModel > m_modelRelax
Model data: the relaxed model(s) (A')
virtual void initializeApp()
Initialize applications.
CoinLpIO m_lpIO
LP object for reading instances.
DecompApp(UtilParameters &utilParam)
Constructor for base DecompApp class.
const CoinPackedMatrix * m_matrix
Original constraint matrix for the instance.
DecompAlgo * getDecompAlgo() const
Get a pointer to the base algorithm class.
DecompModel m_modelCore
Model data: the core model (A'')
void readInitSolutionFile(DecompVarList &initVars)
void singlyBorderStructureDetection()
Automatically detect singly bordered structure.
double m_bestKnownLB
The best known LB/UB for this application (if known, for debugging).
void startupLog()
Print startup message to log.
void preprocess()
Preprocess (standard ): on the TODO list.
std::ostream * m_osLog
Log file.
void setBestKnownUB(const double bestKnownUB)
UtilParameters * m_utilParam
DecompConstraintSet * createModelPart(const int nRowsPart, const int *rowsPart)
const double getBestKnownLB() const
void prepareModel(double infinity, bool modelIsCore=false)
const bool hasPrepRun() const