412 std::vector<BlisConstraint *> cons);
555 std::cout <<
"3. cutoff_ = "<<
cutoff_
556 <<
"; inc = " << inc << std::endl;
573 int & numObjectInfs);
664 double integerTolerance = 1.0e-5;
665 double nearest = floor(value + 0.5);
666 if (fabs(value - nearest) <= integerTolerance) {
698 const char * name = NULL,
700 int cutGenerationFrequency = 1,
702 bool atSolution =
false,
703 bool whenInfeasible =
false);
795 bool ifNotSimpleIntegers,
796 int defaultValue = 1000);
virtual AlpsEncoded * encode() const
void setSolEstimate(double est)
Interface between Blis and Cut Generation Library.
BlisHeuristic * heuristics(int i) const
Get a specific heuristic.
double optimalAbsGap_
Input absolute optimal gap.
void setNodeWeight(double nw)
void delOldConstraints()
Set max number of old constraints.
void createObjects()
Create variables and constraints.
CoinMessageHandler * blisMessageHandler() const
Get the message handler.
int cutGenerationFrequency_
Frequency of cut generation.
virtual OsiSolverInterface * solver()
Get lp solver.
void setDenseConCutoff(int cutoff)
Set the thresheld to be considered as a dense constraint.
virtual OsiSolverInterface * getSolver()
Get lp solver.
const double * getLpSolution() const
Get active lp solution.
void setSolEstimate(double est)
Set the solution estimate of the active node.
virtual AlpsEncoded * encode() const
The method that encodes the model into an encoded object.
int numStrong_
Number of strong branching.
bool checkInteger(double value) const
Check if a value is integer.
virtual AlpsTreeNode * createRoot()
For parallel code, only the master calls this function.
double * incumbent_
Incumbent.
double * getObjCoef() const
Get objective coefficients.
void deleteObjects()
Delete all object information.
virtual bool setupSelf()
All processes call this function.
virtual ~BlisModel()
Destructor.
const int * priority() const
Priorities.
virtual void modelLog()
Log of specific models.
int getMaxNumCons() const
Get the max number of cuts can be generated.
OsiSolverInterface * origLpSolver_
Input by user.
void setNumBranchResolve(int num)
Set the maximum number of resolve during branching.
BlisCutStrategy cutStrategy_
If use cut generators.
int numNodes_
Number of processed nodes.
void setMaxNumCons(int m)
Set the max number of cuts can be generated.
CoinMessageHandler * blisMessageHandler_
Message handler.
BlisConstraint ** oldConstraints_
Temporary store old cuts at a node when installing a node.
int storeSolution(BlisSolutionType how, BlisSolution *sol)
Record a new incumbent solution and update objectiveValue.
void addObjects(int numObjects, BcpsObject **objects)
Add in object information.
double * startVarLB_
Starting var/con bounds for processing each node.
void setActiveNode(AlpsTreeNode *node)
Set active node.
BlisCutStrategy getCutStrategy() const
Query constraint generation strategy.
int boundingPass_
The number of passes during bounding procedure.
void packSharedPseudocost(AlpsEncoded *encoded, int numToShare)
Retrieve and pack shared pseudocost.
void unpackSharedVariables(AlpsEncoded &encoded)
Unpack and store shared variables.
int numObjects() const
Get the number of objects.
int denseConCutoff_
Dense constraint cutoff.
virtual void importModel(std::vector< BlisVariable * > vars, std::vector< BlisConstraint * > cons)
For parallel code, only the master calls this function.
double optimalRelGap_
Input relative optimal gap.
void addNumStrong(int num=1)
Add num to number of strong branchings.
virtual void setSolver(OsiSolverInterface *si)
Set lp solver.
std::vector< AlpsTreeNode * > leafToRootPath
Record the path from leaf to root.
virtual void registerKnowledge()
Register knowledge.
BlisSolution * feasibleSolutionHeur(const double *solution)
Test if a solution found by heuristic is feasible.
BcpsConstraintPool * constraintPoolSend()
Access send constraint pool.
BlisHotStartStrategy hotstartStrategy_
virtual BlisSolution * feasibleSolution(int &numIntegerInfs, int &numObjectInfs)
Test the current LP solution for feasiblility.
CoinPackedMatrix * colMatrix_
Column majored matrix.
int * tempVarLBPos_
Tempory storage for var/con indices.
int numIterations_
Number of lp(Simplex) iterations.
double feasCheckTime_
Time spent checking feasibility of solutions.
void setOldConstraintsSize(int num)
Set max number of old constraints.
BlisHeuristic ** heuristics_
The list of heuristics.
void setNumOldConstraints(int num)
Set number of old constraints.
double * conRandoms_
Random keys.
double getLpObjValue() const
Get current objective function value.
void setCutStrategy(BlisCutStrategy u)
Set constraint generation strategy.
void addNumIterations(int newIter)
Increment Iteration count.
void passInPriorities(const int *priorities, bool ifNotSimpleIntegers, int defaultValue=1000)
Pass in branching priorities.
std::vector< BcpsConstraint * > inputCon_
int getCutGenerationFrequency() const
Query constraint generation frequency.
virtual void writeParameters(std::ostream &outstream) const
Write out parameters.
void clearSharedObjectMark()
Clear all the share mark.
void addCutGenerator(CglCutGenerator *generator, const char *name=NULL, BlisCutStrategy strategy=BlisCutStrategyAuto, int cutGenerationFrequency=1, bool normal=true, bool atSolution=false, bool whenInfeasible=false)
Add a Cgl cut generator.
BlisParams * BlisPar()
Access parameters.
BlisConGenerator * cutGenerators(int i) const
Get a specific cut generator.
int getFeasCheckTime()
Get the total time spent checking solutions for feasibility.
std::vector< BcpsVariable * > inputVar_
User's input objects.
BcpsBranchStrategy * rampUpBranchStrategy() const
void setCutStrategy(int f)
Set constraint generation frequency.
int getNumOldConstraints() const
Get number of old constraints.
int oldConstraintsSize_
The memory size allocated for oldConstraints_.
void setOldConstraints(BlisConstraint **old)
set old constraints.
int getNumStrong()
Get number of strong branchings.
double cutoff_
Cutoff in lp solver.
const double * getColUpper()
Get column upper bound.
OsiSolverInterface * lpSolver_
Actually used.
int getNumIterations() const
Get how many iterations it took to solve the problem.
CoinMessages blisMessages_
Blis messages.
int getAveIterations() const
Get the average iterations it took to solve a lp.
void init()
Intialize member data.
BcpsConstraintPool * constraintPool()
Access constraint pool.
void setCutoff(double co)
Set cut off value.
BcpsObject ** objects_
The set of objects.
void setConLb(double *cl)
Pass column upper bounds.
int * getIntObjIndices() const
Get integers' object indices.
BcpsObject * objects(int which)
Get the specified object.
BcpsBranchStrategy * rampUpBranchStrategy_
double * incumbent()
Return best ip solution found so far.
void unpackSharedPseudocost(AlpsEncoded &encoded)
Unpack and store shared pseduocost.
int priority(int sequence) const
Returns priority level for an object (or 1000 if no priorities exist)
BlisParams * BlisPar_
Blis parameters.
void setNumCons(int num)
Pass column upper bounds.
AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const
Pack Blis portion of the model into an encoded object.
int getOldConstraintsSize() const
Get max number of old constraints.
BcpsConstraintPool * constraintPoolReceive_
Constraints that are received from other processses.
double currRelGap_
Current relative optimal gap.
void setObjCoef(double *obj)
Pass objective coefficients.
BcpsBranchStrategy * branchStrategy() const
Get the current branching strategy.
BcpsBranchStrategy * branchStrategy_
Variable selection function.
int numCols_
Number of columns/rows/elements.
void setColMatrix(CoinPackedMatrix *mat)
Pass a matrix in.
int numCutGenerators() const
Get the number of cut generators.
virtual void readParameters(const int argnum, const char *const *arglist)
Read in Alps, Blis parameters.
double currAbsGap_
Current absolute optimal gap.
int getNumBranchResolve()
Get the maximum number of resolve during branching.
double objSense_
Objective function.
void setSharedObjectMark(int i)
Mark object to be shared.
char * sharedObjectMark_
The objects that can be shared.
int numObjects_
Number of objects.
const double * getColLower()
Get column lower bound.
int numOldConstraints_
Number of old constraints.
void setVarUb(double *ub)
Pass variable lower bounds.
void packSharedVariables(AlpsEncoded *encoded)
Retrieve and pack shared variables.
void setColType(char *colType)
Pass variable types.
BlisConGenerator ** generators_
The list of cut generators used.
BcpsObject ** objects()
Get the array of objects.
int * priority_
Priorities of integer object.
BcpsConstraintPool * constraintPoolReceive()
Access receive constraint pool.
virtual bool fathomAllNodes()
Return true, if all nodes can be fathomed.
void setFeasCheckTime(double t)
Set the total time spent checking solutions for feasibility.
BlisConstraint ** oldConstraints()
Access old constraints.
double * startConLB()
The starting constraint bounds arrary of a subproblem (internal use).
void setNumObjects(int num)
Set the number of objects.
OsiCuts newCutPool_
Store new cuts in each pass.
bool resolve()
Resolving a lp.
int getDenseConCutoff() const
Get the thresheld to be considered as a dense constraint.
double getCutoff() const
Get cut off value.
virtual void presolveForTheWholeTree()
int getNumNodes() const
Get how many Nodes it took to solve the problem.
void addFeasCheckTime(double t)
Add to the time spent checking solutions for feasibility.
int * tempVarLBPos()
Temparory storage.
int getNumRows()
Get number of rows.
int numBranchResolve_
Maximum number of resolve during branching.
bool isRoot_
If root node.
virtual void nodeLog(AlpsTreeNode *node, bool force)
Node log.
void setNumVars(int num)
Pass column upper bounds.
void addHeuristic(BlisHeuristic *heur)
Add a heuristic.
BcpsConstraintPool * constraintPoolSend_
Constraints that can be sent/broadcasted to other processes.
int getNumHeurSolutions() const
Get number of heuristic solutions.
int aveIterations_
Average number of lp iterations to solve a subproblem.
int numHeuristics() const
Get the number of heuristics.
OsiSolverInterface * presolvedLpSolver_
Presolved.
double * varLB()
Get variable bounds arrary.
void setBranchingMethod(BcpsBranchStrategy *method)
Set the branching strategy.
int * getIntColIndices() const
Get integers' column indices.
double incObjValue_
Incumbent objective value.
virtual void unpackSharedKnowledge(AlpsEncoded &)
Unpack and store shared knowledge from an encoded object.
AlpsTreeNode * activeNode_
Active node.
double getNodeWeight() const
void gutsOfDestructor()
Actual destructor.
int getNumSolutions() const
Get number of solutions.
double cutoffInc_
Cutoff increment.
void setNumElems(int num)
Pass column upper bounds.
virtual void postprocess()
Postprocessing the searching results.
int numCutGenerators_
Number of cut generators used.
void setBranchingMethod(BcpsBranchStrategy &method)
Set the branching stratedy.
double integerTol_
Integer tolerance.
AlpsReturnStatus decodeBlis(AlpsEncoded &encoded)
Unpack Blis portion of the model from an encoded object.
int getNumCols()
Get number of columns.
virtual AlpsEncoded * packSharedKnowlege()
Pack knowledge to be shared with others into an encoded object.
void setConUb(double *cu)
Pass column lower bounds.
BlisModel()
Default construtor.
void addNumNodes(int newNodes=1)
Increment node count.
BlisHeurStrategy heurStrategy_
If use heuristics.
double * varLB_
Variable and constraint bounds.
virtual void preprocess()
Preprocessing the model.
int getNumIntObjects() const
Get number of integers.
void packSharedConstraints(AlpsEncoded *encoded)
Retrieve and pack shared constraints.
int numIntObjects_
Column types.
void createIntgerObjects(bool startAgain)
Identify integer variable.
virtual BlisSolution * userFeasibleSolution(const double *solution, bool &feasible)
User's criteria for a feasible solution.
void unpackSharedConstraints(AlpsEncoded &encoded)
Unpack and store shared constraints.
double * conLB()
Get original constraint bounds arrary.
virtual void decodeToSelf(AlpsEncoded &)
The method that decodes the model from an encoded object.
double * getConRandoms() const
Get randoms for check parallel constraints.
int numHeuristics_
Number of heuristics.
int maxNumCons_
Number of cuts can be generators.
void addCutGenerator(BlisConGenerator *generator)
Add a Blis cut generator.
double * startVarLB()
The starting variable bounds arrary of a subproblem (internal use).
int heurCallFrequency_
Frequency of using heuristics.
virtual void readInstance(const char *dataFile)
For parallel code, only the master calls this function.
CoinMessages blisMessages()
Return messages.
void setVarLb(double *lb)
Pass variable upper bounds.
BcpsConstraintPool * constraintPool_
Store all the cuts.
@ cutoffInc
The value added to relaxation value when deciding fathom.
bool entry(const chrParams key) const
A interface to Osi/Coin Presolve.
This class contains the solutions generated by the LP solver (either primal or dual.
virtual const double * getColLower() const=0
virtual const double * getColUpper() const=0
virtual const double * getColSolution() const=0
virtual int getNumRows() const=0
virtual double getObjValue() const=0
virtual bool setDblParam(OsiDblParam key, double value)
virtual int getNumCols() const=0