SoPlex Doxygen Documentation
Vector_exact Class Reference

Dense vector of MpqReal.Class Vector_exact is a copy of class Vector replacing the floating point type Real with the exact MpqReal. More...

#include <vector_exact.h>

Inheritance diagram for Vector_exact:

Public Member Functions

Construction and assignment
 Vector_exact (int p_dimen, MpqReal *p_val)
 construction
 
Vector_exactoperator= (const Vector_exact &vec)
 Assignment operator.
 
Vector_exactoperator= (const Vector &vec)
 Assignment operator.
 
Vector_exactoperator= (const SVector &vec)
 Assignment operator.
 
Algebraic methods
Vector_exactoperator+= (const Vector_exact &vec)
 vector addition
 
Vector_exactoperator+= (const Vector &vec)
 vector addition
 
Vector_exactoperator+= (const SVector &vec)
 vector addition
 
Vector_exactoperator-= (const Vector_exact &vec)
 vector difference
 
Vector_exactoperator-= (const Vector &vec)
 vector difference
 
Vector_exactoperator-= (const SVector &vec)
 vector difference
 
Vector_exactoperator*= (MpqReal x)
 scaling
 
MpqReal maxAbs () const
 absolute biggest element (infinity norm).
 
MpqReal minAbs () const
 absolute smallest element.
 
Vector_exactmultAdd (MpqReal x, const Vector_exact &vec)
 addition of scaled vector
 
Vector_exactmultAdd (MpqReal x, const Vector &vec)
 addition of scaled vector
 
Vector_exactmultAdd (MpqReal x, const SVector &vec)
 addition of scaled vector
 

Protected Attributes

Data
int dimen
 dimension of vector
 
MpqRealval
 values of a vector
 

Private Member Functions

Blocked
 Vector_exact ()
 we have no default constructor.
 

Access

int dim () const
 dimension of vector
 
MpqRealoperator[] (int n)
 return n 'th value by reference
 
MpqReal operator[] (int n) const
 return n 'th value
 
bool operator== (const Vector_exact &vec1, const Vector_exact &vec2)
 equality operator
 

Utilities

MpqRealget_ptr ()
 Conversion to C-style pointer.
 
const MpqRealget_const_ptr () const
 Conversion to C-style pointer.
 
bool isConsistent () const
 consistency check.
 
void clear ()
 set vector to 0.
 
std::ostream & operator<< (std::ostream &s, const Vector_exact &vec)
 output operator.
 

Detailed Description

Dense vector of MpqReal.

Class Vector_exact is a copy of class Vector replacing the floating point type Real with the exact MpqReal.

Definition at line 41 of file vector_exact.h.

Constructor & Destructor Documentation

Vector_exact ( int  p_dimen,
MpqReal p_val 
)

construction

There is no default constructor since the storage for a Vector must be provided externally. Storage must be passed as a memory block val at construction. It must be large enough to fit at least dimen Real values.

Definition at line 68 of file vector_exact.h.

References Vector_exact::dimen, and Vector_exact::isConsistent().

Vector_exact ( )
private

we have no default constructor.

Member Function Documentation

void clear ( )

set vector to 0.

Definition at line 176 of file vector_exact.h.

References Vector_exact::dimen, and Vector_exact::val.

Referenced by SPxLP::computeDualActivity(), SPxLP::computePrimalActivity(), and Vector_exact::operator=().

const MpqReal* get_const_ptr ( ) const

Conversion to C-style pointer.

This function serves for using a Vector in an C-style function. It returns a pointer to the first value of the array.

Definition at line 165 of file vector_exact.h.

References Vector_exact::val.

MpqReal* get_ptr ( )

Conversion to C-style pointer.

This function serves for using a Vector in an C-style function. It returns a pointer to the first value of the array.

Todo:
check whether this non-const c-style acces should indeed be public

Definition at line 157 of file vector_exact.h.

References Vector_exact::val.

