- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# OsiColCut Class Reference

Column Cut Class. More...

`#include <OsiColCut.hpp>`

Inheritance diagram for OsiColCut:

[legend]
Collaboration diagram for OsiColCut:

[legend]
List of all members.

## Public Member Functions
Setting column bounds
void | setLbs (int nElements, const int *colIndices, const double *lbElements)
| Set column lower bounds.
void | setLbs (const CoinPackedVector &lbs)
| Set column lower bounds from a packed vector.
void | setUbs (int nElements, const int *colIndices, const double *ubElements)
| Set column upper bounds.
void | setUbs (const CoinPackedVector &ubs)
| Set column upper bounds from a packed vector.
Getting column bounds
const CoinPackedVector & | lbs () const
| Get column lower bounds.
const CoinPackedVector & | ubs () const
| Get column upper bounds.
Comparison operators
virtual bool | operator== (const OsiColCut &rhs) const
| equal - true if lower bounds, upper bounds, and OsiCut are equal.
virtual bool | operator!= (const OsiColCut &rhs) const
| not equal
Sanity checks on cut
virtual bool | consistent () const
| Returns true if the cut is consistent with respect to itself.
virtual bool | consistent (const OsiSolverInterface &im) const
| Returns true if cut is consistent with respect to the solver interface's model.
virtual bool | infeasible (const OsiSolverInterface &im) const
| Returns true if the cut is infeasible with respect to its bounds and the column bounds in the solver interface's models.
virtual double | violated (const double *solution) const
| Returns infeasibility of the cut with respect to solution passed in i.e.
Constructors and destructors
OsiColCut & | operator= (const OsiColCut &rhs)
| Assignment operator.
| OsiColCut (const OsiColCut &)
| Copy constructor.
| OsiColCut ()
| Default Constructor.
virtual OsiColCut * | clone () const
| Clone.
virtual | ~OsiColCut ()
| Destructor.
Debug stuff
virtual void | print () const
| Print cuts in collection.
## Private Attributes
Private member data
CoinPackedVector | lbs_
| Lower bounds.
CoinPackedVector | ubs_
| Upper bounds.
## Friends
void | OsiColCutUnitTest (const OsiSolverInterface *baseSiP, const std::string &mpsDir)
| A function that tests the methods in the OsiColCut class.

## Detailed Description

Column Cut Class.

Column Cut Class has:

- a sparse vector of column lower bounds
- a sparse vector of column upper bounds

Definition at line 21 of file OsiColCut.hpp.

## Constructor & Destructor Documentation

OsiColCut::OsiColCut | ( | const OsiColCut & |  | ) |

Copy constructor.

OsiColCut::OsiColCut | ( |  | ) |

Default Constructor.

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

Destructor.

## Member Function Documentation

void OsiColCut::setLbs | ( | int | nElements,
|  | const int * | colIndices,
|  | const double * | lbElements |
| ) |  |  | `[inline]`

Set column lower bounds.

Definition at line 159 of file OsiColCut.hpp.

References lbs_, and CoinPackedVector::setVector().

void OsiColCut::setLbs | ( | const CoinPackedVector & | lbs | ) | `[inline]`

Set column lower bounds from a packed vector.

Definition at line 175 of file OsiColCut.hpp.

References lbs(), and lbs_.

void OsiColCut::setUbs | ( | int | nElements,
|  | const int * | colIndices,
|  | const double * | ubElements |
| ) |  |  | `[inline]`

Set column upper bounds.

Definition at line 167 of file OsiColCut.hpp.

References CoinPackedVector::setVector(), and ubs_.

void OsiColCut::setUbs | ( | const CoinPackedVector & | ubs | ) | `[inline]`

Set column upper bounds from a packed vector.

Definition at line 180 of file OsiColCut.hpp.

References ubs(), and ubs_.

const CoinPackedVector & OsiColCut::lbs | ( |  | ) | const`[inline]`

Get column lower bounds.

