13 #ifndef DECOMP_ALGO_INCLUDED 14 #define DECOMP_ALGO_INCLUDED 16 #define EXPLICIT_BOUNDS 29 #include "OsiSolverInterface.hpp" 47 static const char* versionTag;
78 #ifdef __DECOMP_LP_CLP__ 81 ClpModel* m_masterCLP;
132 void solve(
int whichModel = 1);
151 const CoinPackedMatrix* rowMatrix,
154 const double* rowRhs,
159 const string baseName,
163 const bool printMps =
true,
164 const bool printLp =
true);
166 const string fileName,
167 const bool printMps =
true,
168 const bool printLp =
true);
187 const double* redCostX,
188 const double* origCost,
190 const int n_origCols,
194 list<DecompVar*> & vars);
209 const int maxInnerIter,
210 const int maxOuterIter);
258 vector<DecompSolution*> & xhatIPFeas);
262 double& mostNegReducedCost);
269 printf(
"\nbase recomposeSolution does nothing.");
285 const double feasTol = 1.0e-4,
286 const double intTol = 1.0e-4);
288 const double feasTol = 1.0e-4);
299 double& branchedOnValue);
300 virtual int branch(
int branchedOnIndex,
301 double branchedOnValue);
311 copy(varList.begin(), varList.end(), back_inserter(
m_vars));
317 m_vars.insert(
m_vars.end(), varList.begin(), varList.end());
356 (*m_osLog).setf(ios::fixed);
360 map<int, OsiSolverInterface*>::iterator it;
virtual DecompStatus processNode(const AlpsDecompTreeNode *node, const double globalLB, const double globalUB)
The main DECOMP process loop for a node.
double getTrueUpperBound()
virtual void setMasterBounds(const double *lbs, const double *ubs)
map< int, OsiSolverInterface * > m_subprobSI
void printVars(std::ostream *os)
virtual int branch(int branchedOnIndex, double branchedOnValue)
std::vector< DecompSolution * > m_xhatIPFeas
void createFullMps(const std::string fileName)
void setApp(DecompApp *app)
DecompStats m_stats
Storage of statistics for run and node.
void appendVars(DecompVarList &varList)
int chooseBranchVar(int &branchedOnIndex, double &branchedOnValue)
virtual void createMasterProblem(DecompVarList &initVars)
Create the master problem (all algorithms must define this function).
DecompApp * m_app
Pointer to current active DECOMP application.
void tighten(int whichModel)
virtual const char * getRowSense() const
virtual void addVarsFromPool()
DecompCutList m_cuts
Containers for cuts (current and pool).
std::list< DecompCut * > DecompCutList
std::list< DecompVar * > DecompVarList
virtual int generateCuts(double *xhat, DecompCutList &newCuts)
void printBasisInfo(OsiSolverInterface *si, std::ostream *os)
DecompAlgo(const DecompAlgoType algo, DecompApp *app, UtilParameters &utilParam, bool doSetup=true)
Default constructors.
std::vector< double * > getDualRays(int maxNumRays)
virtual int generateVars(DecompVarList &newVars, double &mostNegReducedCost)
std::string m_classTag
Store the name of the class (for logging/debugging) - "who am I?".
void solve(int whichModel=1)
void setTrueUpperBound(const double ub)
double calcConstant(const int m, const double *u)
DecompSolution * m_xhatIPBest
virtual DecompStatus solutionUpdate(const DecompPhase phase, const bool resolve=true, const int maxInnerIter=COIN_INT_MAX, const int maxOuterIter=COIN_INT_MAX)
Update of the solution vectors (primal and/or dual).
vector< DecompSolution * > m_xhatIPFeas
double getTrueLowerBound()
DecompStatus solveRelaxed(const double *redCostX, const double *origCost, const double alpha, const int n_origCols, const bool isNested, DecompSubModel &subModel, DecompSolverResult *solveResult, std::list< DecompVar *> &vars, double timeLimit)
double * m_xhat
Storage for current solution (in x-space).
virtual int addCutsFromPool()
void setBestUpperBound(const double bestUpperBound)
virtual void addCutsToPool(const double *x, DecompCutList &newCuts, int &m_cutsThisCall)
DecompVarList m_vars
Containers for variables (current and pool).
DecompMemPool m_auxMemPool
bool isLPFeasible(const double *x, const bool isXSparse=false, const double feasVarTol=1.0e-6, const double feasConTol=1.0e-5)
vector< vector< double > > m_optPoint
OsiSolverInterface * initSolverInterface()
virtual void phaseUpdate(DecompPhase &phase, DecompStatus &status)
Update of the phase for process loop.
void printCuts(std::ostream *os)
void initSetup()
Initial setup of algorithm structures and solver interfaces.
DecompAlgo(const decompAlgoType algo, DecompApp *app)
DecompConstraintSet * m_modelRelax
DecompSubModel m_modelCore
virtual int generateInitVars(DecompVarList &initVars)
Generate initial variables for master problem (PC/DC/RC).
void printCurrentProblem(const OsiSolverInterface *si, const std::string baseName, const int nodeIndex, const int cutPass, const int pricePass, const int blockId=-1, const bool printMps=true, const bool printLp=true)
virtual void addVarsToPool(DecompVarList &newVars)
void setTrueLowerBound(const double mostNegReducedCost)
void UtilDeleteVectorPtr(vector< T *> &vectorPtr, typename vector< T *>::iterator first, typename vector< T *>::iterator last)
const DecompSolution * getXhatIPBest()
void appendVars(DecompVar *var)
bool isIPFeasible(const double *x, const bool isXSparse=false, const double feasVarTol=1.0e-6, const double feasConTol=1.0e-5, const double intTol=1.0e-5)
The main application class.
std::ostream * m_osLog
Stream for log file (default to stdout).
OsiSolverInterface * m_masterSI
Solver interface(s) for subproblems (P').
Base class for DECOMP algorithms.
DecompConstraintSet * m_modelCore
void UtilDeleteListPtr(list< T *> &listPtr, typename list< T *>::iterator first, typename list< T *>::iterator last)
int heuristics(const double *xhat, vector< DecompSolution *> &xhatIPFeas)
DecompAlgoType m_algo
Type of algorithm for this instance.
OsiSolverInterface * getMasterSolverInterface()
virtual const double * getRowPrice() const
virtual const double * getRightHandSide() const
virtual void recomposeSolution(const double *solution, double *rsolution)
bool isDualRayInfProof(const double *dualRay, const CoinPackedMatrix *rowMatrix, const double *colLB, const double *colUB, const double *rowRhs, std::ostream *os)