Blis 0.95.0
Loading...
Searching...
No Matches
BlisModel Class Reference

#include <BlisModel.h>

+ Inheritance diagram for BlisModel:
+ Collaboration diagram for BlisModel:

Public Member Functions

 BlisModel ()
 Default construtor.
 
virtual ~BlisModel ()
 Destructor.
 
void gutsOfDestructor ()
 Actual destructor.
 
void setColMatrix (CoinPackedMatrix *mat)
 Pass a matrix in.
 
void setNumCons (int num)
 Pass column upper bounds.
 
void setNumVars (int num)
 Pass column upper bounds.
 
void setNumElems (int num)
 Pass column upper bounds.
 
void setConLb (double *cl)
 Pass column upper bounds.
 
void setConUb (double *cu)
 Pass column lower bounds.
 
void setVarLb (double *lb)
 Pass variable upper bounds.
 
void setVarUb (double *ub)
 Pass variable lower bounds.
 
void setColType (char *colType)
 Pass variable types.
 
void setObjCoef (double *obj)
 Pass objective coefficients.
 
virtual void readInstance (const char *dataFile)
 For parallel code, only the master calls this function.
 
virtual void importModel (std::vector< BlisVariable * > vars, std::vector< BlisConstraint * > cons)
 For parallel code, only the master calls this function.
 
virtual void readParameters (const int argnum, const char *const *arglist)
 Read in Alps, Blis parameters.
 
virtual void writeParameters (std::ostream &outstream) const
 Write out parameters.
 
virtual AlpsTreeNode * createRoot ()
 For parallel code, only the master calls this function.
 
virtual bool setupSelf ()
 All processes call this function.
 
virtual void preprocess ()
 Preprocessing the model.
 
virtual void postprocess ()
 Postprocessing the searching results.
 
virtual void setSolver (OsiSolverInterface *si)
 Set lp solver.
 
virtual OsiSolverInterface * getSolver ()
 Get lp solver.
 
virtual OsiSolverInterface * solver ()
 Get lp solver.
 
bool resolve ()
 Resolving a lp.
 
void setActiveNode (AlpsTreeNode *node)
 Set active node.
 
void setSolEstimate (double est)
 Set the solution estimate of the active node.
 
int getNumStrong ()
 Get number of strong branchings.
 
void addNumStrong (int num=1)
 Add num to number of strong branchings.
 
int getNumBranchResolve ()
 Get the maximum number of resolve during branching.
 
void setNumBranchResolve (int num)
 Set the maximum number of resolve during branching.
 
double getFeasCheckTime ()
 Get the total time spent checking solutions for feasibility.
 
void setFeasCheckTime (double t)
 Set the total time spent checking solutions for feasibility.
 
void addFeasCheckTime (double t)
 Add to the time spent checking solutions for feasibility.
 
double * getObjCoef () const
 Get objective coefficients.
 
const double * getColLower ()
 Get column lower bound.
 
const double * getColUpper ()
 Get column upper bound.
 
int getNumCols ()
 Get number of columns.
 
int getNumRows ()
 Get number of rows.
 
double * varLB ()
 Get variable bounds arrary.
 
double * varUB ()
 
double * conLB ()
 Get original constraint bounds arrary.
 
double * conUB ()
 
double * startVarLB ()
 The starting variable bounds arrary of a subproblem (internal use).
 
double * startVarUB ()
 
double * startConLB ()
 The starting constraint bounds arrary of a subproblem (internal use).
 
double * startConUB ()
 
int * tempVarLBPos ()
 Temparory storage.
 
int * tempVarUBPos ()
 
int * tempConLBPos ()
 
int * tempConUBPos ()
 
double getLpObjValue () const
 Get current objective function value.
 
const double * getLpSolution () const
 Get active lp solution.
 
int getNumSolutions () const
 Get number of solutions.
 
int getNumHeurSolutions () const
 Get number of heuristic solutions.
 
double * incumbent ()
 Return best ip solution found so far.
 
int storeSolution (BlisSolutionType how, BlisSolution *sol)
 Record a new incumbent solution and update objectiveValue.
 
double getCutoff () const
 Get cut off value.
 
void setCutoff (double co)
 Set cut off value.
 
BlisSolutionfeasibleSolutionHeur (const double *solution)
 Test if a solution found by heuristic is feasible.
 
virtual BlisSolutionfeasibleSolution (int &numIntegerInfs, int &numObjectInfs)
 Test the current LP solution for feasiblility.
 
virtual BlisSolutionuserFeasibleSolution (const double *solution, bool &feasible)
 User's criteria for a feasible solution.
 
Branching Strategys

See the BcpsBranchStrategy class for additional information.

BcpsBranchStrategy * branchStrategy () const
 Get the current branching strategy.
 
void setBranchingMethod (BcpsBranchStrategy *method)
 Set the branching strategy.
 
void setBranchingMethod (BcpsBranchStrategy &method)
 Set the branching stratedy.
 
BcpsBranchStrategy * rampUpBranchStrategy () const
 

Public Attributes

bool isRoot_
 If root node.
 
int boundingPass_
 The number of passes during bounding procedure.
 
double integerTol_
 Integer tolerance.
 
double optimalRelGap_
 Input relative optimal gap.
 
double optimalAbsGap_
 Input absolute optimal gap.
 
double currRelGap_
 Current relative optimal gap.
 
double currAbsGap_
 Current absolute optimal gap.
 
BlisHeurStrategy heurStrategy_
 If use heuristics.
 
int heurCallFrequency_
 Frequency of using heuristics.
 
OsiCuts newCutPool_
 Store new cuts in each pass.
 
std::vector< AlpsTreeNode * > leafToRootPath
 Record the path from leaf to root.
 

Protected Member Functions

void init ()
 Intialize member data.
 
void createObjects ()
 Create variables and constraints.
 

Protected Attributes

OsiSolverInterface * origLpSolver_
 Input by user.
 
OsiSolverInterface * presolvedLpSolver_
 Presolved.
 
OsiSolverInterface * lpSolver_
 Actually used.
 
CoinPackedMatrix * colMatrix_
 Column majored matrix.
 
double * varLB_
 Variable and constraint bounds.
 
double * varUB_
 
double * conLB_
 
double * conUB_
 
