# CbcNodeInfo Class Reference

Information required to recreate the subproblem at this node. More...

`#include <CbcNodeInfo.hpp>`

Inheritance diagram for CbcNodeInfo:
[legend]
Collaboration diagram for CbcNodeInfo:
[legend]

List of all members.

## Public Member Functions
virtual void | applyToModel (CbcModel *model, CoinWarmStartBasis *&basis, CbcCountRowCut **addCuts, int &currentNumberCuts) const =0
| Modify model according to information at node.
virtual int | applyBounds (int iColumn, double &lower, double &upper, int force)=0
| Just apply bounds to one variable - force means overwrite by lower,upper (1=>infeasible).
virtual CbcNodeInfo * | buildRowBasis (CoinWarmStartBasis &basis) const =0
| Builds up row basis backwards (until original model).
virtual CbcNodeInfo * | clone () const =0
| Clone.
virtual void | allBranchesGone ()
| Called when number branches left down to zero.
void | increment (int amount=1)
| Increment number of references.
int | decrement (int amount=1)
| Decrement number of references and return number left.
void | initializeInfo (int number)
| Initialize reference counts.
int | numberBranchesLeft () const
| Return number of branches left in object.
void | setNumberBranchesLeft (int value)
| Set number of branches left in object.
int | numberPointingToThis () const
| Return number of objects pointing to this.
void | setNumberPointingToThis (int number)
| Set number of objects pointing to this.
void | incrementNumberPointingToThis ()
| Increment number of objects pointing to this.
int | branchedOn ()
| Say one branch taken.
void | throwAway ()
| Say thrown away.
CbcNodeInfo * | parent () const
| Parent of this.
void | nullParent ()
| Set parent null.
void | addCuts (OsiCuts &cuts, int numberToBranch, int numberPointingToThis)
void | addCuts (int numberCuts, CbcCountRowCut **cuts, int numberToBranch)
void | deleteCuts (int numberToDelete, CbcCountRowCut **cuts)
| Delete cuts (decrements counts) Slow unless cuts in same order as saved.
void | deleteCuts (int numberToDelete, int *which)
void | deleteCut (int whichOne)
| Really delete a cut.
void | decrementCuts (int change=1)
| Decrement active cut counts.
void | incrementCuts (int change=1)
| Increment active cut counts.
void | decrementParentCuts (CbcModel *model, int change=1)
| Decrement all active cut counts in chain starting at parent.
void | incrementParentCuts (CbcModel *model, int change=1)
| Increment all active cut counts in parent chain.
CbcCountRowCut ** | cuts () const
| Array of pointers to cuts.
int | numberCuts () const
| Number of row cuts (this node).
void | setNumberCuts (int value)
void | nullOwner ()
| Set owner null.
const CbcNode * | owner () const
CbcNode * | mutableOwner () const
int | nodeNumber () const
| The node number.
void | setNodeNumber (int node)
void | deactivate (int mode=3)
| Deactivate node information.
bool | allActivated () const
| Say if normal.
bool | marked () const
| Say if marked.
void | mark ()
| Mark.
void | unmark ()
| Unmark.
const OsiBranchingObject * | parentBranch () const
| Branching object for the parent.
void | unsetParentBasedData ()
| If we need to take off parent based data.
Constructors & destructors
| CbcNodeInfo ()
| Default Constructor.
| CbcNodeInfo (const CbcNodeInfo &)
| Copy constructor.
| CbcNodeInfo (CbcNodeInfo *parent, CbcNode *owner)
| Construct with parent and owner.
virtual | ~CbcNodeInfo ()
| Destructor.
## Protected Attributes
int | numberPointingToThis_
| Number of other nodes pointing to this node.
CbcNodeInfo * | parent_
| parent
OsiBranchingObject * | parentBranch_
| Copy of the branching object of the parent when the node is created.
CbcNode * | owner_
| Owner.
int | numberCuts_
| Number of row cuts (this node).
int | nodeNumber_
| The node number.
CbcCountRowCut ** | cuts_
| Array of pointers to cuts.
int | numberRows_
| Number of rows in problem (before these cuts).
int | numberBranchesLeft_
| Number of branch arms left to explore at this node.
int | active_
| Active node information.
## Private Member Functions
CbcNodeInfo & | operator= (const CbcNodeInfo &rhs)
| Illegal Assignment operator.
void | setParentBasedData ()
| routine common to constructors

