Cbc  2.10.10
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members
OsiSolverLink Class Reference

This is to allow the user to replace initialSolve and resolve This version changes coefficients. More...

#include <CbcLinked.hpp>

+ Inheritance diagram for OsiSolverLink:
+ Collaboration diagram for OsiSolverLink:

Public Member Functions

Solve methods
virtual void initialSolve ()
 Solve initial LP relaxation. More...
 
virtual void resolve ()
 Resolve an LP relaxation after problem modification. More...
 
virtual int fathom (bool allFixed)
 Problem specific Returns -1 if node fathomed and no solution 0 if did nothing 1 if node fathomed and solution allFixed is true if all LinkedBound variables are fixed. More...
 
double * nonlinearSLP (int numberPasses, double deltaTolerance)
 Solves nonlinear problem from CoinModel using SLP - may be used as crash for other algorithms when number of iterations small. More...
 
double linearizedBAB (CglStored *cut)
 Solve linearized quadratic objective branch and bound. More...
 
double * heuristicSolution (int numberPasses, double deltaTolerance, int mode)
 Solves nonlinear problem from CoinModel using SLP - and then tries to get heuristic solution Returns solution array mode - 0 just get continuous 1 round and try normal bab 2 use defaultBound_ to bound integer variables near current solution. More...
 
int doAOCuts (CglTemporary *cutGen, const double *solution, const double *solution2)
 Do OA cuts. More...
 
Constructors and destructors
 OsiSolverLink ()
 Default Constructor. More...
 
 OsiSolverLink (CoinModel &modelObject)
 This creates from a coinModel object. More...
 
void load (CoinModel &modelObject, bool tightenBounds=false, int logLevel=1)
 
virtual OsiSolverInterface * clone (bool copyData=true) const
 Clone. More...
 
 OsiSolverLink (const OsiSolverLink &)
 Copy constructor. More...
 
OsiSolverLinkoperator= (const OsiSolverLink &rhs)
 Assignment operator. More...
 
virtual ~OsiSolverLink ()
 Destructor. More...
 
Sets and Gets
void addBoundModifier (bool upperBoundAffected, bool useUpperBound, int whichVariable, int whichVariableAffected, double multiplier=1.0)
 Add a bound modifier. More...
 
int updateCoefficients (ClpSimplex *solver, CoinPackedMatrix *matrix)
 Update coefficients - returns number updated if in updating mode. More...
 
void analyzeObjects ()
 Analyze constraints to see which are convex (quadratic) More...
 
void addTighterConstraints ()
 Add reformulated bilinear constraints. More...
 
double bestObjectiveValue () const
 Objective value of best solution found internally. More...
 
void setBestObjectiveValue (double value)
 Set objective value of best solution found internally. More...
 
const double * bestSolution () const
 Best solution found internally. More...
 
void setBestSolution (const double *solution, int numberColumns)
 Set best solution found internally. More...
 
void setSpecialOptions2 (int value)
 Set special options. More...
 
void sayConvex (bool convex)
 Say convex (should work it out) - if convex false then strictly concave. More...
 
int specialOptions2 () const
 Get special options. More...
 
CoinPackedMatrix * cleanMatrix () const
 Clean copy of matrix So we can add rows. More...
 
CoinPackedMatrix * originalRowCopy () const
 Row copy of matrix Just genuine columns and rows Linear part. More...
 
ClpSimplex * quadraticModel () const
 Copy of quadratic model if one. More...
 
CoinPackedMatrix * quadraticRow (int rowNumber, double *linear) const
 Gets correct form for a quadratic row - user to delete. More...
 
double defaultMeshSize () const
 Default meshSize. More...
 
void setDefaultMeshSize (double value)
 
double defaultBound () const
 Default maximumbound. More...
 
void setDefaultBound (double value)
 
void setIntegerPriority (int value)
 Set integer priority. More...
 
int integerPriority () const
 Get integer priority. More...
 
int objectiveVariable () const
 Objective transfer variable if one. More...
 
void setBiLinearPriority (int value)
 Set biLinear priority. More...
 