int numCols_
 Number of columns/rows/elements.
 
int numRows_
 
int numElems_
 
double objSense_
 Objective function.
 
double * objCoef_
 
int numIntObjects_
 Column types.
 
int * intColIndices_
 
std::vector< BcpsVariable * > inputVar_
 User's input objects.
 
std::vector< BcpsConstraint * > inputCon_
 
BlisPresolvepresolve_
 
bool presolved
 
bool problemSetup
 
int numSolutions_
 
int numHeurSolutions_
 
double incObjValue_
 Incumbent objective value.
 
double * incumbent_
 Incumbent.
 
double cutoff_
 Cutoff in lp solver.
 
double cutoffInc_
 Cutoff increment.
 
int * intObjIndices_
 
char * colType_
 
double * startVarLB_
 Starting var/con bounds for processing each node.
 
double * startVarUB_
 
double * startConLB_
 
double * startConUB_
 
BcpsBranchStrategy * branchStrategy_
 Variable selection function.
 
BcpsBranchStrategy * rampUpBranchStrategy_
 
BlisHotStartStrategy hotstartStrategy_
 
int numObjects_
 Number of objects.
 
BcpsObject ** objects_
 The set of objects.
 
char * sharedObjectMark_
 The objects that can be shared.
 
int * priority_
 Priorities of integer object.
 
AlpsTreeNode * activeNode_
 Active node.
 
int numStrong_
 Number of strong branching.
 
double nodeWeight_
 
int numBranchResolve_
 Maximum number of resolve during branching.
 
int numHeuristics_
 Number of heuristics.
 
BlisHeuristic ** heuristics_
 The list of heuristics.
 
BlisCutStrategy cutStrategy_
 If use cut generators.
 
int cutGenerationFrequency_
 Frequency of cut generation.
 
int numCutGenerators_
 Number of cut generators used.
 
int maxNumCons_
 Number of cuts can be generators.
 
BlisConGenerator ** generators_
 The list of cut generators used.
 
BcpsConstraintPool * constraintPool_
 Store all the cuts.
 
BlisConstraint ** oldConstraints_
 Temporary store old cuts at a node when installing a node.
 
int oldConstraintsSize_
 The memory size allocated for oldConstraints_.
 
int numOldConstraints_
 Number of old constraints.
 
double * conRandoms_
 Random keys.
 
int denseConCutoff_
 Dense constraint cutoff.
 
BlisParamsBlisPar_
 Blis parameters.
 
CoinMessageHandler * blisMessageHandler_
 Message handler.
 
CoinMessages blisMessages_
 Blis messages.
 
int numNodes_
 Number of processed nodes.
 
int numIterations_
 Number of lp(Simplex) iterations.
 
int aveIterations_
 Average number of lp iterations to solve a subproblem.
 
double feasCheckTime_
 Time spent checking feasibility of solutions.
 
int * tempVarLBPos_
 Tempory storage for var/con indices.
 
int * tempVarUBPos_
 
int * tempConLBPos_
 
int * tempConUBPos_
 
BcpsConstraintPool * constraintPoolSend_
 Constraints that can be sent/broadcasted to other processes.
 
BcpsConstraintPool * constraintPoolReceive_
 Constraints that are received from other processses.
 

Object manipulation routines

AlpsReturnStatus encodeBlis (AlpsEncoded *encoded) const
 Pack Blis portion of the model into an encoded object.
 
AlpsReturnStatus decodeBlis (AlpsEncoded &encoded)
 Unpack Blis portion of the model from an encoded object.
 
void packSharedPseudocost (AlpsEncoded *encoded, int numToShare)
 Retrieve and pack shared pseudocost.
 
void unpackSharedPseudocost (AlpsEncoded &encoded)
 Unpack and store shared pseduocost.
 
void packSharedConstraints (AlpsEncoded *encoded)
 Retrieve and pack shared constraints.
 
void unpackSharedConstraints (AlpsEncoded &encoded)
 Unpack and store shared constraints.
 
void packSharedVariables (AlpsEncoded *encoded)
 Retrieve and pack shared variables.
 
void unpackSharedVariables (AlpsEncoded &encoded)
 Unpack and store shared variables.
 
int numObjects () const
 Get the number of objects.
 
void setNumObjects (int num)
 Set the number of objects.
 
BcpsObject ** objects ()
 Get the array of objects.
 
BcpsObject * objects (int which)
 Get the specified object.
 
void setSharedObjectMark (int i)
 Mark object to be shared.
 
void clearSharedObjectMark ()
 Clear all the share mark.
 
void deleteObjects ()
 Delete all object information.
 
void addObjects (int numObjects, BcpsObject **objects)
 Add in object information.
 
void createIntgerObjects (bool startAgain)
 Identify integer variable.
 
int * getIntObjIndices () const
 Get integers' object indices.
 
int getNumIntObjects () const
 Get number of integers.
 
int * getIntColIndices () const
 Get integers' column indices.
 
bool checkInteger (double value) const
 Check if a value is integer.
 
void analyzeObjective ()
 
void addHeuristic (BlisHeuristic *heur)
 Add a heuristic.
 
BlisHeuristicheuristics (int i) const
 Get a specific heuristic.
 
int numHeuristics () const
 Get the number of heuristics.
 
void addCutGenerator (BlisConGenerator *generator)
 Add a Blis cut generator.
 
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.
 
BlisConGeneratorcutGenerators (int i) const
 Get a specific cut generator.
 
int numCutGenerators () const
 Get the number of cut generators.
 
int getMaxNumCons () const
 Get the max number of cuts can be generated.
 
void setMaxNumCons (int m)
 Set the max number of cuts can be generated.
 
BcpsConstraintPool * constraintPool ()
 Access constraint pool.
 
BcpsConstraintPool * constraintPoolReceive ()
 Access receive constraint pool.
 
BcpsConstraintPool * constraintPoolSend ()
 Access send constraint pool.
 
int getNumOldConstraints () const
 Get number of old constraints.
 
void setNumOldConstraints (int num)
 Set number of old constraints.
 
int getOldConstraintsSize () const
 Get max number of old constraints.
 
void setOldConstraintsSize (int num)
 Set max number of old constraints.
 
BlisConstraint ** oldConstraints ()
 Access old constraints.
 