## Detailed Description

Information required to recreate the subproblem at this node.

When a subproblem is initially created, it is represented by a CbcNode object and an attached CbcNodeInfo object.

The CbcNode contains information needed while the subproblem remains live. The CbcNode is deleted when the last branch arm has been evaluated.

The CbcNodeInfo contains information required to maintain the branch-and-cut search tree structure (links and reference counts) and to recreate the subproblem for this node (basis, variable bounds, cutting planes). A CbcNodeInfo object remains in existence until all nodes have been pruned from the subtree rooted at this node.

The principle used to maintain the reference count is that the reference count is always the sum of all potential and actual children of the node. Specifically,

- Once it's determined how the node will branch, the reference count is set to the number of potential children (i.e., the number of arms of the branch).
- As each child is created by CbcNode::branch() (converting a potential child to the active subproblem), the reference count is decremented.
- If the child survives and will become a node in the search tree (converting the active subproblem into an actual child), increment the reference count.

Notice that the active subproblem lives in a sort of limbo, neither a potential or an actual node in the branch-and-cut tree.

CbcNodeInfo objects come in two flavours. A CbcFullNodeInfo object contains a full record of the information required to recreate a subproblem. A CbcPartialNodeInfo object expresses this information in terms of differences from the parent.

Definition at line 68 of file CbcNodeInfo.hpp.

## Constructor & Destructor Documentation

CbcNodeInfo::CbcNodeInfo | ( |  | ) |

Default Constructor.

Creates an empty NodeInfo object.

CbcNodeInfo::CbcNodeInfo | ( | const CbcNodeInfo & |  | ) |

Copy constructor.

CbcNodeInfo::CbcNodeInfo | ( | CbcNodeInfo * | parent,
|  | CbcNode * | owner |
| ) |  |  |

Construct with parent and owner.

