Bcp 1.4.4
Loading...
Searching...
No Matches
BCP_row Class Reference

This class holds a row in a compressed form. More...

#include <BCP_matrix.hpp>

+ Inheritance diagram for BCP_row:
+ Collaboration diagram for BCP_row:

Public Member Functions

Query methods
double LowerBound () const
 Return the lower bound.
 
double UpperBound () const
 Return the upper bound.
 
General modifying methods
void LowerBound (double lb)
 Set the lower bound to the given value.
 
void UpperBound (double ub)
 Set the upper bound to the given value.
 
BCP_rowoperator= (const BCP_row &x)
 Assignment operator: copy over the contents of x.
 
void assign (const int size, int *&ElementIndices, double *&ElementValues, const double LB, const double UB)
 Set the lower and upper bounds to the given values.
 
void copy (const int size, const int *ElementIndices, const double *ElementValues, const double LB, const double UB)
 Copy the arguments into the appropriate data members.
 
void copy (BCP_vec< int >::const_iterator firstind, BCP_vec< int >::const_iterator lastind, BCP_vec< double >::const_iterator firstval, BCP_vec< double >::const_iterator lastval, const double LB, const double UB)
 Same as the other copy() method, except that instead of using vectors the indices (values) are given in [firstind,lastind) ([firstval,lastval)).
 
Constructors / Destructor
 BCP_row ()
 The default constructor creates an empty row with -infinity as lower and +infinity as upper bound.
 
 BCP_row (const BCP_row &x)
 The copy constructor makes a copy of x.
 
 BCP_row (BCP_vec< int >::const_iterator firstind, BCP_vec< int >::const_iterator lastind, BCP_vec< double >::const_iterator firstval, BCP_vec< double >::const_iterator lastval, const double LB, const double UB)
 This constructor acts exactly like the copy method with the same argument list.
 
 BCP_row (const int size, int *&ElementIndices, double *&ElementValues, const double LB, const double UB)
 This constructor acts exactly like the assign method with the same argument list.
 
 BCP_row (const CoinPackedVectorBase &vec, const double LB, const double UB)
 
 ~BCP_row ()
 The destructor deletes all data members.
 
- Public Member Functions inherited from CoinPackedVector
virtual int getNumElements () const
 
virtual const int * getIndices () const
 
virtual const double * getElements () const
 
int * getIndices ()
 
int getVectorNumElements () const
 
const int * getVectorIndices () const
 
const double * getVectorElements () const
 
double * getElements ()
 
const int * getOriginalPosition () const
 
void clear ()
 
CoinPackedVectoroperator= (const CoinPackedVector &)
 
CoinPackedVectoroperator= (const CoinPackedVectorBase &rhs)
 