int biLinearPriority () const
 Get biLinear priority. More...
 
const CoinModel * coinModel () const
 Return CoinModel. More...
 
void setBiLinearPriorities (int value, double meshSize=1.0)
 Set all biLinear priorities on x-x variables. More...
 
void setBranchingStrategyOnVariables (int strategyValue, int priorityValue=-1, int mode=7)
 Set options and priority on all or some biLinear variables 1 - on I-I 2 - on I-x 4 - on x-x or combinations. More...
 
void setMeshSizes (double value)
 Set all mesh sizes on x-x variables. More...
 
void setFixedPriority (int priorityValue)
 Two tier integer problem where when set of variables with priority less than this are fixed the problem becomes an easier integer problem. More...
 
- Public Member Functions inherited from CbcOsiSolver
 CbcOsiSolver ()
 Default Constructor. More...
 
 CbcOsiSolver (const CbcOsiSolver &)
 Copy constructor. More...
 
CbcOsiSolveroperator= (const CbcOsiSolver &rhs)
 Assignment operator. More...
 
virtual ~CbcOsiSolver ()
 Destructor. More...
 
void setCbcModel (CbcModel *model)
 Set Cbc Model. More...
 
CbcModelcbcModel () const
 Return Cbc Model. More...
 

Protected Member Functions

functions
void gutsOfDestructor (bool justNullify=false)
 Do real work of initialize. More...
 
void gutsOfCopy (const OsiSolverLink &rhs)
 Do real work of copy. More...
 

Protected Attributes

Private member data
CoinPackedMatrix * matrix_
 Clean copy of matrix Marked coefficients will be multiplied by L or U. More...
 
CoinPackedMatrix * originalRowCopy_
 Row copy of matrix Just genuine columns and rows. More...
 
ClpSimplex * quadraticModel_
 Copy of quadratic model if one. More...
 
int numberNonLinearRows_
 Number of rows with nonLinearities. More...
 
int * startNonLinear_
 Starts of lists. More...
 
int * rowNonLinear_
 Row number for a list. More...
 
int * convex_
 Indicator whether is convex, concave or neither -1 concave, 0 neither, +1 convex. More...
 
int * whichNonLinear_
 Indices in a list/row. More...
 
CoinModel coinModel_
 Model in CoinModel format. More...
 
int numberVariables_
 Number of variables in tightening phase. More...
 
OsiLinkedBoundinfo_
 Information. More...
 
int specialOptions2_
 0 bit (1) - call fathom (may do mini B&B) 1 bit (2) - quadratic only in objective (add OA cuts) 2 bit (4) - convex 3 bit (8) - try adding OA cuts 4 bit (16) - add linearized constraints More...
 
int objectiveRow_
 Objective transfer row if one. More...
 
int objectiveVariable_
 Objective transfer variable if one. More...
 
double bestObjectiveValue_
 Objective value of best solution found internally. More...
 
double defaultMeshSize_
 Default mesh. More...
 
double defaultBound_
 Default maximum bound. More...
 
double * bestSolution_
 Best solution found internally. More...
 
int integerPriority_
 Priority for integers. More...
 
int biLinearPriority_
 Priority for bilinear. More...
 
int numberFix_
 Number of variables which when fixed help. More...
 
int * fixVariables_
 list of fixed variables More...
 
- Protected Attributes inherited from CbcOsiSolver
CbcModelcbcModel_
 Pointer back to CbcModel. More...
 

Detailed Description

This is to allow the user to replace initialSolve and resolve This version changes coefficients.

Definition at line 29 of file CbcLinked.hpp.

Constructor & Destructor Documentation

◆ OsiSolverLink() [1/3]

OsiSolverLink::OsiSolverLink ( )

Default Constructor.

◆ OsiSolverLink() [2/3]

OsiSolverLink::OsiSolverLink ( CoinModel &  modelObject)

This creates from a coinModel object.

if errors.then number of sets is -1

This creates linked ordered sets information. It assumes -

for product terms syntax is yy*f(zz) also just f(zz) is allowed and even a constant

modelObject not const as may be changed as part of process.

◆ OsiSolverLink() [3/3]

OsiSolverLink::OsiSolverLink ( const OsiSolverLink )

Copy constructor.

◆ ~OsiSolverLink()

virtual OsiSolverLink::~OsiSolverLink ( )
virtual

Destructor.

Member Function Documentation

◆ initialSolve()

virtual void OsiSolverLink::initialSolve ( )
virtual

Solve initial LP relaxation.

◆ resolve()

virtual void OsiSolverLink::resolve ( )
virtual

Resolve an LP relaxation after problem modification.

◆ fathom()

virtual int OsiSolverLink::fathom ( bool  allFixed)
virtual

Problem specific Returns -1 if node fathomed and no solution 0 if did nothing 1 if node fathomed and solution allFixed is true if all LinkedBound variables are fixed.

◆ nonlinearSLP()

double* OsiSolverLink::nonlinearSLP ( int  numberPasses,
double  deltaTolerance 
)

Solves nonlinear problem from CoinModel using SLP - may be used as crash for other algorithms when number of iterations small.

Also exits if all problematical variables are changing less than deltaTolerance Returns solution array

◆ linearizedBAB()

double OsiSolverLink::linearizedBAB ( CglStored *  cut)

Solve linearized quadratic objective branch and bound.

Return cutoff and OA cut

◆ heuristicSolution()

double* OsiSolverLink::heuristicSolution ( int  numberPasses,
double  deltaTolerance,
int  mode 
)

Solves nonlinear problem from CoinModel using SLP - and then tries to get heuristic solution Returns solution array mode - 0 just get continuous 1 round and try normal bab 2 use defaultBound_ to bound integer variables near current solution.

◆ doAOCuts()

int OsiSolverLink::doAOCuts ( CglTemporary cutGen,
const double *  solution,
const double *  solution2 
)

Do OA cuts.

◆ load()

void OsiSolverLink::load ( CoinModel &  modelObject,
bool  tightenBounds = false,
int  logLevel = 1 
)

◆ clone()

virtual OsiSolverInterface* OsiSolverLink::clone ( bool  copyData = true) const
virtual

Clone.

Reimplemented from CbcOsiSolver.

◆ operator=()

OsiSolverLink& OsiSolverLink::operator= ( const OsiSolverLink rhs)

Assignment operator.

◆ addBoundModifier()

void OsiSolverLink::addBoundModifier ( bool  upperBoundAffected,
bool  useUpperBound,
int  whichVariable,
int  whichVariableAffected,
double  multiplier = 1.0 
)

Add a bound modifier.

◆ updateCoefficients()

int OsiSolverLink::updateCoefficients ( ClpSimplex *  solver,
CoinPackedMatrix *  matrix 
)

Update coefficients - returns number updated if in updating mode.

◆ analyzeObjects()

void OsiSolverLink::analyzeObjects ( )

Analyze constraints to see which are convex (quadratic)

◆ addTighterConstraints()

void OsiSolverLink::addTighterConstraints ( )

Add reformulated bilinear constraints.

◆ bestObjectiveValue()

double OsiSolverLink::bestObjectiveValue ( ) const
inline

Objective value of best solution found internally.

Definition at line 120 of file CbcLinked.hpp.

◆ setBestObjectiveValue()

void OsiSolverLink::setBestObjectiveValue ( double  value)
inline

Set objective value of best solution found internally.

Definition at line 125 of file CbcLinked.hpp.

◆ bestSolution()

const double* OsiSolverLink::bestSolution ( ) const
inline

Best solution found internally.

Definition at line 130 of file CbcLinked.hpp.

◆ setBestSolution()

void OsiSolverLink::setBestSolution ( const double *  solution,
int  numberColumns 
)

Set best solution found internally.

◆ setSpecialOptions2()

void OsiSolverLink::setSpecialOptions2 ( int  value)
inline

Set special options.

Definition at line 137 of file CbcLinked.hpp.

◆ sayConvex()

void OsiSolverLink::sayConvex ( bool  convex)

Say convex (should work it out) - if convex false then strictly concave.

◆ specialOptions2()

int OsiSolverLink::specialOptions2 ( ) const
inline

Get special options.

Definition at line 144 of file CbcLinked.hpp.

◆ cleanMatrix()

CoinPackedMatrix* OsiSolverLink::cleanMatrix ( ) const
inline

Clean copy of matrix So we can add rows.

Definition at line 151 of file CbcLinked.hpp.

◆ originalRowCopy()

CoinPackedMatrix* OsiSolverLink::originalRowCopy ( ) const
inline

Row copy of matrix Just genuine columns and rows Linear part.

Definition at line 159 of file CbcLinked.hpp.

◆ quadraticModel()

ClpSimplex* OsiSolverLink::quadraticModel ( ) const
inline

Copy of quadratic model if one.

Definition at line 164 of file CbcLinked.hpp.

◆ quadraticRow()

CoinPackedMatrix* OsiSolverLink::quadraticRow ( int  rowNumber,
double *  linear 
) const

Gets correct form for a quadratic row - user to delete.

◆ defaultMeshSize()

double OsiSolverLink::defaultMeshSize ( ) const
inline

Default meshSize.

Definition at line 171 of file CbcLinked.hpp.

◆ setDefaultMeshSize()

void OsiSolverLink::setDefaultMeshSize ( double  value)
inline

Definition at line 175 of file CbcLinked.hpp.

◆ defaultBound()

double OsiSolverLink::defaultBound ( ) const
inline

Default maximumbound.

Definition at line 180 of file CbcLinked.hpp.

◆ setDefaultBound()

void OsiSolverLink::setDefaultBound ( double  value)
inline

Definition at line 184 of file CbcLinked.hpp.

◆ setIntegerPriority()

void OsiSolverLink::setIntegerPriority ( int  value)
inline

Set integer priority.

Definition at line 189 of file CbcLinked.hpp.

◆ integerPriority()

int OsiSolverLink::integerPriority ( ) const
inline

Get integer priority.

Definition at line 194 of file CbcLinked.hpp.

◆ objectiveVariable()

int OsiSolverLink::objectiveVariable ( ) const
inline

Objective transfer variable if one.

Definition at line 199 of file CbcLinked.hpp.

◆ setBiLinearPriority()

void OsiSolverLink::setBiLinearPriority ( int  value)
inline

Set biLinear priority.

Definition at line 204 of file CbcLinked.hpp.

◆ biLinearPriority()

int OsiSolverLink::biLinearPriority ( ) const
inline

Get biLinear priority.

Definition at line 209 of file CbcLinked.hpp.

◆ coinModel()

const CoinModel* OsiSolverLink::coinModel ( ) const
inline

Return CoinModel.

Definition at line 214 of file CbcLinked.hpp.

◆ setBiLinearPriorities()

void OsiSolverLink::setBiLinearPriorities ( int  value,
double  meshSize = 1.0 
)

Set all biLinear priorities on x-x variables.

◆ setBranchingStrategyOnVariables()

void OsiSolverLink::setBranchingStrategyOnVariables ( int  strategyValue,
int  priorityValue = -1,
int  mode = 7 
)

Set options and priority on all or some biLinear variables 1 - on I-I 2 - on I-x 4 - on x-x or combinations.

-1 means leave (for priority value and strategy value)

◆ setMeshSizes()

void OsiSolverLink::setMeshSizes ( double  value)

Set all mesh sizes on x-x variables.

◆ setFixedPriority()

void OsiSolverLink::setFixedPriority ( int  priorityValue)

Two tier integer problem where when set of variables with priority less than this are fixed the problem becomes an easier integer problem.

◆ gutsOfDestructor()

void OsiSolverLink::gutsOfDestructor ( bool  justNullify = false)
protected

Do real work of initialize.

Do real work of delete

◆ gutsOfCopy()

void OsiSolverLink::gutsOfCopy ( const OsiSolverLink rhs)
protected

Do real work of copy.

Member Data Documentation

◆ matrix_

CoinPackedMatrix* OsiSolverLink::matrix_
protected

Clean copy of matrix Marked coefficients will be multiplied by L or U.

Definition at line 255 of file CbcLinked.hpp.

◆ originalRowCopy_

CoinPackedMatrix* OsiSolverLink::originalRowCopy_
protected

Row copy of matrix Just genuine columns and rows.

Definition at line 259 of file CbcLinked.hpp.

◆ quadraticModel_

ClpSimplex* OsiSolverLink::quadraticModel_
protected

Copy of quadratic model if one.

Definition at line 261 of file CbcLinked.hpp.

◆ numberNonLinearRows_

int OsiSolverLink::numberNonLinearRows_
protected

Number of rows with nonLinearities.

Definition at line 263 of file CbcLinked.hpp.

◆ startNonLinear_

int* OsiSolverLink::startNonLinear_
protected

Starts of lists.

Definition at line 265 of file CbcLinked.hpp.

◆ rowNonLinear_

int* OsiSolverLink::rowNonLinear_
protected

Row number for a list.

Definition at line 267 of file CbcLinked.hpp.

◆ convex_

int* OsiSolverLink::convex_
protected

Indicator whether is convex, concave or neither -1 concave, 0 neither, +1 convex.

Definition at line 271 of file CbcLinked.hpp.

◆ whichNonLinear_

int* OsiSolverLink::whichNonLinear_
protected

Indices in a list/row.

Definition at line 273 of file CbcLinked.hpp.

◆ coinModel_

CoinModel OsiSolverLink::coinModel_
protected

Model in CoinModel format.

Definition at line 275 of file CbcLinked.hpp.

◆ numberVariables_

int OsiSolverLink::numberVariables_
protected

Number of variables in tightening phase.

Definition at line 277 of file CbcLinked.hpp.

◆ info_

OsiLinkedBound* OsiSolverLink::info_
protected

Information.

Definition at line 279 of file CbcLinked.hpp.

◆ specialOptions2_

int OsiSolverLink::specialOptions2_
protected

0 bit (1) - call fathom (may do mini B&B) 1 bit (2) - quadratic only in objective (add OA cuts) 2 bit (4) - convex 3 bit (8) - try adding OA cuts 4 bit (16) - add linearized constraints

Definition at line 287 of file CbcLinked.hpp.

◆ objectiveRow_

int OsiSolverLink::objectiveRow_
protected

Objective transfer row if one.

Definition at line 289 of file CbcLinked.hpp.

◆ objectiveVariable_

int OsiSolverLink::objectiveVariable_
protected

Objective transfer variable if one.

Definition at line 291 of file CbcLinked.hpp.

◆ bestObjectiveValue_

double OsiSolverLink::bestObjectiveValue_
protected

Objective value of best solution found internally.

Definition at line 293 of file CbcLinked.hpp.

◆ defaultMeshSize_

double OsiSolverLink::defaultMeshSize_
protected

Default mesh.

Definition at line 295 of file CbcLinked.hpp.

◆ defaultBound_

double OsiSolverLink::defaultBound_
protected

Default maximum bound.

Definition at line 297 of file CbcLinked.hpp.

◆ bestSolution_

double* OsiSolverLink::bestSolution_
protected

Best solution found internally.

Definition at line 299 of file CbcLinked.hpp.

◆ integerPriority_

int OsiSolverLink::integerPriority_
protected

Priority for integers.

Definition at line 301 of file CbcLinked.hpp.

◆ biLinearPriority_

int OsiSolverLink::biLinearPriority_
protected

Priority for bilinear.

Definition at line 303 of file CbcLinked.hpp.

◆ numberFix_

int OsiSolverLink::numberFix_
protected

Number of variables which when fixed help.

Definition at line 305 of file CbcLinked.hpp.

◆ fixVariables_

int* OsiSolverLink::fixVariables_
protected

list of fixed variables

Definition at line 307 of file CbcLinked.hpp.


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