As for `construct with parent', and attached to `owner`.

virtual CbcNodeInfo::~CbcNodeInfo | ( |  | ) | `[virtual]`

Destructor.

Note that the destructor will recursively delete the parent if this nodeInfo is the last child.

## Member Function Documentation

virtual void CbcNodeInfo::applyToModel | ( | CbcModel * | model,
|  | CoinWarmStartBasis *& | basis,
|  | CbcCountRowCut ** | addCuts,
|  | int & | currentNumberCuts |
| ) |  |  | const`[pure virtual]`

Modify model according to information at node.

The routine modifies the model according to bound and basis information at node and adds any cuts to the addCuts array.

Implemented in CbcFullNodeInfo, and CbcPartialNodeInfo.

virtual int CbcNodeInfo::applyBounds | ( | int | iColumn,
|  | double & | lower,
|  | double & | upper,
|  | int | force |
| ) |  |  | `[pure virtual]`

Just apply bounds to one variable - force means overwrite by lower,upper (1=>infeasible).

Implemented in CbcFullNodeInfo, and CbcPartialNodeInfo.

virtual CbcNodeInfo* CbcNodeInfo::buildRowBasis | ( | CoinWarmStartBasis & | basis | ) | const`[pure virtual]`

Builds up row basis backwards (until original model).

Returns NULL or previous one to apply . Depends on Free being 0 and impossible for cuts

Implemented in CbcFullNodeInfo, and CbcPartialNodeInfo.

virtual CbcNodeInfo* CbcNodeInfo::clone | ( |  | ) | const`[pure virtual]`

Clone.

Implemented in CbcFullNodeInfo, and CbcPartialNodeInfo.

virtual void CbcNodeInfo::allBranchesGone | ( |  | ) | `[inline, virtual]`

Called when number branches left down to zero.

Definition at line 126 of file CbcNodeInfo.hpp.

void CbcNodeInfo::increment | ( | int | amount = `1` | ) | `[inline]`

Increment number of references.

Definition at line 129 of file CbcNodeInfo.hpp.

int CbcNodeInfo::decrement | ( | int | amount = `1` | ) | `[inline]`

Decrement number of references and return number left.

Definition at line 134 of file CbcNodeInfo.hpp.

void CbcNodeInfo::initializeInfo | ( | int | number | ) | `[inline]`

Initialize reference counts.

Initialize the reference counts used for tree maintenance.

Definition at line 149 of file CbcNodeInfo.hpp.

int CbcNodeInfo::numberBranchesLeft | ( |  | ) | const`[inline]`

Return number of branches left in object.

Definition at line 155 of file CbcNodeInfo.hpp.

void CbcNodeInfo::setNumberBranchesLeft | ( | int | value | ) | `[inline]`

Set number of branches left in object.

Definition at line 160 of file CbcNodeInfo.hpp.

int CbcNodeInfo::numberPointingToThis | ( |  | ) | const`[inline]`

Return number of objects pointing to this.

Definition at line 165 of file CbcNodeInfo.hpp.

void CbcNodeInfo::setNumberPointingToThis | ( | int | number | ) | `[inline]`

Set number of objects pointing to this.

Definition at line 170 of file CbcNodeInfo.hpp.

void CbcNodeInfo::incrementNumberPointingToThis | ( |  | ) | `[inline]`

Increment number of objects pointing to this.

Definition at line 175 of file CbcNodeInfo.hpp.

int CbcNodeInfo::branchedOn | ( |  | ) | `[inline]`

Say one branch taken.

Definition at line 180 of file CbcNodeInfo.hpp.

void CbcNodeInfo::throwAway | ( |  | ) | `[inline]`

Say thrown away.

Definition at line 187 of file CbcNodeInfo.hpp.

CbcNodeInfo* CbcNodeInfo::parent | ( |  | ) | const`[inline]`

Parent of this.

Definition at line 193 of file CbcNodeInfo.hpp.

void CbcNodeInfo::nullParent | ( |  | ) | `[inline]`

Set parent null.

Definition at line 197 of file CbcNodeInfo.hpp.

void CbcNodeInfo::addCuts | ( | OsiCuts & | cuts,
|  | int | numberToBranch,
|  | int | numberPointingToThis |
| ) |  |  |

void CbcNodeInfo::addCuts | ( | int | numberCuts,
|  | CbcCountRowCut ** | cuts,
|  | int | numberToBranch |
| ) |  |  |

void CbcNodeInfo::deleteCuts | ( | int | numberToDelete,
|  | CbcCountRowCut ** | cuts |
| ) |  |  |

Delete cuts (decrements counts) Slow unless cuts in same order as saved.

void CbcNodeInfo::deleteCuts | ( | int | numberToDelete,
|  | int * | which |
| ) |  |  |

void CbcNodeInfo::deleteCut | ( | int | whichOne | ) |

Really delete a cut.

void CbcNodeInfo::decrementCuts | ( | int | change = `1` | ) |

Decrement active cut counts.

void CbcNodeInfo::incrementCuts | ( | int | change = `1` | ) |

Increment active cut counts.

void CbcNodeInfo::decrementParentCuts | ( | CbcModel * | model,
|  | int | change = `1` |
| ) |  |  |

Decrement all active cut counts in chain starting at parent.

void CbcNodeInfo::incrementParentCuts | ( | CbcModel * | model,
|  | int | change = `1` |
| ) |  |  |

Increment all active cut counts in parent chain.

CbcCountRowCut** CbcNodeInfo::cuts | ( |  | ) | const`[inline]`

Array of pointers to cuts.

Definition at line 226 of file CbcNodeInfo.hpp.

int CbcNodeInfo::numberCuts | ( |  | ) | const`[inline]`

Number of row cuts (this node).

Definition at line 231 of file CbcNodeInfo.hpp.

void CbcNodeInfo::setNumberCuts | ( | int | value | ) | `[inline]`

Definition at line 234 of file CbcNodeInfo.hpp.

void CbcNodeInfo::nullOwner | ( |  | ) | `[inline]`

Set owner null.

Definition at line 239 of file CbcNodeInfo.hpp.

const CbcNode* CbcNodeInfo::owner | ( |  | ) | const`[inline]`

Definition at line 242 of file CbcNodeInfo.hpp.

CbcNode* CbcNodeInfo::mutableOwner | ( |  | ) | const`[inline]`

Definition at line 245 of file CbcNodeInfo.hpp.

int CbcNodeInfo::nodeNumber | ( |  | ) | const`[inline]`

The node number.

Definition at line 249 of file CbcNodeInfo.hpp.

void CbcNodeInfo::setNodeNumber | ( | int | node | ) | `[inline]`

Definition at line 252 of file CbcNodeInfo.hpp.

void CbcNodeInfo::deactivate | ( | int | mode = `3` | ) |

Deactivate node information.

1 - bounds 2 - cuts 4 - basis!

bool CbcNodeInfo::allActivated | ( |  | ) | const`[inline]`

Say if normal.

Definition at line 262 of file CbcNodeInfo.hpp.

bool CbcNodeInfo::marked | ( |  | ) | const`[inline]`

Say if marked.

Definition at line 266 of file CbcNodeInfo.hpp.

void CbcNodeInfo::mark | ( |  | ) | `[inline]`

Mark.

Definition at line 270 of file CbcNodeInfo.hpp.

void CbcNodeInfo::unmark | ( |  | ) | `[inline]`

Unmark.

Definition at line 274 of file CbcNodeInfo.hpp.

const OsiBranchingObject* CbcNodeInfo::parentBranch | ( |  | ) | const`[inline]`

Branching object for the parent.

Definition at line 279 of file CbcNodeInfo.hpp.

void CbcNodeInfo::unsetParentBasedData | ( |  | ) |

If we need to take off parent based data.

CbcNodeInfo& CbcNodeInfo::operator= | ( | const CbcNodeInfo & | rhs | ) | `[private]`

Illegal Assignment operator.

Reimplemented in CbcFullNodeInfo, and CbcPartialNodeInfo.

void CbcNodeInfo::setParentBasedData | ( |  | ) | `[private]`

routine common to constructors

## Member Data Documentation

int CbcNodeInfo::numberPointingToThis_`[protected]`

Number of other nodes pointing to this node.

Number of existing and potential search tree nodes pointing to this node. `Existing' means referenced by parent_ of some other CbcNodeInfo. `Potential' means children still to be created (numberBranchesLeft_ of this CbcNodeInfo).