void setOldConstraints (BlisConstraint **old)
 set old constraints.
 
void delOldConstraints ()
 Set max number of old constraints.
 
BlisCutStrategy getCutStrategy () const
 Query constraint generation strategy.
 
void setCutStrategy (BlisCutStrategy u)
 Set constraint generation strategy.
 
int getCutGenerationFrequency () const
 Query constraint generation frequency.
 
void setCutStrategy (int f)
 Set constraint generation frequency.
 
int getDenseConCutoff () const
 Get the thresheld to be considered as a dense constraint.
 
void setDenseConCutoff (int cutoff)
 Set the thresheld to be considered as a dense constraint.
 
double * getConRandoms () const
 Get randoms for check parallel constraints.
 
void passInPriorities (const int *priorities, bool ifNotSimpleIntegers, int defaultValue=1000)
 Pass in branching priorities.
 
const int * priority () const
 Priorities.
 
int priority (int sequence) const
 Returns priority level for an object (or 1000 if no priorities exist)
 
double getNodeWeight () const
 
void setNodeWeight (double nw)
 
virtual void modelLog ()
 Log of specific models.
 
int getNumNodes () const
 Get how many Nodes it took to solve the problem.
 
int getNumIterations () const
 Get how many iterations it took to solve the problem.
 
int getAveIterations () const
 Get the average iterations it took to solve a lp.
 
void addNumNodes (int newNodes=1)
 Increment node count.
 
void addNumIterations (int newIter)
 Increment Iteration count.
 
CoinMessageHandler * blisMessageHandler () const
 Get the message handler.
 
CoinMessages blisMessages ()
 Return messages.
 
BlisParamsBlisPar ()
 Access parameters.
 
virtual void nodeLog (AlpsTreeNode *node, bool force)
 Node log.
 
virtual bool fathomAllNodes ()
 Return true, if all nodes can be fathomed.
 
virtual void registerKnowledge ()
 Register knowledge.
 
virtual AlpsEncoded * encode () const
 The method that encodes the model into an encoded object.
 
virtual void decodeToSelf (AlpsEncoded &)
 The method that decodes the model from an encoded object.
 
virtual AlpsEncoded * packSharedKnowlege ()
 Pack knowledge to be shared with others into an encoded object.
 
virtual void unpackSharedKnowledge (AlpsEncoded &)
 Unpack and store shared knowledge from an encoded object.
 
virtual void presolveForTheWholeTree ()
 

Detailed Description

Definition at line 70 of file BlisModel.h.

Constructor & Destructor Documentation

◆ BlisModel()

BlisModel::BlisModel ( )
inline

Default construtor.

Definition at line 343 of file BlisModel.h.

◆ ~BlisModel()

virtual BlisModel::~BlisModel ( )
virtual

Destructor.

Member Function Documentation

◆ init()

void BlisModel::init ( )
protected

Intialize member data.

◆ createObjects()

void BlisModel::createObjects ( )
protected

Create variables and constraints.

◆ gutsOfDestructor()

void BlisModel::gutsOfDestructor ( )

Actual destructor.

◆ setColMatrix()

void BlisModel::setColMatrix ( CoinPackedMatrix * mat)
inline

Pass a matrix in.

Definition at line 359 of file BlisModel.h.

◆ setNumCons()

void BlisModel::setNumCons ( int num)
inline

Pass column upper bounds.

Definition at line 362 of file BlisModel.h.

◆ setNumVars()

void BlisModel::setNumVars ( int num)
inline

Pass column upper bounds.

Definition at line 365 of file BlisModel.h.

◆ setNumElems()

void BlisModel::setNumElems ( int num)
inline

Pass column upper bounds.

Definition at line 368 of file BlisModel.h.

◆ setConLb()

void BlisModel::setConLb ( double * cl)
inline

Pass column upper bounds.

Definition at line 371 of file BlisModel.h.

◆ setConUb()

void BlisModel::setConUb ( double * cu)
inline

Pass column lower bounds.

Definition at line 374 of file BlisModel.h.

◆ setVarLb()

void BlisModel::setVarLb ( double * lb)
inline

Pass variable upper bounds.

Definition at line 377 of file BlisModel.h.

◆ setVarUb()

void BlisModel::setVarUb ( double * ub)
inline

Pass variable lower bounds.

Definition at line 380 of file BlisModel.h.

◆ setColType()

void BlisModel::setColType ( char * colType)
inline

Pass variable types.

Definition at line 383 of file BlisModel.h.

◆ setObjCoef()

void BlisModel::setObjCoef ( double * obj)
inline

Pass objective coefficients.

Definition at line 388 of file BlisModel.h.

◆ readInstance()

virtual void BlisModel::readInstance ( const char * dataFile)
virtual

For parallel code, only the master calls this function.

1) Read in the instance data 2) Set colMatrix_, varLB_, varUB_, conLB_, conUB numCols_, numRows_ 3) Set objCoef_ and objSense_ 4) Set colType_ ('C', 'I', or 'B') 5) Create variables and constraints 6) Set numCoreVariables_ and numCoreConstraints_

◆ importModel()

virtual void BlisModel::importModel ( std::vector< BlisVariable * > vars,
std::vector< BlisConstraint * > cons )
virtual

For parallel code, only the master calls this function.

Import model from vars and cons. 1) Set colMatrix_, varLB_, varUB_, conLB_, conUB numCols_, numRows_ 2) Set objCoef_ (Assume minimization) 3) Set colType_ ('C', 'I', or 'B') 4) Set variables_ and constraints_ 5) Set numCoreVariables_ and numCoreConstraints_ NOTE: Blis takes over the memory ownship of vars and cons, which means users must NOT free vars or cons.

◆ readParameters()

virtual void BlisModel::readParameters ( const int argnum,
const char *const * arglist )
virtual

Read in Alps, Blis parameters.

◆ writeParameters()

virtual void BlisModel::writeParameters ( std::ostream & outstream) const
virtual

Write out parameters.

◆ createRoot()

virtual AlpsTreeNode * BlisModel::createRoot ( )
virtual

For parallel code, only the master calls this function.

Create the root node based on model.

◆ setupSelf()

virtual bool BlisModel::setupSelf ( )
virtual