bool isConsistent ( ) const
MpqReal maxAbs ( ) const

absolute biggest element (infinity norm).

Definition at line 174 of file vector_exact.cpp.

References soplex::abs(), Vector_exact::dim(), and Vector_exact::val.

MpqReal minAbs ( ) const

absolute smallest element.

Definition at line 191 of file vector_exact.cpp.

References soplex::abs(), Vector_exact::dim(), and Vector_exact::val.

Vector_exact & multAdd ( MpqReal  x,
const Vector_exact vec 
)

addition of scaled vector

Definition at line 210 of file vector_exact.cpp.

References Vector_exact::dim(), Vector_exact::dimen, and Vector_exact::val.

Referenced by SPxLP::computeDualActivity(), and SPxLP::computePrimalActivity().

Vector_exact& multAdd ( MpqReal  x,
const Vector vec 
)

addition of scaled vector

Vector_exact & multAdd ( MpqReal  x,
const SVector vec 
)

addition of scaled vector

Definition at line 220 of file vector_exact.cpp.

References Vector_exact::dim(), SVector::index(), SVector::size(), Vector_exact::val, and SVector::value().

Vector_exact & operator*= ( MpqReal  x)

scaling

Definition at line 164 of file vector_exact.cpp.

References Vector_exact::dim(), and Vector_exact::val.

Vector_exact & operator+= ( const Vector_exact vec)

vector addition

Definition at line 90 of file vector_exact.cpp.

References Vector_exact::dim(), Vector_exact::dimen, and Vector_exact::val.

Vector_exact & operator+= ( const Vector vec)

vector addition

Definition at line 102 of file vector_exact.cpp.

References Vector_exact::dim(), Vector::dim(), and Vector_exact::val.

Vector_exact & operator+= ( const SVector vec)

vector addition

Definition at line 114 of file vector_exact.cpp.

References Vector_exact::dim(), SVector::index(), SVector::size(), Vector_exact::val, and SVector::value().

Vector_exact & operator-= ( const Vector_exact vec)

vector difference

Definition at line 128 of file vector_exact.cpp.

References Vector_exact::dim(), and Vector_exact::val.

Vector_exact & operator-= ( const Vector vec)

vector difference

Definition at line 140 of file vector_exact.cpp.

References Vector_exact::dim(), Vector::dim(), and Vector_exact::val.

Vector_exact & operator-= ( const SVector vec)

vector difference

Definition at line 152 of file vector_exact.cpp.

References Vector_exact::dim(), SVector::index(), SVector::size(), Vector_exact::val, and SVector::value().

Vector_exact & operator= ( const Vector_exact vec)
Vector_exact & operator= ( const Vector vec)

Assignment operator.

Definition at line 61 of file vector_exact.cpp.

References Vector_exact::dim(), Vector::dim(), Vector_exact::dimen, Vector_exact::isConsistent(), and Vector_exact::val.

Vector_exact & operator= ( const SVector vec)

Assignment operator.

Assigning a SVector to a Vector using operator=() will set all values to 0 except the nonzeros of vec. This is diffent in method assign().

Definition at line 75 of file vector_exact.cpp.

References Vector_exact::clear(), Vector_exact::dim(), SVector::index(), Vector_exact::isConsistent(), SVector::size(), Vector_exact::val, and SVector::value().

MpqReal& operator[] ( int  n)

return n 'th value by reference

Definition at line 98 of file vector_exact.h.

References Vector_exact::dimen, and Vector_exact::val.

MpqReal operator[] ( int  n) const

return n 'th value

Definition at line 105 of file vector_exact.h.

References Vector_exact::dimen, and Vector_exact::val.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const Vector_exact vec 
)
friend

output operator.

Definition at line 231 of file vector_exact.cpp.

bool operator== ( const Vector_exact vec1,
const Vector_exact vec2 
)
friend

equality operator

Definition at line 43 of file vector_exact.cpp.

Member Data Documentation