Definition at line 293 of file CbcNodeInfo.hpp.

CbcNodeInfo* CbcNodeInfo::parent_`[protected]`

parent

Definition at line 296 of file CbcNodeInfo.hpp.

OsiBranchingObject* CbcNodeInfo::parentBranch_`[protected]`

Copy of the branching object of the parent when the node is created.

Definition at line 299 of file CbcNodeInfo.hpp.

CbcNode* CbcNodeInfo::owner_`[protected]`

Owner.

Definition at line 302 of file CbcNodeInfo.hpp.

int CbcNodeInfo::numberCuts_`[protected]`

Number of row cuts (this node).

Definition at line 305 of file CbcNodeInfo.hpp.

int CbcNodeInfo::nodeNumber_`[protected]`

The node number.

Definition at line 308 of file CbcNodeInfo.hpp.

CbcCountRowCut** CbcNodeInfo::cuts_`[protected]`

Array of pointers to cuts.

Definition at line 311 of file CbcNodeInfo.hpp.

int CbcNodeInfo::numberRows_`[protected]`

Number of rows in problem (before these cuts).

This means that for top of chain it must be rows at continuous

Definition at line 315 of file CbcNodeInfo.hpp.

int CbcNodeInfo::numberBranchesLeft_`[protected]`

Number of branch arms left to explore at this node.

Todo:
  There seems to be redundancy between this field and CbcBranchingObject::numberBranchesLeft_. It'd be good to sort out if both are necessary.

Definition at line 323 of file CbcNodeInfo.hpp.

int CbcNodeInfo::active_`[protected]`

Active node information.

1 - bounds 2 - cuts 4 - basis!

Definition at line 329 of file CbcNodeInfo.hpp.

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

- /home/coin/svn-release/Cbc-2.7.8/Cbc/src/CbcNodeInfo.hpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines