13 #ifndef DECOMP_ALGO_INCLUDED
14 #define DECOMP_ALGO_INCLUDED
16 #define EXPLICIT_BOUNDS
72 #ifdef __DECOMP_LP_CLP__
142 const double * colLB,
143 const double * colUB,
144 const double * rowRhs,
149 const string baseName,
153 const bool printMps =
true,
154 const bool printLp =
true);
156 const string fileName,
157 const bool printMps =
true,
158 const bool printLp =
true);
177 const double * redCostX,
178 const double * origCost,
180 const int n_origCols,
184 list<DecompVar*> & vars);
199 const int maxInnerIter,
200 const int maxOuterIter);
204 const DecompStat stat);
248 vector<DecompSolution*> & xhatIPFeas);
252 double & mostNegReducedCost);
259 printf(
"\nbase recomposeSolution does nothing.");
273 const double feasTol = 1.0e-4,
274 const double intTol = 1.0e-4);
276 const double feasTol = 1.0e-4);
287 double & branchedOnValue);
288 virtual int branch(
int branchedOnIndex,
289 double branchedOnValue);
291 const double globalLB = -DecompInf,
292 const double globalUB = DecompInf);
301 copy(varList.begin(), varList.end(), back_inserter(
m_vars));
307 m_vars.insert(
m_vars.end(), varList.begin(), varList.end());
345 (*m_osLog).setf(ios::fixed);
349 map<int, OsiSolverInterface*>::iterator it;
std::list< DecompCut * > DecompCutList
virtual void createMasterProblem(DecompVarList &initVars)
Create the master problem (all algorithms must define this function).
virtual void addVarsFromPool()
void UtilDeleteVectorPtr(vector< T * > &vectorPtr, typename vector< T * >::iterator first, typename vector< T * >::iterator last)
DecompAlgo & operator=(const DecompAlgo &)
DecompStats m_stats
Storage of statistics for run and node.
int heuristics(const double *xhat, vector< DecompSolution * > &xhatIPFeas)
virtual DecompStatus processNode(const AlpsDecompTreeNode *node, const double globalLB, const double globalUB)
The main DECOMP process loop for a node.
map< int, OsiSolverInterface * > m_subprobSI
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)
Initial setup of algorithm structures and solver interfaces.
int chooseBranchVar(int &branchedOnIndex, double &branchedOnValue)
void setBestUpperBound(const double bestUpperBound)
virtual void recomposeSolution(const double *solution, double *rsolution)
DecompMemPool m_auxMemPool
virtual int generateVars(DecompVarList &newVars, double &mostNegReducedCost)
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)
DecompAlgo(const DecompAlgoType algo, DecompApp *app)
DecompCutList m_cuts
Containers for cuts (current and pool).
DecompSubModel m_modelCore
Store the name of the class (for logging/debugging) - "who am I?".
Sparse Matrix Base Class.
DecompVarList m_vars
Containers for variables (current and pool).
virtual const double * getRowPrice() const
std::vector< double * > getDualRays(int maxNumRays)
std::vector< DecompSolution * > m_xhatIPFeas
Store the name of the class (for logging/debugging) - "who am I?".
double getTrueUpperBound()
virtual void addCutsToPool(const double *x, DecompCutList &newCuts, int &m_cutsThisCall)
double calcConstant(const int m, const double *u)
void appendVars(DecompVarList &varList)
void setTrueUpperBound(const double ub)
OsiSolverInterface * initSolverInterface()
void tighten(int whichModel)
void UtilDeleteListPtr(list< T * > &listPtr, typename list< T * >::iterator first, typename list< T * >::iterator last)
DecompAlgo(const DecompAlgoType algo, DecompApp *app, UtilParameters &utilParam, bool doSetup=true)
Default constructors.
DecompVarPool m_varpool
Store the name of the class (for logging/debugging) - "who am I?".
void printVars(std::ostream *os)
Initial setup of algorithm structures and solver interfaces.
std::map< int, DecompSubModel > m_modelRelax
Store the name of the class (for logging/debugging) - "who am I?".
void printBasisInfo(OsiSolverInterface *si, std::ostream *os)
Initial setup of algorithm structures and solver interfaces.
static const char * versionTag
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).
virtual void addVarsToPool(DecompVarList &newVars)
double * m_xhat
Storage for current solution (in x-space).
double getTrueLowerBound()
const DecompSolution * getXhatIPBest()
virtual const char * getRowSense() const
Abstract Base Class for describing an interface to a solver.
virtual void setMasterBounds(const double *lbs, const double *ubs)
void printCuts(std::ostream *os)
Initial setup of algorithm structures and solver interfaces.
DecompAlgoType m_algo
Type of algorithm for this instance.
bool isLPFeasible(const double *x, const bool isXSparse=false, const double feasVarTol=1.0e-6, const double feasConTol=1.0e-5)
DecompApp * m_app
Pointer to current active DECOMP application.
virtual int addCutsFromPool()
void appendVars(DecompVar *var)
std::string m_classTag
Store the name of the class (for logging/debugging) - "who am I?".
void setApp(DecompApp *app)
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)
OsiSolverInterface * m_masterSI
Solver interface(s) for subproblems (P').
DecompSolution * m_xhatIPBest
Store the name of the class (for logging/debugging) - "who am I?".
virtual int generateCuts(double *xhat, DecompCutList &newCuts)
virtual const double * getRowPrice() const =0
Get pointer to array[getNumRows()] of dual variable values.
virtual const double * getRightHandSide() const
OsiSolverInterface * getMasterSolverInterface()
DecompCutPool m_cutpool
Store the name of the class (for logging/debugging) - "who am I?".
Base class for DECOMP algorithms.
bool isDualRayInfProof(const double *dualRay, const CoinPackedMatrix *rowMatrix, const double *colLB, const double *colUB, const double *rowRhs, std::ostream *os)
Initial setup of algorithm structures and solver interfaces.
virtual void phaseUpdate(DecompPhase &phase, DecompStatus &status)
Update of the phase for process loop.
std::ostream * m_osLog
Stream for log file (default to stdout).
void setTrueLowerBound(const double mostNegReducedCost)
virtual int generateInitVars(DecompVarList &initVars)
Generate initial variables for master problem (PC/DC/RC).
std::list< DecompVar * > DecompVarList
The main application class.
void createFullMps(const std::string fileName)
Initial setup of algorithm structures and solver interfaces.
virtual int branch(int branchedOnIndex, double branchedOnValue)
void initSetup()
Initial setup of algorithm structures and solver interfaces.
vector< vector< double > > m_optPoint