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