13 #ifndef DECOMP_ALGO_INCLUDED
14 #define DECOMP_ALGO_INCLUDED
16 #define EXPLICIT_BOUNDS
78 #ifdef __DECOMP_LP_CLP__
132 void solve(
int whichModel = 1);
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;
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)
vector< DecompSolution * > m_xhatIPFeas
DecompConstraintSet * m_modelCore
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)
DecompConstraintSet * m_modelRelax
void solve(int whichModel=1)
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).
DecompAlgo(const decompAlgoType algo, DecompApp *app)
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.
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)
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
static const char * m_classTag
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