Definition at line 188 of file OsiColCut.hpp.

References lbs_.

Referenced by consistent(), infeasible(), operator==(), and setLbs().

const CoinPackedVector & OsiColCut::ubs | ( |  | ) | const`[inline]`

Get column upper bounds.

Definition at line 193 of file OsiColCut.hpp.

References ubs_.

Referenced by consistent(), infeasible(), operator==(), and setUbs().

bool OsiColCut::operator== | ( | const OsiColCut & | rhs | ) | const`[inline, virtual]`

equal - true if lower bounds, upper bounds, and OsiCut are equal.

Definition at line 202 of file OsiColCut.hpp.

References lbs(), and ubs().

bool OsiColCut::operator!= | ( | const OsiColCut & | rhs | ) | const`[inline, virtual]`

not equal

Definition at line 215 of file OsiColCut.hpp.

bool OsiColCut::consistent | ( |  | ) | const`[inline, virtual]`

Returns true if the cut is consistent with respect to itself.

This checks to ensure that:

- The bound vectors do not have duplicate indices,
- The bound vectors indices are >=0

Implements OsiCut.

Definition at line 224 of file OsiColCut.hpp.

References CoinPackedVectorBase::duplicateIndex(), CoinPackedVectorBase::getMinIndex(), lbs(), and ubs().

bool OsiColCut::consistent | ( | const OsiSolverInterface & | im | ) | const`[inline, virtual]`

Returns true if cut is consistent with respect to the solver interface's model.

This checks to ensure that the lower & upperbound packed vectors:

- do not have an index >= the number of column is the model.

Implements OsiCut.

Definition at line 237 of file OsiColCut.hpp.

References CoinPackedVectorBase::getMaxIndex(), OsiSolverInterface::getNumCols(), lbs(), and ubs().

bool OsiColCut::infeasible | ( | const OsiSolverInterface & | im | ) | const`[inline, virtual]`

Returns true if the cut is infeasible with respect to its bounds and the column bounds in the solver interface's models.

This checks whether:

- the maximum of the new and existing lower bounds is strictly greater than the minimum of the new and existing upper bounds.

Implements OsiCut.

Definition at line 288 of file OsiColCut.hpp.

References OsiSolverInterface::getColLower(), OsiSolverInterface::getColUpper(), CoinPackedVector::getElements(), CoinPackedVector::getIndices(), CoinPackedVector::getNumElements(), CoinPackedVectorBase::isExistingIndex(), lbs(), and ubs().

virtual double OsiColCut::violated | ( | const double * | solution | ) | const`[virtual]`

Returns infeasibility of the cut with respect to solution passed in i.e.

is positive if cuts off that solution. solution is getNumCols() long..

Implements OsiCut.

OsiColCut& OsiColCut::operator= | ( | const OsiColCut & | rhs | ) |

Assignment operator.

virtual OsiColCut* OsiColCut::clone | ( |  | ) | const`[virtual]`

Clone.

Referenced by OsiCuts::insert().

virtual void OsiColCut::print | ( |  | ) | const`[virtual]`

Print cuts in collection.

Reimplemented from OsiCut.

Referenced by OsiCuts::printCuts().

## Friends And Related Function Documentation

void OsiColCutUnitTest | ( | const OsiSolverInterface * | baseSiP,
|  | const std::string & | mpsDir |
| ) |  |  | `[friend]`

A function that tests the methods in the OsiColCut class.

The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging.

## Member Data Documentation

CoinPackedVector OsiColCut::lbs_`[private]`

Lower bounds.

Definition at line 147 of file OsiColCut.hpp.

Referenced by lbs(), and setLbs().

CoinPackedVector OsiColCut::ubs_`[private]`

Upper bounds.

Definition at line 149 of file OsiColCut.hpp.

Referenced by setUbs(), and ubs().

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

- /home/coin/SVN-release/Cgl-0.53.1/Osi/src/OsiColCut.hpp