void assignVector (int size, int *&inds, double *&elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
void setVector (int size, const int *inds, const double *elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
void setConstant (int size, const int *inds, double elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
void setFull (int size, const double *elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
void setFullNonZero (int size, const double *elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
void setElement (int index, double element)
 
void insert (int index, double element)
 
void append (const CoinPackedVectorBase &caboose)
 
void swap (int i, int j)
 
void truncate (int newSize)
 
void operator+= (double value)
 
void operator-= (double value)
 
void operator*= (double value)
 
void operator/= (double value)
 
void sort (const CoinCompare3 &tc)
 
void sortIncrIndex ()
 
void sortDecrIndex ()
 
void sortIncrElement ()
 
void sortDecrElement ()
 
void sortOriginalOrder ()
 
void reserve (int n)
 
int capacity () const
 
 CoinPackedVector (bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
 CoinPackedVector (int size, const int *inds, const double *elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
 CoinPackedVector (int capacity, int size, int *&inds, double *&elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
 CoinPackedVector (int size, const int *inds, double element, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
 CoinPackedVector (int size, const double *elements, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
 CoinPackedVector (const CoinPackedVector &)
 
 CoinPackedVector (const CoinPackedVectorBase &rhs)
 
virtual ~CoinPackedVector ()
 
virtual int getNumElements () const
 
virtual const int * getIndices () const
 
virtual const double * getElements () const
 
int * getIndices ()
 
int getVectorNumElements () const
 
const int * getVectorIndices () const
 
const double * getVectorElements () const
 
double * getElements ()
 
const int * getOriginalPosition () const
 
void clear ()
 
CoinPackedVectoroperator= (const CoinPackedVector &)
 
CoinPackedVectoroperator= (const CoinPackedVectorBase &rhs)
 
void assignVector (int size, int *&inds, double *&elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
void setVector (int size, const int *inds, const double *elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
void setConstant (int size, const int *inds, double elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
void setFull (int size, const double *elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
void setFullNonZero (int size, const double *elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
void setElement (int index, double element)
 
void insert (int index, double element)
 
void append (const CoinPackedVectorBase &caboose)
 
void swap (int i, int j)
 
void truncate (int newSize)
 
void operator+= (double value)
 
void operator-= (double value)
 
void operator*= (double value)
 
void operator/= (double value)
 
void sort (const CoinCompare3 &tc)
 
void sortIncrIndex ()
 
void sortDecrIndex ()
 
void sortIncrElement ()
 
void sortDecrElement ()
 
void sortOriginalOrder ()
 
void reserve (int n)
 
int capacity () const
 
 CoinPackedVector (bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
 CoinPackedVector (int size, const int *inds, const double *elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
 CoinPackedVector (int capacity, int size, int *&inds, double *&elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
 CoinPackedVector (int size, const int *inds, double element, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
 CoinPackedVector (int size, const double *elements, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
 
 CoinPackedVector (const CoinPackedVector &)
 
 CoinPackedVector (const CoinPackedVectorBase &rhs)
 
virtual ~CoinPackedVector ()
 
- Public Member Functions inherited from CoinPackedVectorBase
void setTestForDuplicateIndex (bool test) const
 
void setTestForDuplicateIndexWhenTrue (bool test) const
 
bool testForDuplicateIndex () const
 
void setTestsOff () const
 
double * denseVector (int denseSize) const
 
double operator[] (int i) const
 
int getMaxIndex () const
 
int getMinIndex () const
 
void duplicateIndex (const char *methodName=NULL, const char *className=NULL) const
 
bool isExistingIndex (int i) const
 
int findIndex (int i) const
 
bool operator== (const CoinPackedVectorBase &rhs) const
 
bool operator!= (const CoinPackedVectorBase &rhs) const
 
int compare (const CoinPackedVectorBase &rhs) const
 
bool isEquivalent (const CoinPackedVectorBase &rhs, const FloatEqual &eq) const
 
bool isEquivalent (const CoinPackedVectorBase &rhs) const
 
double dotProduct (const double *dense) const
 
double oneNorm () const
 
double normSquare () const
 
double twoNorm () const
 
double infNorm () const
 
double sum () const
 
void setTestForDuplicateIndex (bool test) const
 
void setTestForDuplicateIndexWhenTrue (bool test) const
 
bool testForDuplicateIndex () const
 
void setTestsOff () const
 
double * denseVector (int denseSize) const
 
double operator[] (int i) const
 
int getMaxIndex () const
 
int getMinIndex () const
 
void duplicateIndex (const char *methodName=NULL, const char *className=NULL) const
 
bool isExistingIndex (int i) const
 
int findIndex (int i) const
 
bool operator== (const CoinPackedVectorBase &rhs) const
 
bool operator!= (const CoinPackedVectorBase &rhs) const
 
int compare (const CoinPackedVectorBase &rhs) const
 
bool isEquivalent (const CoinPackedVectorBase &rhs, const FloatEqual &eq) const
 
bool isEquivalent (const CoinPackedVectorBase &rhs) const
 
double dotProduct (const double *dense) const
 
double oneNorm () const
 
double normSquare () const
 
double twoNorm () const
 
double infNorm () const
 
double sum () const
 
virtual ~CoinPackedVectorBase ()
 

Protected Attributes

Data members
double _LowerBound
 The lower bound corresponding to the row.
 
double _UpperBound
 The upper bound corresponding to the row.
 

Additional Inherited Members

- Protected Member Functions inherited from CoinPackedVectorBase
void findMaxMinIndices () const
 
std::set< int > * indexSet (const char *methodName=NULL, const char *className=NULL) const
 
void clearIndexSet () const
 
void clearBase () const
 
void copyMaxMinIndex (const CoinPackedVectorBase &x) const
 
 CoinPackedVectorBase ()
 
void findMaxMinIndices () const
 
std::set< int > * indexSet (const char *methodName=NULL, const char *className=NULL) const
 
void clearIndexSet () const
 
void clearBase () const
 
void copyMaxMinIndex (const CoinPackedVectorBase &x) const
 

Detailed Description

This class holds a row in a compressed form.

That is, it is a packed vector with a lower and upper bound.

Definition at line 152 of file BCP_matrix.hpp.

Constructor & Destructor Documentation

◆ BCP_row() [1/5]

BCP_row::BCP_row ( )
inline

The default constructor creates an empty row with -infinity as lower and +infinity as upper bound.

Definition at line 228 of file BCP_matrix.hpp.

◆ BCP_row() [2/5]

BCP_row::BCP_row ( const BCP_row & x)
inline

The copy constructor makes a copy of x.

Definition at line 231 of file BCP_matrix.hpp.

◆ BCP_row() [3/5]

BCP_row::BCP_row ( BCP_vec< int >::const_iterator firstind,
BCP_vec< int >::const_iterator lastind,
BCP_vec< double >::const_iterator firstval,
BCP_vec< double >::const_iterator lastval,
const double LB,
const double UB )
inline

This constructor acts exactly like the copy method with the same argument list.

Definition at line 236 of file BCP_matrix.hpp.

◆ BCP_row() [4/5]

BCP_row::BCP_row ( const int size,
int *& ElementIndices,
double *& ElementValues,
const double LB,
const double UB )
inline

This constructor acts exactly like the assign method with the same argument list.

Definition at line 246 of file BCP_matrix.hpp.

◆ BCP_row() [5/5]

BCP_row::BCP_row ( const CoinPackedVectorBase & vec,
const double LB,
const double UB )
inline

Definition at line 252 of file BCP_matrix.hpp.

◆ ~BCP_row()

BCP_row::~BCP_row ( )
inline

The destructor deletes all data members.

Definition at line 257 of file BCP_matrix.hpp.

Member Function Documentation

◆ LowerBound() [1/2]

double BCP_row::LowerBound ( ) const
inline

Return the lower bound.

Definition at line 167 of file BCP_matrix.hpp.

◆ UpperBound() [1/2]

double BCP_row::UpperBound ( ) const
inline

Return the upper bound.

Definition at line 169 of file BCP_matrix.hpp.

◆ LowerBound() [2/2]

void BCP_row::LowerBound ( double lb)
inline

Set the lower bound to the given value.

Definition at line 176 of file BCP_matrix.hpp.

◆ UpperBound() [2/2]

void BCP_row::UpperBound ( double ub)
inline

Set the upper bound to the given value.

Definition at line 178 of file BCP_matrix.hpp.

◆ operator=()

BCP_row & BCP_row::operator= ( const BCP_row & x)
inline

Assignment operator: copy over the contents of x.

Definition at line 181 of file BCP_matrix.hpp.

◆ assign()

void BCP_row::assign ( const int size,
int *& ElementIndices,
double *& ElementValues,
const double LB,
const double UB )
inline

Set the lower and upper bounds to the given values.

Also invokes the assign method of the underlying packed vector.

Definition at line 191 of file BCP_matrix.hpp.

◆ copy() [1/2]

void BCP_row::copy ( const int size,
const int * ElementIndices,
const double * ElementValues,
const double LB,
const double UB )
inline

Copy the arguments into the appropriate data members.

Definition at line 200 of file BCP_matrix.hpp.

◆ copy() [2/2]

void BCP_row::copy ( BCP_vec< int >::const_iterator firstind,
BCP_vec< int >::const_iterator lastind,
BCP_vec< double >::const_iterator firstval,
BCP_vec< double >::const_iterator lastval,
const double LB,
const double UB )
inline

Same as the other copy() method, except that instead of using vectors the indices (values) are given in [firstind,lastind) ([firstval,lastval)).

Definition at line 211 of file BCP_matrix.hpp.

Member Data Documentation

◆ _LowerBound

double BCP_row::_LowerBound
protected

The lower bound corresponding to the row.

Definition at line 157 of file BCP_matrix.hpp.

◆ _UpperBound

double BCP_row::_UpperBound
protected

The upper bound corresponding to the row.

Definition at line 159 of file BCP_matrix.hpp.


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