144 #ifdef __DECOMP_IP_SYMPHONY__
145 OsiSymSolverInterface* osi_Sym;
313 const double globalLB = -DecompInf,
314 const double globalUB = DecompInf);
350 const bool resolve =
true,
398 <<
" isTight = " << (
m_relGap <= tightGap)
430 double& mostNegReducedCost);
434 double& mostNegReducedCost);
446 const bool isXSparse =
false,
447 const double feasVarTol = 1.0e-6,
448 const double feasConTol = 1.0e-5,
449 const double intTol = 1.0e-5);
452 const bool isXSparse =
false,
453 const double feasVarTol = 1.0e-6,
454 const double feasConTol = 1.0e-5);
458 const double* origCost,
460 const int n_origCols,
464 std::list<DecompVar*>& vars);
471 copy(varList.begin(), varList.end(), back_inserter(
m_vars));
482 std::vector< std::pair<int, double> >& downBranchUb,
483 std::vector< std::pair<int, double> >& upBranchLb,
484 std::vector< std::pair<int, double> >& upBranchUb);
499 std::string& sectionParam);
530 const double* rowRhs,
536 const double* rowRhs,
547 const std::string baseName,
550 const int pricePass);
553 const std::string baseName,
557 const int blockId = -1,
558 const bool printMps =
true,
559 const bool printLp =
true);
564 const std::string fileName,
565 const bool printMps =
true,
566 const bool printLp =
true);
592 std::vector<std::string>& colNames);
595 std::vector<int >& colInd,
596 std::vector<double >& colVal,
609 std::vector<std::string>& colNames,
636 const double intTol = 1.0e-5);
703 std::map<int, DecompAlgoModel>::iterator mit;
706 return (*mit).second;
796 for (
int i = 0 ; i < nc ; i++ ) {
797 retVal += objCoef[i] * primSol[i];
828 if (nHistorySize > 0) {
869 const double thisBoundUB) {
889 #ifdef UTIL_USE_TIMERS
908 (*
m_osLog) <<
"New Global UB = "
920 objBoundIP = *objBoundLP;
925 #ifdef UTIL_USE_TIMERS
937 const double changePerLimit = 0.1);
942 std::vector<DecompRowType>::iterator vi;
945 if (*vi == rowType) {
std::vector< double > m_origColUB
Store the name of the class (for logging/debugging) - "who am I?".
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)
virtual int adjustColumnsEffCnt()
The main DECOMP process loop for a node.
double thisBoundUB
The recorded continuous upper bound.
DecompAlgoStop m_stopCriteria
Store the name of the class (for logging/debugging) - "who am I?".
std::vector< int > m_masterOnlyCols
Store the name of the class (for logging/debugging) - "who am I?".
virtual void phaseDone()
Run the done phase for processing node.
DecompStats m_stats
Storage of statistics for run and node.
std::map< int, std::vector< DecompAlgoModel > > m_modelRelaxNest
Store the name of the class (for logging/debugging) - "who am I?".
bool m_isColGenExact
Store the name of the class (for logging/debugging) - "who am I?".
const int getNodeIndex() const
Get a ptr to the current solution (in x-space).
const double getNodeIPGap() const
Get the current node (integrality) gap.
virtual int generateVarsFea(DecompVarList &newVars, double &mostNegReducedCost)
std::vector< DecompObjBound > objHistoryBound
Storage of the bounds.
bool checkPointFeasible(const DecompConstraintSet *modelCore, const double *x)
Initial setup of algorithm structures and solver interfaces.
int m_numCols
Store the name of the class (for logging/debugging) - "who am I?".
bool isMasterColArtificial(const int index) const
Initial setup of algorithm structures and solver interfaces.
int m_nRowsOrig
Store the name of the class (for logging/debugging) - "who am I?".
int nodeIndex
The node index (in the branch-and-bound tree).
double m_masterObjLast
Store the name of the class (for logging/debugging) - "who am I?".
DecompApp * getDecompAppMutable()
Get a ptr to the current solution (in x-space).
double thisBoundIP
The recorded integer upper bound.
std::vector< int > m_masterArtCols
Store the name of the class (for logging/debugging) - "who am I?".
DecompAlgo * m_decompAlgo
Pointer to the base algorithmic object.
virtual void postProcessNode(DecompStatus decompStatus)
Do some information sending after the current node has been processed.
virtual void postProcessBranch(DecompStatus decompStatus)
Do some information sending after the current node has been branched.
DecompParam m_param
DIP is distributed under the Eclipse Public License as part of the //.
std::string UtilDblToStr(const double x, const int precision=-1, const double tooBig=UtilSmallerThanTooBig)
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.
double * m_colUBNode
Store the name of the class (for logging/debugging) - "who am I?".
virtual void recomposeSolution(const double *solution, double *rsolution)
Compose solution in x-space from current space.
int m_compressColsLastNumCols
Store the name of the class (for logging/debugging) - "who am I?".
virtual void phaseInit(DecompPhase &phase)
Run the initial phase for processing node.
std::vector< double > m_primSolution
Store the name of the class (for logging/debugging) - "who am I?".
int LogDebugLevel
0: print nothing 1: print the node objective history
const double * m_objective
Store the name of the class (for logging/debugging) - "who am I?".
double UtilCalculateGap(const double boundLB, const double boundUB)
Calculate gap: |(ub-lb)|/|lb|.
void masterPhaseItoII()
Initial setup of algorithm structures and solver interfaces.
DecompAlgoModel & getModelRelax(const int blockId)
Get a ptr to the current solution (in x-space).
OsiSolverInterface * getMasterOSI()
Get a ptr to the current solution (in x-space).
virtual bool updateObjBound(const double mostNegRC=-DecompBigNum)
Calculate the current LB and update best/history.
void masterMatrixAddArtCol(std::vector< CoinBigIndex > &colBeg, std::vector< int > &colInd, std::vector< double > &colVal, char LorG, int rowIndex, int colIndex, DecompColType colType, double &colLB, double &colUB, double &objCoeff)
Initial setup of algorithm structures and solver interfaces.
double m_globalUB
Store the name of the class (for logging/debugging) - "who am I?".
void checkMasterDualObj()
Initial setup of algorithm structures and solver interfaces.
std::vector< double > m_phaseIObj
Store the name of the class (for logging/debugging) - "who am I?".
const DecompApp * getDecompApp() const
Get a ptr to the current solution (in x-space).
void breakOutPartial(const double *xHat, DecompVarList &newVars, const double intTol=1.0e-5)
Initial setup of algorithm structures and solver interfaces.
bool isDualRayInfProofCpx(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.
DecompCutList m_cuts
Containers for cuts (current and pool).
static UtilTimer globalTimer
int m_function
Store the name of the class (for logging/debugging) - "who am I?".
DecompPhase m_phaseLast
Store the name of the class (for logging/debugging) - "who am I?".
void generateVarsAdjustDuals(const double *uOld, double *uNew)
Create an adjusted dual vector with the duals from the convexity constraints removed.
virtual const double * getMasterDualSolution() const
Get current dual solution for master problem.
bool m_isStrongBranch
Store the name of the class (for logging/debugging) - "who am I?".
virtual const double * getObjCoefficients() const =0
Get a pointer to an array[getNumCols()] of objective function coefficients.
bool isMasterColMasterOnly(const int index) const
Initial setup of algorithm structures and solver interfaces.
const DecompSolution * getXhatIPBest() const
Get a ptr to the current solution (in x-space).
An interface to CGL cut generator library.
const double * getXhat() const
Get a ptr to the current solution (in x-space).
virtual void masterMatrixAddArtCols(CoinPackedMatrix *masterM, double *colLB, double *colUB, double *objCoeff, std::vector< std::string > &colNames, int startRow, int endRow, DecompRowType rowType)
Initial setup of algorithm structures and solver interfaces.
DecompAlgoModel m_modelCore
Store the name of the class (for logging/debugging) - "who am I?".
Sparse Matrix Base Class.
double MasterGapLimit
0: print nothing 1: print the node objective history
DecompVarList m_vars
Containers for variables (current and pool).
virtual void adjustMasterDualSolution()
Adjust the current dual solution for master problem.
int m_colIndexUnique
Store the name of the class (for logging/debugging) - "who am I?".
const double * getOrigObjective() const
Get a ptr to the current solution (in x-space).
std::map< int, int > m_masterOnlyColsMap
Map from original index to master index for master-only vars.
void generateVarsCalcRedCost(const double *u, double *redCostX)
Calculated reduced cost vector (over vars in compact space) for a given dual vector.
void initSetup(UtilParameters *utilParam, std::string §ionParam)
Initial setup of algorithm structures and solver interfaces.
DecompStatus m_status
The current algorithm status.
std::vector< double * > getDualRays(int maxNumRays)
const DecompAlgoModel & getModelCore() const
Get a ptr to the current solution (in x-space).
int m_nRowsBranch
Store the name of the class (for logging/debugging) - "who am I?".
double m_globalLB
Store the name of the class (for logging/debugging) - "who am I?".
std::vector< DecompSolution * > m_xhatIPFeas
Store the name of the class (for logging/debugging) - "who am I?".
DecompParam & getMutableParam()
Get a ptr to the current solution (in x-space).
int cutCallsTotal
Number of cut calls in this node in total.
int cutPass
The cut pass when bound was recorded.
#define UTIL_MSG(param, level, x)
const int getStopCriteria() const
Get a ptr to the current solution (in x-space).
virtual void addCutsToPool(const double *x, DecompCutList &newCuts, int &m_cutsThisCall)
void createOsiSubProblem(DecompAlgoModel &algoModel)
Initial setup of algorithm structures and solver interfaces.
int cutsThisCall
Number of cuts generated in this particular cut call.
int m_compressColsLastPrice
Store the name of the class (for logging/debugging) - "who am I?".
const double getObjBestBoundUB() const
Get the current best UB.
void appendVars(DecompVarList &varList)
DecompPhase m_phase
The current algorithm phase.
DecompBranchingImplementation
void loadSIFromModel(OsiSolverInterface *si, bool doInt=false)
Create the master problem (all algorithms must define this function).
const double getObjBestBoundLB() const
Get the current best LB.
bool m_firstPhase2Call
Store the name of the class (for logging/debugging) - "who am I?".
virtual DecompSolverResult * solveDirect(const DecompSolution *startSol=NULL)
Initial setup of algorithm structures and solver interfaces.
int getNumRowType(DecompRowType rowType)
Get a ptr to the current solution (in x-space).
const double * m_objective
Model data: objective function.
const double * getMasterPrimalSolution() const
Get current primal solution for master problem.
UtilParameters * m_utilParam
Store the name of the class (for logging/debugging) - "who am I?".
int m_numConvexCon
Store the name of the class (for logging/debugging) - "who am I?".
void UtilDeleteListPtr(list< T * > &listPtr, typename list< T * >::iterator first, typename list< T * >::iterator last)
double bestBoundIP
The best recorded integer upper bound.
int m_nRowsCuts
Store the name of the class (for logging/debugging) - "who am I?".
DecompMemPool m_memPool
Memory pool used to reduce the number of allocations needed.
bool isMasterColStructural(const int index) const
Initial setup of algorithm structures and solver interfaces.
std::map< int, int > m_artColIndToRowInd
Store the name of the class (for logging/debugging) - "who am I?".
DecompVarPool m_varpool
Store the name of the class (for logging/debugging) - "who am I?".
int phase
The phase when bound was recorded.
const DecompParam & getDecompParam() const
Get a ptr to the current solution (in x-space).
DecompStatus solveRelaxed(const double *redCostX, const double *origCost, const double alpha, const int n_origCols, const bool isNested, DecompAlgoModel &algoModel, DecompSolverResult *solveResult, std::list< DecompVar * > &vars)
std::vector< DecompColType > m_masterColType
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.
int priceCallsTotal
Number of price calls in this node in total.
double bestBound
The best recorded continuous lower bound.
int m_nArtCols
Store the name of the class (for logging/debugging) - "who am I?".
std::map< int, DecompAlgoModel > m_modelRelax
Store the name of the class (for logging/debugging) - "who am I?".
double getMasterObjValue() const
Get a ptr to the current solution (in x-space).
std::pair< double, double > objBest
The global lower (.first) and upper (.second) bound.
void setCutoffUB(const double thisBound)
Get a ptr to the current solution (in x-space).
virtual bool chooseBranchSet(std::vector< std::pair< int, double > > &downBranchLb, std::vector< std::pair< int, double > > &downBranchUb, std::vector< std::pair< int, double > > &upBranchLb, std::vector< std::pair< int, double > > &upBranchUb)
void printBasisInfo(OsiSolverInterface *si, std::ostream *os)
Initial setup of algorithm structures and solver interfaces.
double tempTimeLimit
Store the name of the class (for logging/debugging) - "who am I?".
const double getCutoffUB() const
Get a ptr to the current solution (in x-space).
int pricePass
The price pass when bound was recorded.
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)
const int getPriceCallsTotal() const
Get a ptr to the current solution (in x-space).
double * m_xhat
Storage for current solution (in x-space).
double getRealTime()
Get wallClock time.
OsiClpSolverInterface * m_cutgenSI
Solver interface(s) for entire problem (Q'').
void getModelsFromApp()
Initial setup of algorithm structures and solver interfaces.
const double getMasterRowType(int row) const
Get a specific row type.
const double getNodeLPGap() const
Get the current node (continuous) gap.
DecompStats & getDecompStats()
Get a ptr to the current solution (in x-space).
Abstract Base Class for describing an interface to a solver.
const int getCutCallsTotal() const
Get a ptr to the current solution (in x-space).
virtual int generateVars(const DecompStatus stat, DecompVarList &newVars, double &mostNegReducedCost)
double m_relGap
Current node gap (bestUB-bestLB)/bestLB.
virtual void setMasterBounds(const double *lbs, const double *ubs)
void printCuts(std::ostream *os)
Initial setup of algorithm structures and solver interfaces.
double timeStamp
The time stamp (from start) when bound was recorded.
DecompAlgoType m_algo
Type of algorithm for this instance.
int m_cutgenObjCutInd
Store the name of the class (for logging/debugging) - "who am I?".
double m_cutoffUB
User-defined cutoff (global UB) for B&B fathoming and LR.
bool isLPFeasible(const double *x, const bool isXSparse=false, const double feasVarTol=1.0e-6, const double feasConTol=1.0e-5)
bool isTailoffLB(const int changeLen=10, const double changePerLimit=0.1)
Get a ptr to the current solution (in x-space).
DecompApp * m_app
Pointer to current active DECOMP application.
const AlpsDecompTreeNode * m_curNode
Store the name of the class (for logging/debugging) - "who am I?".
const double getGlobalGap() const
Get the current global (integrality) gap.
const double * getColLBNode() const
Get a ptr to the current solution (in x-space).
Abstract base class for warm start information.
std::vector< double > m_dualSolution
Store the name of the class (for logging/debugging) - "who am I?".
virtual int addCutsFromPool()
void coreMatrixAppendColBounds()
Calculate gap: |(ub-lb)|/|lb|.
OsiSolverInterface * m_auxSI
Store the name of the class (for logging/debugging) - "who am I?".
virtual int compressColumns()
The main DECOMP process loop for a node.
int m_rrLastBlock
Store the name of the class (for logging/debugging) - "who am I?".
virtual DecompStatus processNode(const AlpsDecompTreeNode *node, const double globalLB=-DecompInf, const double globalUB=DecompInf)
The main DECOMP process loop for a node.
DecompBranchingImplementation m_branchingImplementation
Store the name of the class (for logging/debugging) - "who am I?".
const std::vector< DecompSolution * > & getXhatIPFeas() const
Get a ptr to the current solution (in x-space).
DecompNodeStats m_nodeStats
Store the name of the class (for logging/debugging) - "who am I?".
void appendVars(DecompVar *var)
std::string m_classTag
Store the name of the class (for logging/debugging) - "who am I?".
virtual ~DecompAlgo()
Destructor.
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)
virtual void solutionUpdateAsIP()
The main DECOMP process loop for a node.
const void setStrongBranchIter(bool isStrongBranch=true)
Set the object to be in strong branching mode.
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)
void UtilPrintFuncBegin(std::ostream *os, const std::string &classTag, const std::string &funcName, const int logLevel, const int logLimit)
virtual void setSubProbBounds(const double *lbs, const double *ubs)
DecompParam m_param
Parameters.
int m_rrIterSinceAll
Store the name of the class (for logging/debugging) - "who am I?".
void masterPhaseIItoI()
Initial setup of algorithm structures and solver interfaces.
const DecompParam & getParam() const
Get a ptr to the current solution (in x-space).
void masterMatrixAddMOCols(CoinPackedMatrix *masterM, double *colLB, double *colUB, double *objCoeff, std::vector< std::string > &colNames)
Initial setup of algorithm structures and solver interfaces.
int varsThisCall
Number of vars generated in this particular price call.
int m_nRowsConvex
Store the name of the class (for logging/debugging) - "who am I?".
void UtilPrintFuncEnd(std::ostream *os, const std::string &classTag, const std::string &funcName, const int logLevel, const int logLimit)
DecompCutPool m_cutpool
Store the name of the class (for logging/debugging) - "who am I?".
const double * getMasterColReducedCost() const
Get a ptr to the current solution (in x-space).
virtual void setObjBound(const double thisBound, const double thisBoundUB)
Set the current continuous bounds and update best/history.
std::vector< double > m_origColLB
Pointer (and label) to current active model core/relax.
Storage of solver result.
Base class for DECOMP algorithms.
DecompObjBound * getLastBound()
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.
double thisBound
The recorded continuous lower bound.
DecompPhase m_phaseForce
Store the name of the class (for logging/debugging) - "who am I?".
double m_stabEpsilon
Store the name of the class (for logging/debugging) - "who am I?".
std::ostream * m_osLog
Stream for log file (default to stdout).
DecompAlgo(const DecompAlgoType algo, DecompApp *app, UtilParameters *utilParam)
Default constructors.
std::vector< DecompRowType > m_masterRowType
Store the name of the class (for logging/debugging) - "who am I?".
void printCurrentProblemDual(OsiSolverInterface *si, const std::string baseName, const int nodeIndex, const int cutPass, const int pricePass)
Initial setup of algorithm structures and solver interfaces.
double * m_colLBNode
Store the name of the class (for logging/debugging) - "who am I?".
virtual int generateInitVars(DecompVarList &initVars)
Generate initial variables for master problem (PC/DC/RC).
bool m_useInitLpDuals
Store the name of the class (for logging/debugging) - "who am I?".
std::list< DecompVar * > DecompVarList
const AlpsDecompTreeNode * getCurrentNode() const
Provide the current node the algorithm is solving.
void checkBlocksColumns()
Get a ptr to the current solution (in x-space).
const double DecompBigNum
DecompStats & getStats()
Get a ptr to the current solution (in x-space).
virtual void setObjBoundIP(const double thisBound)
Set the current integer bound and update best/history.
const int getAlgo() const
Get a ptr to the current solution (in x-space).
std::vector< double > m_reducedCost
Store the name of the class (for logging/debugging) - "who am I?".
bool m_objNoChange
Store the name of the class (for logging/debugging) - "who am I?".
DecompAlgoCGL * m_cgl
Store the name of the class (for logging/debugging) - "who am I?".
The main application class.
const double * getColUBNode() const
Get a ptr to the current solution (in x-space).
void createFullMps(const std::string fileName)
Initial setup of algorithm structures and solver interfaces.