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