OsiRowCut Class Reference

Row Cut Class. More...

#include <OsiRowCut.hpp>

Inheritance diagram for OsiRowCut:

Inheritance graph
[legend]
Collaboration diagram for OsiRowCut:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void sortIncrIndex ()
 Allow access row sorting function.
Row bounds
OsiRowCut_inline double lb () const
 Get lower bound.
OsiRowCut_inline void setLb (double lb)
 Set lower bound.
OsiRowCut_inline double ub () const
 Get upper bound.
OsiRowCut_inline void setUb (double ub)
 Set upper bound.
Row rhs, sense, range
char sense () const
 Get sense ('E', 'G', 'L', 'N', 'R').
double rhs () const
 Get right-hand side.
double range () const
 Get range (ub - lb for 'R' rows, 0 otherwise).
Row elements
OsiRowCut_inline void setRow (int size, const int *colIndices, const double *elements, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 Set row elements.
OsiRowCut_inline void setRow (const CoinPackedVector &v)
 Set row elements from a packed vector.
OsiRowCut_inline const CoinPackedVectorrow () const
 Get row elements.
OsiRowCut_inline CoinPackedVectormutableRow ()
 Get row elements for changing.
Comparison operators
OsiRowCut_inline bool operator== (const OsiRowCut &rhs) const
 equal - true if lower bound, upper bound, row elements, and OsiCut are equal.
OsiRowCut_inline bool operator!= (const OsiRowCut &rhs) const
 not equal
Sanity checks on cut
OsiRowCut_inline bool consistent () const
 Returns true if the cut is consistent.
OsiRowCut_inline bool consistent (const OsiSolverInterface &im) const
 Returns true if cut is consistent with respect to the solver interface's model.
OsiRowCut_inline bool infeasible (const OsiSolverInterface &im) const
 Returns true if the row cut itself is infeasible and cannot be satisfied.
virtual double violated (const double *solution) const
 Returns infeasibility of the cut with respect to solution passed in i.e.
Arithmetic operators. Apply CoinPackedVector methods to the vector
void operator+= (double value)
 add value to every vector entry
void operator-= (double value)
 subtract value from every vector entry
void operator *= (double value)
 multiply every vector entry by value
void operator/= (double value)
 divide every vector entry by value
Constructors and destructors
OsiRowCutoperator= (const OsiRowCut &rhs)
 Assignment operator.
 OsiRowCut (const OsiRowCut &)
 Copy constructor.
virtual OsiRowCutclone () const
 Clone.
 OsiRowCut ()
 Default Constructor.
 OsiRowCut (double cutlb, double cutub, int capacity, int size, int *&colIndices, double *&elements)
 Ownership Constructor.
virtual ~OsiRowCut ()
 Destructor.
Debug stuff
virtual void print () const
 Print cuts in collection.

Private Attributes

Private member data
CoinPackedVector row_
 Row elements.
double lb_
 Row lower bound.
double ub_
 Row upper bound.

Friends

void OsiRowCutUnitTest (const OsiSolverInterface *baseSiP, const std::string &mpsDir)
 A function that tests the methods in the OsiRowCut class.

Detailed Description

Row Cut Class.

A row cut has:

Definition at line 27 of file OsiRowCut.hpp.


Constructor & Destructor Documentation

OsiRowCut::OsiRowCut ( const OsiRowCut  ) 

Copy constructor.

OsiRowCut::OsiRowCut (  ) 

Default Constructor.

OsiRowCut::OsiRowCut ( double  cutlb,
double  cutub,
int  capacity,
int  size,
int *&  colIndices,
double *&  elements 
)

Ownership Constructor.

This constructor assumes ownership of the vectors passed as parameters for indices and elements. colIndices and elements will be NULL on return.

virtual OsiRowCut::~OsiRowCut (  )  [virtual]

Destructor.


Member Function Documentation

OsiRowCut_inline double OsiRowCut::lb (  )  const

Get lower bound.

OsiRowCut_inline void OsiRowCut::setLb ( double  lb  ) 

Set lower bound.

OsiRowCut_inline double OsiRowCut::ub (  )  const

Get upper bound.

OsiRowCut_inline void OsiRowCut::setUb ( double  ub  ) 

Set upper bound.

char OsiRowCut::sense (  )  const

Get sense ('E', 'G', 'L', 'N', 'R').

double OsiRowCut::rhs (  )  const

Get right-hand side.

double OsiRowCut::range (  )  const

Get range (ub - lb for 'R' rows, 0 otherwise).

OsiRowCut_inline void OsiRowCut::setRow ( int  size,
const int *  colIndices,
const double *  elements,
bool  testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE 
)

Set row elements.

OsiRowCut_inline void OsiRowCut::setRow ( const CoinPackedVector v  ) 

Set row elements from a packed vector.

OsiRowCut_inline const CoinPackedVector& OsiRowCut::row (  )  const

Get row elements.

OsiRowCut_inline CoinPackedVector& OsiRowCut::mutableRow (  ) 

Get row elements for changing.

OsiRowCut_inline bool OsiRowCut::operator== ( const OsiRowCut rhs  )  const

equal - true if lower bound, upper bound, row elements, and OsiCut are equal.

OsiRowCut_inline bool OsiRowCut::operator!= ( const OsiRowCut rhs  )  const

not equal

OsiRowCut_inline bool OsiRowCut::consistent (  )  const [virtual]

Returns true if the cut is consistent.

This checks to ensure that:

Implements OsiCut.

OsiRowCut_inline bool OsiRowCut::consistent ( const OsiSolverInterface im  )  const [virtual]

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

This checks to ensure that

Implements OsiCut.

OsiRowCut_inline bool OsiRowCut::infeasible ( const OsiSolverInterface im  )  const [virtual]

Returns true if the row cut itself is infeasible and cannot be satisfied.

This checks whether

Implements OsiCut.

virtual double OsiRowCut::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.

void OsiRowCut::operator+= ( double  value  )  [inline]

add value to every vector entry

Definition at line 130 of file OsiRowCut.hpp.

References row_.

void OsiRowCut::operator-= ( double  value  )  [inline]

subtract value from every vector entry

Definition at line 134 of file OsiRowCut.hpp.

References row_.

void OsiRowCut::operator *= ( double  value  )  [inline]

multiply every vector entry by value

Definition at line 138 of file OsiRowCut.hpp.

References row_.

void OsiRowCut::operator/= ( double  value  )  [inline]

divide every vector entry by value

Definition at line 142 of file OsiRowCut.hpp.

References row_.

void OsiRowCut::sortIncrIndex (  )  [inline]

Allow access row sorting function.

Definition at line 147 of file OsiRowCut.hpp.

References row_, and CoinPackedVector::sortIncrIndex().

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

Assignment operator.

virtual OsiRowCut* OsiRowCut::clone (  )  const [virtual]

Clone.

Reimplemented in OsiRowCut2.

Referenced by OsiCuts::insert().

virtual void OsiRowCut::print (  )  const [virtual]

Print cuts in collection.

Reimplemented from OsiCut.

Referenced by OsiCuts::printCuts().


Friends And Related Function Documentation

void OsiRowCutUnitTest ( const OsiSolverInterface baseSiP,
const std::string &  mpsDir 
) [friend]

A function that tests the methods in the OsiRowCut 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 OsiRowCut::row_ [private]

Row elements.

Definition at line 190 of file OsiRowCut.hpp.

Referenced by operator *=(), operator+=(), operator-=(), operator/=(), and sortIncrIndex().

double OsiRowCut::lb_ [private]

Row lower bound.

Definition at line 192 of file OsiRowCut.hpp.

double OsiRowCut::ub_ [private]

Row upper bound.

Definition at line 194 of file OsiRowCut.hpp.


The documentation for this class was generated from the following file:
Generated on Sun Nov 14 14:14:24 2010 for Coin-All by  doxygen 1.4.7