All processes call this function.

Do necessary work to make model usable. Return success or not. 1) Set numIntObjects_, intColIndices_, intObjectIndices_ 2) Load problem to LP solver. 3) Create integer objects (must after load to lp since using lp info) 4) Set branch strategy 5) Add heuristics 6) Add Cgl cut generators

◆ preprocess()

virtual void BlisModel::preprocess ( )
virtual

Preprocessing the model.

◆ postprocess()

virtual void BlisModel::postprocess ( )
virtual

Postprocessing the searching results.

◆ setSolver()

virtual void BlisModel::setSolver ( OsiSolverInterface * si)
inlinevirtual

Set lp solver.

Definition at line 444 of file BlisModel.h.

◆ getSolver()

virtual OsiSolverInterface * BlisModel::getSolver ( )
inlinevirtual

Get lp solver.

Definition at line 447 of file BlisModel.h.

◆ solver()

virtual OsiSolverInterface * BlisModel::solver ( )
inlinevirtual

Get lp solver.

Definition at line 450 of file BlisModel.h.

◆ resolve()

bool BlisModel::resolve ( )

Resolving a lp.

◆ setActiveNode()

void BlisModel::setActiveNode ( AlpsTreeNode * node)
inline

Set active node.

Definition at line 456 of file BlisModel.h.

◆ setSolEstimate()

void BlisModel::setSolEstimate ( double est)
inline

Set the solution estimate of the active node.

Definition at line 459 of file BlisModel.h.

◆ getNumStrong()

int BlisModel::getNumStrong ( )
inline

Get number of strong branchings.

Definition at line 462 of file BlisModel.h.

◆ addNumStrong()

void BlisModel::addNumStrong ( int num = 1)
inline

Add num to number of strong branchings.

Definition at line 465 of file BlisModel.h.

◆ getNumBranchResolve()

int BlisModel::getNumBranchResolve ( )
inline

Get the maximum number of resolve during branching.

Definition at line 468 of file BlisModel.h.

◆ setNumBranchResolve()

void BlisModel::setNumBranchResolve ( int num)
inline

Set the maximum number of resolve during branching.

Definition at line 471 of file BlisModel.h.

◆ getFeasCheckTime()

double BlisModel::getFeasCheckTime ( )
inline

Get the total time spent checking solutions for feasibility.

Definition at line 474 of file BlisModel.h.

◆ setFeasCheckTime()

void BlisModel::setFeasCheckTime ( double t)
inline

Set the total time spent checking solutions for feasibility.

Definition at line 477 of file BlisModel.h.

◆ addFeasCheckTime()

void BlisModel::addFeasCheckTime ( double t)
inline

Add to the time spent checking solutions for feasibility.

Definition at line 480 of file BlisModel.h.

◆ getObjCoef()

double * BlisModel::getObjCoef ( ) const
inline

Get objective coefficients.

Definition at line 487 of file BlisModel.h.

◆ getColLower()

const double * BlisModel::getColLower ( )
inline

Get column lower bound.

Definition at line 490 of file BlisModel.h.

◆ getColUpper()

const double * BlisModel::getColUpper ( )
inline

Get column upper bound.

Definition at line 493 of file BlisModel.h.

◆ getNumCols()

int BlisModel::getNumCols ( )
inline

Get number of columns.

Definition at line 496 of file BlisModel.h.

◆ getNumRows()

int BlisModel::getNumRows ( )
inline

Get number of rows.

Definition at line 499 of file BlisModel.h.

◆ varLB()

double * BlisModel::varLB ( )
inline

Get variable bounds arrary.

Definition at line 502 of file BlisModel.h.

◆ varUB()

double * BlisModel::varUB ( )
inline

Definition at line 503 of file BlisModel.h.

◆ conLB()

double * BlisModel::conLB ( )
inline

Get original constraint bounds arrary.

Definition at line 506 of file BlisModel.h.

◆ conUB()

double * BlisModel::conUB ( )
inline

Definition at line 507 of file BlisModel.h.

◆ startVarLB()

double * BlisModel::startVarLB ( )
inline

The starting variable bounds arrary of a subproblem (internal use).

Definition at line 510 of file BlisModel.h.

◆ startVarUB()

double * BlisModel::startVarUB ( )
inline

Definition at line 511 of file BlisModel.h.

◆ startConLB()

double * BlisModel::startConLB ( )
inline

The starting constraint bounds arrary of a subproblem (internal use).

Definition at line 514 of file BlisModel.h.

◆ startConUB()

double * BlisModel::startConUB ( )
inline

Definition at line 515 of file BlisModel.h.

◆ tempVarLBPos()

int * BlisModel::tempVarLBPos ( )
inline

Temparory storage.

Definition at line 518 of file BlisModel.h.

◆ tempVarUBPos()

int * BlisModel::tempVarUBPos ( )
inline

Definition at line 519 of file BlisModel.h.

◆ tempConLBPos()

int * BlisModel::tempConLBPos ( )
inline

Definition at line 520 of file BlisModel.h.

◆ tempConUBPos()

int * BlisModel::tempConUBPos ( )
inline

Definition at line 521 of file BlisModel.h.

◆ getLpObjValue()

double BlisModel::getLpObjValue ( ) const
inline

Get current objective function value.

Definition at line 528 of file BlisModel.h.

◆ getLpSolution()

const double * BlisModel::getLpSolution ( ) const
inline

Get active lp solution.

Definition at line 531 of file BlisModel.h.

◆ getNumSolutions()

int BlisModel::getNumSolutions ( ) const
inline

Get number of solutions.

Definition at line 538 of file BlisModel.h.

◆ getNumHeurSolutions()

int BlisModel::getNumHeurSolutions ( ) const
inline

Get number of heuristic solutions.

Definition at line 541 of file BlisModel.h.

◆ incumbent()

double * BlisModel::incumbent ( )
inline

Return best ip solution found so far.

Definition at line 544 of file BlisModel.h.

◆ storeSolution()

int BlisModel::storeSolution ( BlisSolutionType how,
BlisSolution * sol )

Record a new incumbent solution and update objectiveValue.

◆ getCutoff()

double BlisModel::getCutoff ( ) const
inline

Get cut off value.

Definition at line 550 of file BlisModel.h.

◆ setCutoff()

void BlisModel::setCutoff ( double co)
inline

Set cut off value.

Definition at line 553 of file BlisModel.h.

◆ feasibleSolutionHeur()

BlisSolution * BlisModel::feasibleSolutionHeur ( const double * solution)

Test if a solution found by heuristic is feasible.

◆ feasibleSolution()

virtual BlisSolution * BlisModel::feasibleSolution ( int & numIntegerInfs,
int & numObjectInfs )
virtual

Test the current LP solution for feasiblility.

Scan all objects for indications of infeasibility. This is broken down into simple integer infeasibility (numIntegerInfs) and all other reports of infeasibility(numObjectInfs).

◆ userFeasibleSolution()

virtual BlisSolution * BlisModel::userFeasibleSolution ( const double * solution,
bool & feasible )
inlinevirtual

User's criteria for a feasible solution.

If user think the given solution is feasible then need 1) set userFeasible to true, and 2) return a non-null solution. If user think the solution is infeasible then need 1) set userFeasible to false, and 2) return a null.

Definition at line 584 of file BlisModel.h.

◆ branchStrategy()

BcpsBranchStrategy * BlisModel::branchStrategy ( ) const
inline

Get the current branching strategy.

Definition at line 600 of file BlisModel.h.

◆ setBranchingMethod() [1/2]

void BlisModel::setBranchingMethod ( BcpsBranchStrategy * method)
inline

Set the branching strategy.

Definition at line 604 of file BlisModel.h.

◆ setBranchingMethod() [2/2]

void BlisModel::setBranchingMethod ( BcpsBranchStrategy & method)
inline

Set the branching stratedy.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 610 of file BlisModel.h.

◆ rampUpBranchStrategy()

BcpsBranchStrategy * BlisModel::rampUpBranchStrategy ( ) const
inline

Definition at line 614 of file BlisModel.h.

◆ numObjects()

int BlisModel::numObjects ( ) const
inline

Get the number of objects.

Definition at line 622 of file BlisModel.h.

◆ setNumObjects()

void BlisModel::setNumObjects ( int num)
inline

Set the number of objects.

Definition at line 625 of file BlisModel.h.

◆ objects() [1/2]

BcpsObject ** BlisModel::objects ( )
inline

Get the array of objects.

Definition at line 628 of file BlisModel.h.

◆ objects() [2/2]

BcpsObject * BlisModel::objects ( int which)
inline

Get the specified object.

Definition at line 631 of file BlisModel.h.

◆ setSharedObjectMark()

void BlisModel::setSharedObjectMark ( int i)
inline

Mark object to be shared.

Definition at line 634 of file BlisModel.h.

◆ clearSharedObjectMark()

void BlisModel::clearSharedObjectMark ( )
inline

Clear all the share mark.

Definition at line 637 of file BlisModel.h.

◆ deleteObjects()

void BlisModel::deleteObjects ( )

Delete all object information.

◆ addObjects()

void BlisModel::addObjects ( int numObjects,
BcpsObject ** objects )

Add in object information.

Objects are cloned; the owner can delete the originals.

◆ createIntgerObjects()

void BlisModel::createIntgerObjects ( bool startAgain)

Identify integer variable.

◆ getIntObjIndices()

int * BlisModel::getIntObjIndices ( ) const
inline

Get integers' object indices.

Definition at line 655 of file BlisModel.h.

◆ getNumIntObjects()

int BlisModel::getNumIntObjects ( ) const
inline

Get number of integers.

Definition at line 658 of file BlisModel.h.

◆ getIntColIndices()

int * BlisModel::getIntColIndices ( ) const
inline

Get integers' column indices.

Definition at line 661 of file BlisModel.h.

◆ checkInteger()

bool BlisModel::checkInteger ( double value) const
inline

Check if a value is integer.

Definition at line 664 of file BlisModel.h.

◆ analyzeObjective()

void BlisModel::analyzeObjective ( )

◆ addHeuristic()

void BlisModel::addHeuristic ( BlisHeuristic * heur)

Add a heuristic.

◆ heuristics()

BlisHeuristic * BlisModel::heuristics ( int i) const
inline

Get a specific heuristic.

Definition at line 685 of file BlisModel.h.

◆ numHeuristics()

int BlisModel::numHeuristics ( ) const
inline

Get the number of heuristics.

Definition at line 688 of file BlisModel.h.

◆ addCutGenerator() [1/2]

void BlisModel::addCutGenerator ( BlisConGenerator * generator)

Add a Blis cut generator.

◆ addCutGenerator() [2/2]

void BlisModel::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.

◆ cutGenerators()

BlisConGenerator * BlisModel::cutGenerators ( int i) const
inline

Get a specific cut generator.

Definition at line 707 of file BlisModel.h.

◆ numCutGenerators()

int BlisModel::numCutGenerators ( ) const
inline

Get the number of cut generators.

Definition at line 710 of file BlisModel.h.

◆ getMaxNumCons()

int BlisModel::getMaxNumCons ( ) const
inline

Get the max number of cuts can be generated.

Definition at line 713 of file BlisModel.h.

◆ setMaxNumCons()

void BlisModel::setMaxNumCons ( int m)
inline

Set the max number of cuts can be generated.

Definition at line 716 of file BlisModel.h.

◆ constraintPool()

BcpsConstraintPool * BlisModel::constraintPool ( )
inline

Access constraint pool.

Definition at line 719 of file BlisModel.h.

◆ constraintPoolReceive()

BcpsConstraintPool * BlisModel::constraintPoolReceive ( )
inline

Access receive constraint pool.

Definition at line 722 of file BlisModel.h.

◆ constraintPoolSend()

BcpsConstraintPool * BlisModel::constraintPoolSend ( )
inline

Access send constraint pool.

Definition at line 726 of file BlisModel.h.

◆ getNumOldConstraints()

int BlisModel::getNumOldConstraints ( ) const
inline

Get number of old constraints.

Definition at line 730 of file BlisModel.h.

◆ setNumOldConstraints()

void BlisModel::setNumOldConstraints ( int num)
inline

Set number of old constraints.

Definition at line 733 of file BlisModel.h.

◆ getOldConstraintsSize()

int BlisModel::getOldConstraintsSize ( ) const
inline

Get max number of old constraints.

Definition at line 736 of file BlisModel.h.

◆ setOldConstraintsSize()

void BlisModel::setOldConstraintsSize ( int num)
inline

Set max number of old constraints.

Definition at line 739 of file BlisModel.h.

◆ oldConstraints()

BlisConstraint ** BlisModel::oldConstraints ( )
inline

Access old constraints.

Definition at line 742 of file BlisModel.h.

◆ setOldConstraints()

void BlisModel::setOldConstraints ( BlisConstraint ** old)
inline

set old constraints.

Definition at line 745 of file BlisModel.h.

◆ delOldConstraints()

void BlisModel::delOldConstraints ( )
inline

Set max number of old constraints.

Definition at line 748 of file BlisModel.h.

◆ getCutStrategy()

BlisCutStrategy BlisModel::getCutStrategy ( ) const
inline

Query constraint generation strategy.

Definition at line 755 of file BlisModel.h.

◆ setCutStrategy() [1/2]

void BlisModel::setCutStrategy ( BlisCutStrategy u)
inline

Set constraint generation strategy.

Definition at line 760 of file BlisModel.h.

◆ getCutGenerationFrequency()

int BlisModel::getCutGenerationFrequency ( ) const
inline

Query constraint generation frequency.

Definition at line 763 of file BlisModel.h.

◆ setCutStrategy() [2/2]

void BlisModel::setCutStrategy ( int f)
inline

Set constraint generation frequency.

Definition at line 766 of file BlisModel.h.

◆ getDenseConCutoff()

int BlisModel::getDenseConCutoff ( ) const
inline

Get the thresheld to be considered as a dense constraint.

Definition at line 769 of file BlisModel.h.

◆ setDenseConCutoff()

void BlisModel::setDenseConCutoff ( int cutoff)
inline

Set the thresheld to be considered as a dense constraint.

Definition at line 772 of file BlisModel.h.

◆ getConRandoms()

double * BlisModel::getConRandoms ( ) const
inline

Get randoms for check parallel constraints.

Definition at line 775 of file BlisModel.h.

◆ passInPriorities()

void BlisModel::passInPriorities ( const int * priorities,
bool ifNotSimpleIntegers,
int defaultValue = 1000 )

Pass in branching priorities.

If ifClique then priorities are on cliques otherwise priorities are on integer variables.
Other type (if exists set to default) 1 is highest priority. (well actually -INT_MAX is but that's ugly) If hotstart > 0 then branches are created to force the variable to the value given by best solution. This enables a sort of hot start. The node choice should be greatest depth and hotstart should normally be switched off after a solution.

If ifNotSimpleIntegers true then appended to normal integers

◆ priority() [1/2]

const int * BlisModel::priority ( ) const
inline

Priorities.

Definition at line 800 of file BlisModel.h.

◆ priority() [2/2]

int BlisModel::priority ( int sequence) const
inline

Returns priority level for an object (or 1000 if no priorities exist)

Definition at line 803 of file BlisModel.h.

◆ getNodeWeight()

double BlisModel::getNodeWeight ( ) const
inline

Definition at line 808 of file BlisModel.h.

◆ setNodeWeight()

void BlisModel::setNodeWeight ( double nw)
inline

Definition at line 810 of file BlisModel.h.

◆ modelLog()

virtual void BlisModel::modelLog ( )
virtual

Log of specific models.

◆ getNumNodes()

int BlisModel::getNumNodes ( ) const
inline

Get how many Nodes it took to solve the problem.

Definition at line 821 of file BlisModel.h.

◆ getNumIterations()

int BlisModel::getNumIterations ( ) const
inline

Get how many iterations it took to solve the problem.

Definition at line 824 of file BlisModel.h.

◆ getAveIterations()

int BlisModel::getAveIterations ( ) const
inline

Get the average iterations it took to solve a lp.

Definition at line 827 of file BlisModel.h.

◆ addNumNodes()

void BlisModel::addNumNodes ( int newNodes = 1)
inline

Increment node count.

Definition at line 830 of file BlisModel.h.

◆ addNumIterations()

void BlisModel::addNumIterations ( int newIter)
inline

Increment Iteration count.

Definition at line 833 of file BlisModel.h.

◆ blisMessageHandler()

CoinMessageHandler * BlisModel::blisMessageHandler ( ) const
inline

Get the message handler.

Definition at line 839 of file BlisModel.h.

◆ blisMessages()

CoinMessages BlisModel::blisMessages ( )
inline

Return messages.

Definition at line 843 of file BlisModel.h.

◆ BlisPar()

BlisParams * BlisModel::BlisPar ( )
inline

Access parameters.

Definition at line 847 of file BlisModel.h.

◆ nodeLog()

virtual void BlisModel::nodeLog ( AlpsTreeNode * node,
bool force )
virtual

Node log.

◆ fathomAllNodes()

virtual bool BlisModel::fathomAllNodes ( )
virtual

Return true, if all nodes can be fathomed.

◆ encodeBlis()

AlpsReturnStatus BlisModel::encodeBlis ( AlpsEncoded * encoded) const
protected

Pack Blis portion of the model into an encoded object.

◆ decodeBlis()

AlpsReturnStatus BlisModel::decodeBlis ( AlpsEncoded & encoded)
protected

Unpack Blis portion of the model from an encoded object.

◆ packSharedPseudocost()

void BlisModel::packSharedPseudocost ( AlpsEncoded * encoded,
int numToShare )
protected

Retrieve and pack shared pseudocost.

◆ unpackSharedPseudocost()

void BlisModel::unpackSharedPseudocost ( AlpsEncoded & encoded)
protected

Unpack and store shared pseduocost.

◆ packSharedConstraints()

void BlisModel::packSharedConstraints ( AlpsEncoded * encoded)
protected

Retrieve and pack shared constraints.

◆ unpackSharedConstraints()

void BlisModel::unpackSharedConstraints ( AlpsEncoded & encoded)
protected

Unpack and store shared constraints.

◆ packSharedVariables()

void BlisModel::packSharedVariables ( AlpsEncoded * encoded)
protected

Retrieve and pack shared variables.

◆ unpackSharedVariables()

void BlisModel::unpackSharedVariables ( AlpsEncoded & encoded)
protected

Unpack and store shared variables.

◆ registerKnowledge()

virtual void BlisModel::registerKnowledge ( )
virtual

Register knowledge.

◆ encode()

virtual AlpsEncoded * BlisModel::encode ( ) const
virtual

The method that encodes the model into an encoded object.

◆ decodeToSelf()

virtual void BlisModel::decodeToSelf ( AlpsEncoded & )
virtual

The method that decodes the model from an encoded object.

◆ packSharedKnowlege()

virtual AlpsEncoded * BlisModel::packSharedKnowlege ( )
virtual

Pack knowledge to be shared with others into an encoded object.

Return NULL means that no knowledge can be shared.

◆ unpackSharedKnowledge()

virtual void BlisModel::unpackSharedKnowledge ( AlpsEncoded & )
virtual

Unpack and store shared knowledge from an encoded object.

◆ presolveForTheWholeTree()

virtual void BlisModel::presolveForTheWholeTree ( )
virtual

Member Data Documentation

◆ origLpSolver_

OsiSolverInterface* BlisModel::origLpSolver_
protected

Input by user.

Definition at line 79 of file BlisModel.h.

◆ presolvedLpSolver_

OsiSolverInterface* BlisModel::presolvedLpSolver_
protected

Presolved.

Definition at line 81 of file BlisModel.h.

◆ lpSolver_

OsiSolverInterface* BlisModel::lpSolver_
protected

Actually used.

If using presolve, then it is presolved; otherwise it is the original.

Definition at line 84 of file BlisModel.h.

◆ colMatrix_

CoinPackedMatrix* BlisModel::colMatrix_
protected

Column majored matrix.

(For MPS file, etc.)

Definition at line 91 of file BlisModel.h.

◆ varLB_

double* BlisModel::varLB_
protected

Variable and constraint bounds.

Definition at line 95 of file BlisModel.h.

◆ varUB_

double* BlisModel::varUB_
protected

Definition at line 96 of file BlisModel.h.

◆ conLB_

double* BlisModel::conLB_
protected

Definition at line 97 of file BlisModel.h.

◆ conUB_

double* BlisModel::conUB_
protected

Definition at line 98 of file BlisModel.h.

◆ numCols_

int BlisModel::numCols_
protected

Number of columns/rows/elements.

Definition at line 103 of file BlisModel.h.

◆ numRows_

int BlisModel::numRows_
protected

Definition at line 104 of file BlisModel.h.

◆ numElems_

int BlisModel::numElems_
protected

Definition at line 105 of file BlisModel.h.

◆ objSense_

double BlisModel::objSense_
protected

Objective function.

Definition at line 110 of file BlisModel.h.

◆ objCoef_

double* BlisModel::objCoef_
protected

Definition at line 111 of file BlisModel.h.

◆ numIntObjects_

int BlisModel::numIntObjects_
protected

Column types.

Definition at line 116 of file BlisModel.h.

◆ intColIndices_

int* BlisModel::intColIndices_
protected

Definition at line 117 of file BlisModel.h.

◆ inputVar_

std::vector<BcpsVariable *> BlisModel::inputVar_
protected

User's input objects.

Definition at line 122 of file BlisModel.h.

◆ inputCon_

std::vector<BcpsConstraint *> BlisModel::inputCon_
protected

Definition at line 123 of file BlisModel.h.

◆ presolve_

BlisPresolve* BlisModel::presolve_
protected

Definition at line 130 of file BlisModel.h.

◆ presolved

bool BlisModel::presolved
protected

Definition at line 132 of file BlisModel.h.

◆ problemSetup

bool BlisModel::problemSetup
protected

Definition at line 133 of file BlisModel.h.

◆ numSolutions_

int BlisModel::numSolutions_
protected

Definition at line 140 of file BlisModel.h.

◆ numHeurSolutions_

int BlisModel::numHeurSolutions_
protected

Definition at line 141 of file BlisModel.h.

◆ incObjValue_

double BlisModel::incObjValue_
protected

Incumbent objective value.

Definition at line 144 of file BlisModel.h.

◆ incumbent_

double* BlisModel::incumbent_
protected

Incumbent.

Definition at line 147 of file BlisModel.h.

◆ cutoff_

double BlisModel::cutoff_
protected

Cutoff in lp solver.

Definition at line 150 of file BlisModel.h.

◆ cutoffInc_

double BlisModel::cutoffInc_
protected

Cutoff increment.

Definition at line 153 of file BlisModel.h.

◆ intObjIndices_

int* BlisModel::intObjIndices_
protected

Definition at line 159 of file BlisModel.h.

◆ colType_

char* BlisModel::colType_
protected

Definition at line 160 of file BlisModel.h.

◆ startVarLB_

double* BlisModel::startVarLB_
protected

Starting var/con bounds for processing each node.

Definition at line 164 of file BlisModel.h.

◆ startVarUB_

double* BlisModel::startVarUB_
protected

Definition at line 165 of file BlisModel.h.

◆ startConLB_

double* BlisModel::startConLB_
protected

Definition at line 166 of file BlisModel.h.

◆ startConUB_

double* BlisModel::startConUB_
protected

Definition at line 167 of file BlisModel.h.

◆ branchStrategy_

BcpsBranchStrategy* BlisModel::branchStrategy_
protected

Variable selection function.

Definition at line 171 of file BlisModel.h.

◆ rampUpBranchStrategy_

BcpsBranchStrategy* BlisModel::rampUpBranchStrategy_
protected

Definition at line 172 of file BlisModel.h.

◆ hotstartStrategy_

BlisHotStartStrategy BlisModel::hotstartStrategy_
protected

Definition at line 177 of file BlisModel.h.

◆ numObjects_

int BlisModel::numObjects_
protected

Number of objects.

Definition at line 180 of file BlisModel.h.

◆ objects_

BcpsObject** BlisModel::objects_
protected

The set of objects.

Definition at line 183 of file BlisModel.h.

◆ sharedObjectMark_

char* BlisModel::sharedObjectMark_
protected

The objects that can be shared.

Definition at line 186 of file BlisModel.h.

◆ priority_

int* BlisModel::priority_
protected

Priorities of integer object.

Definition at line 189 of file BlisModel.h.

◆ activeNode_

AlpsTreeNode* BlisModel::activeNode_
protected

Active node.

Definition at line 192 of file BlisModel.h.

◆ numStrong_

int BlisModel::numStrong_
protected

Number of strong branching.

Definition at line 195 of file BlisModel.h.

◆ nodeWeight_

double BlisModel::nodeWeight_
protected

Definition at line 198 of file BlisModel.h.

◆ numBranchResolve_

int BlisModel::numBranchResolve_
protected

Maximum number of resolve during branching.

Definition at line 201 of file BlisModel.h.

◆ numHeuristics_

int BlisModel::numHeuristics_
protected

Number of heuristics.

Definition at line 208 of file BlisModel.h.

◆ heuristics_

BlisHeuristic** BlisModel::heuristics_
protected

The list of heuristics.

Definition at line 211 of file BlisModel.h.

◆ cutStrategy_

BlisCutStrategy BlisModel::cutStrategy_
protected

If use cut generators.

Definition at line 218 of file BlisModel.h.

◆ cutGenerationFrequency_

int BlisModel::cutGenerationFrequency_
protected

Frequency of cut generation.

Definition at line 221 of file BlisModel.h.

◆ numCutGenerators_

int BlisModel::numCutGenerators_
protected

Number of cut generators used.

Definition at line 224 of file BlisModel.h.

◆ maxNumCons_

int BlisModel::maxNumCons_
protected

Number of cuts can be generators.

Definition at line 227 of file BlisModel.h.

◆ generators_

BlisConGenerator** BlisModel::generators_
protected

The list of cut generators used.

Definition at line 230 of file BlisModel.h.

◆ constraintPool_

BcpsConstraintPool* BlisModel::constraintPool_
protected

Store all the cuts.

Definition at line 233 of file BlisModel.h.

◆ oldConstraints_

BlisConstraint** BlisModel::oldConstraints_
protected

Temporary store old cuts at a node when installing a node.

Definition at line 236 of file BlisModel.h.

◆ oldConstraintsSize_

int BlisModel::oldConstraintsSize_
protected

The memory size allocated for oldConstraints_.

Definition at line 239 of file BlisModel.h.

◆ numOldConstraints_

int BlisModel::numOldConstraints_
protected

Number of old constraints.

Definition at line 242 of file BlisModel.h.

◆ conRandoms_

double* BlisModel::conRandoms_
protected

Random keys.

Definition at line 245 of file BlisModel.h.

◆ denseConCutoff_

int BlisModel::denseConCutoff_
protected

Dense constraint cutoff.

Definition at line 248 of file BlisModel.h.

◆ BlisPar_

BlisParams* BlisModel::BlisPar_
protected

Blis parameters.

Definition at line 255 of file BlisModel.h.

◆ blisMessageHandler_

CoinMessageHandler* BlisModel::blisMessageHandler_
protected

Message handler.

Definition at line 258 of file BlisModel.h.

◆ blisMessages_

CoinMessages BlisModel::blisMessages_
protected

Blis messages.

Definition at line 261 of file BlisModel.h.

◆ numNodes_

int BlisModel::numNodes_
protected

Number of processed nodes.

Definition at line 264 of file BlisModel.h.

◆ numIterations_

int BlisModel::numIterations_
protected

Number of lp(Simplex) iterations.

Definition at line 267 of file BlisModel.h.

◆ aveIterations_

int BlisModel::aveIterations_
protected

Average number of lp iterations to solve a subproblem.

Definition at line 270 of file BlisModel.h.

◆ feasCheckTime_

double BlisModel::feasCheckTime_
protected

Time spent checking feasibility of solutions.

Definition at line 273 of file BlisModel.h.

◆ tempVarLBPos_

int* BlisModel::tempVarLBPos_
protected

Tempory storage for var/con indices.

Definition at line 281 of file BlisModel.h.

◆ tempVarUBPos_

int* BlisModel::tempVarUBPos_
protected

Definition at line 282 of file BlisModel.h.

◆ tempConLBPos_

int* BlisModel::tempConLBPos_
protected

Definition at line 283 of file BlisModel.h.

◆ tempConUBPos_

int* BlisModel::tempConUBPos_
protected

Definition at line 284 of file BlisModel.h.

◆ constraintPoolSend_

BcpsConstraintPool* BlisModel::constraintPoolSend_
protected

Constraints that can be sent/broadcasted to other processes.

Definition at line 292 of file BlisModel.h.

◆ constraintPoolReceive_

BcpsConstraintPool* BlisModel::constraintPoolReceive_
protected

Constraints that are received from other processses.

Definition at line 295 of file BlisModel.h.

◆ isRoot_

bool BlisModel::isRoot_

If root node.

Definition at line 300 of file BlisModel.h.

◆ boundingPass_

int BlisModel::boundingPass_

The number of passes during bounding procedure.

Definition at line 303 of file BlisModel.h.

◆ integerTol_

double BlisModel::integerTol_

Integer tolerance.

Definition at line 306 of file BlisModel.h.

◆ optimalRelGap_

double BlisModel::optimalRelGap_

Input relative optimal gap.

Definition at line 309 of file BlisModel.h.

◆ optimalAbsGap_

double BlisModel::optimalAbsGap_

Input absolute optimal gap.

Definition at line 312 of file BlisModel.h.

◆ currRelGap_

double BlisModel::currRelGap_

Current relative optimal gap.

Definition at line 315 of file BlisModel.h.

◆ currAbsGap_

double BlisModel::currAbsGap_

Current absolute optimal gap.

Definition at line 318 of file BlisModel.h.

◆ heurStrategy_

BlisHeurStrategy BlisModel::heurStrategy_

If use heuristics.

Definition at line 321 of file BlisModel.h.

◆ heurCallFrequency_

int BlisModel::heurCallFrequency_

Frequency of using heuristics.

Definition at line 324 of file BlisModel.h.

◆ newCutPool_

OsiCuts BlisModel::newCutPool_

Store new cuts in each pass.

Definition at line 327 of file BlisModel.h.

◆ leafToRootPath

std::vector<AlpsTreeNode *> BlisModel::leafToRootPath

Record the path from leaf to root.

Definition at line 330 of file BlisModel.h.


The documentation for this class was generated from the following file: