Cbc 2.10.13
Loading...
Searching...
No Matches
CbcIntegerBranchingObject Class Reference

Simple branching object for an integer variable. More...

#include <CbcSimpleInteger.hpp>

Inheritance diagram for CbcIntegerBranchingObject:
Collaboration diagram for CbcIntegerBranchingObject:

Public Member Functions

 CbcIntegerBranchingObject ()
 Default constructor.
 CbcIntegerBranchingObject (CbcModel *model, int variable, int way, double value)
 Create a standard floor/ceiling branch object.
virtual double branch ()
 Create a degenerate branch object.
virtual void fix (OsiSolverInterface *solver, double *lower, double *upper, int branchState) const
 Update bounds in solver as in 'branch' and update given bounds.
virtual bool tighten (OsiSolverInterface *)
 Change (tighten) bounds in object to reflect bounds in solver.
virtual void print ()
 Print something about branch - only if log level high.
*Lower and upper bounds for down branch const double * downBounds () const
*Lower and upper bounds for up branch const double * upBounds () const
*Set lower and upper bounds for down branch void setDownBounds (const double bounds[2])
*Set lower and upper bounds for up branch void setUpBounds (const double bounds[2])
virtual CbcBranchObjType type () const
 Return the type (an integer identifier) of this.
virtual CbcRangeCompare compareBranchingObject (const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
 Compare the this with brObj.
virtual void print () const
 Print something about branch - only if log level high.
Public Member Functions inherited from CbcBranchingObject
 CbcBranchingObject ()
 Default Constructor.
 CbcBranchingObject (CbcModel *model, int variable, int way, double value)
 Constructor.
 CbcBranchingObject (const CbcBranchingObject &)
 Copy constructor.
CbcBranchingObjectoperator= (const CbcBranchingObject &rhs)
 Assignment operator.
virtual CbcBranchingObjectclone () const =0
 Clone.
virtual ~CbcBranchingObject ()
 Destructor.
virtual int fillStrongInfo (CbcStrongInfo &)
 Some branchingObjects may claim to be able to skip strong branching.
void resetNumberBranchesLeft ()
 Reset number of branches left to original.
void setNumberBranches (int value)
 Set number of branches to do.
virtual double branch (OsiSolverInterface *)
 Execute the actions required to branch, as specified by the current state of the branching object, and advance the object's state.
virtual void previousBranch ()
 Reset every information so that the branching object appears to point to the previous child.
int variable () const
 Index identifying the associated CbcObject within its class.
int way () const
 Get the state of the branching object.
void way (int way)
 Set the state of the branching object.
void setModel (CbcModel *model)
 update model
CbcModelmodel () const
 Return model.
CbcObject * object () const
 Return pointer back to object which created.
void setOriginalObject (CbcObject *object)
 Set pointer back to object which created.
virtual int compareOriginalObject (const CbcBranchingObject *brObj) const
 Compare the original object of this with the original object of brObj.

Protected Member Functions

*Lower[0] and upper[1] bounds for the down arm (way_=-1) double down_[2]
*Lower[0] and upper[1] bounds for the up arm (way_=1) double up_[2]

Additional Inherited Members

Protected Attributes inherited from CbcBranchingObject
CbcModelmodel_
 The model that owns this branching object.
CbcObject * originalCbcObject_
 Pointer back to object which created.
int variable_
 Branching variable (0 is first integer).
int way_
 The state of the branching object.

Detailed Description

Simple branching object for an integer variable.

This object can specify a two-way branch on an integer variable. For each arm of the branch, the upper and lower bounds on the variable can be independently specified.

Variable_ holds the index of the integer variable in the integerVariable_ array of the model.

Definition at line 23 of file CbcSimpleInteger.hpp.

Constructor & Destructor Documentation

◆ CbcIntegerBranchingObject() [1/2]

CbcIntegerBranchingObject::CbcIntegerBranchingObject ( )

Default constructor.

◆ CbcIntegerBranchingObject() [2/2]

CbcIntegerBranchingObject::CbcIntegerBranchingObject ( CbcModel * model,
int variable,
int way,
double value )

Create a standard floor/ceiling branch object.

Specifies a simple two-way branch. Let value = x*. One arm of the branch will be lb <= x <= floor(x*), the other ceil(x*) <= x <= ub. Specify way = -1 to set the object state to perform the down arm first, way = 1 for the up arm.

Member Function Documentation

◆ branch()

virtual double CbcIntegerBranchingObject::branch ( )
virtual

Create a degenerate branch object.

Specifies a `one-way branch'. Calling branch() for this object will always result in lowerValue <= x <= upperValue. Used to fix a variable when lowerValue = upperValue. */

CbcIntegerBranchingObject(CbcModel *model, int variable, int way, double lowerValue, double upperValue);

Copy constructor CbcIntegerBranchingObject(const CbcIntegerBranchingObject &);

Assignment operator CbcIntegerBranchingObject &operator=(const CbcIntegerBranchingObject &rhs);

Clone virtual CbcBranchingObject *clone() const;

Destructor virtual ~CbcIntegerBranchingObject();

Does part of constructor void fillPart(int variable, int way, double value); using CbcBranchingObject::branch; /** Sets the bounds for the variable according to the current arm of the branch and advances the object state to the next arm. Returns change in guessed objective on next branch

Implements CbcBranchingObject.

Reimplemented in CbcDynamicPseudoCostBranchingObject, and CbcIntegerPseudoCostBranchingObject.

◆ fix()

virtual void CbcIntegerBranchingObject::fix ( OsiSolverInterface * solver,
double * lower,
double * upper,
int branchState ) const
virtual

Update bounds in solver as in 'branch' and update given bounds.

branchState is -1 for 'down' +1 for 'up'

Reimplemented from CbcBranchingObject.

◆ tighten()

virtual bool CbcIntegerBranchingObject::tighten ( OsiSolverInterface * )
virtual

Change (tighten) bounds in object to reflect bounds in solver.

Return true if now fixed

Reimplemented from CbcBranchingObject.

◆ print() [1/2]

virtual void CbcIntegerBranchingObject::print ( )
virtual

Print something about branch - only if log level high.

◆ downBounds()

*Lower and upper bounds for down branch const double * CbcIntegerBranchingObject::downBounds ( ) const
inline

Definition at line 92 of file CbcSimpleInteger.hpp.

◆ upBounds()

*Lower and upper bounds for up branch const double * CbcIntegerBranchingObject::upBounds ( ) const
inline

Definition at line 97 of file CbcSimpleInteger.hpp.

◆ setDownBounds()

*Set lower and upper bounds for down branch void CbcIntegerBranchingObject::setDownBounds ( const double bounds[2])
inline

Definition at line 102 of file CbcSimpleInteger.hpp.

◆ setUpBounds()

*Set lower and upper bounds for up branch void CbcIntegerBranchingObject::setUpBounds ( const double bounds[2])
inline

Definition at line 107 of file CbcSimpleInteger.hpp.

◆ type()

virtual CbcBranchObjType CbcIntegerBranchingObject::type ( ) const
inlinevirtual

Return the type (an integer identifier) of this.

Implements CbcBranchingObject.

Reimplemented in CbcDynamicPseudoCostBranchingObject, and CbcIntegerPseudoCostBranchingObject.

Definition at line 140 of file CbcSimpleInteger.hpp.

◆ compareBranchingObject()

virtual CbcRangeCompare CbcIntegerBranchingObject::compareBranchingObject ( const CbcBranchingObject * brObj,
const bool replaceIfOverlap = false )
virtual

Compare the this with brObj.

this and brObj must be os the same type and must have the same original object, but they may have different feasible regions. Return the appropriate CbcRangeCompare value (first argument being the sub/superset if that's the case). In case of overlap (and if replaceIfOverlap is true) replace the current branching object with one whose feasible region is the overlap.

Implements CbcBranchingObject.

Reimplemented in CbcIntegerPseudoCostBranchingObject.

◆ arm() [1/2]

*Lower[0] and upper[1] bounds for the down CbcIntegerBranchingObject::arm ( way_ = -1)
protected

◆ arm() [2/2]

*Lower[0] and upper[1] bounds for the up CbcIntegerBranchingObject::arm ( way_ = 1)
protected

◆ print() [2/2]

virtual void CbcBranchingObject::print ( ) const
inlinevirtual

Print something about branch - only if log level high.

Reimplemented from CbcBranchingObject.

Definition at line 132 of file CbcBranchingObject.hpp.


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