Vector class that include the boost::ublas::vector. More...
#include <jrl/mal/boostvector.hh>
Public Member Functions | |
Constructors | |
Vector (const InternalVector::size_type size=0) | |
Classical constructor. | |
Vector (InternalVector *clone, const bool proprio=false) | |
Build only the capsule around a already existing boost vector object. | |
Vector (const Vector ©) | |
Build a new internal vector from existing boost vector object by copying the data. | |
virtual | ~Vector (void) |
InternalVector & | accessToMotherLib (void) |
Access to the boost internal vector. | |
const InternalVector & | accessToMotherLib (void) const |
Access to the boost internal vector. | |
Vector & | initFromMotherLib (const InternalVector &bv) |
Copy the values and data of an existing boost vector. | |
Modifiors | |
unsigned int | size (void) const |
Vector & | resize (const InternalVector::size_type nbRows, const bool setZero=true) |
Vector & | fill (const FloatType value) |
Vector & | setZero (void) |
Vector & | opposite (Vector &res) const |
Vector | opposite (void) const |
Accessors | |
Access to an element, a block of element or the hidden double-array matrix. | |
const FloatType * | datablock (void) const |
Access to the C-style double matrix. | |
FloatType * | datablock (void) |
Access to the C-style double matrix. | |
const FloatType & | elementAt (const InternalVector::size_type row) const |
Access to the i-th element in R-only. | |
FloatType & | elementAt (const InternalVector::size_type row) |
Access to the i-th element in RW-mode. | |
Vector & | extract (const InternalVector::size_type top, const InternalVector::size_type nbrows, Vector &C) const |
Extract a part of the vector. | |
Vector | extract (const InternalVector::size_type top, const InternalVector::size_type nbrows) const |
Extract a part of the vector. | |
Protected Attributes | |
InternalVector | staticVector |
InternalVector * | dynamicVector |
InternalVector & | vector |
bool | proprio |
Static Protected Attributes | |
static const bool | AUTORESIZE = true |
static const bool | CHECKRESIZE = true |
Friends | |
class | Matrix |
Scalar Operator E->R | |
FloatType | norm (void) const |
FloatType | norm1 (void) const |
Norm 1 sum( |xi| ) | |
FloatType | max (void) const |
Not implemented yet. | |
FloatType | min (void) const |
Not implemented yet. | |
FloatType | sumSquare (void) const |
Not implemented yet. | |
FloatType | normInfty (void) const |
Infinity norm: max( |xi| ). | |
FloatType | scalarProduct (const Vector &v2) const |
Scalar product: v1.v2 = sum( x1*x2 ). | |
static FloatType | scalarProduct (const Vector &v1, const Vector &v2) |
Scalar product: v1.v2 = sum( x1*x2 ). | |
Operator Functions ExE->E | |
Vector & | crossProduct (const Vector &v2, Vector &res) const |
Vector | crossProduct (const Vector &v2) |
Vector | multiply (const Vector &v2) const |
Vector & | multiply (const Vector &v2, Vector &res) const |
Vector | multiply (const FloatType x) const |
Vector & | multiply (const FloatType x, Vector &res) const |
Vector | addition (const Vector &v2) const |
Vector & | addition (const Vector &v2, Vector &res) const |
Vector | substraction (const Vector &v2) const |
Vector & | substraction (const Vector &v2, Vector &res) const |
static Vector & | crossProduct (const Vector &v1, const Vector &v2, Vector &res) |
static Vector & | multiply (const Vector &v1, const Vector &v2, Vector &res) |
static Vector & | multiply (const Vector &v1, const FloatType x, Vector &res) |
static Vector & | addition (const Vector &v1, const Vector &v2, Vector &res) |
static Vector & | substraction (const Vector &v1, const Vector &v2, Vector &res) |
Operators | |
Classical operators: use v1 + v2 for addition, v1(i) for i-th element... | |
Vector | operator+ (const Vector &v1, const Vector &v2) |
Vector | operator- (const Vector &v1, const Vector &v2) |
Vector | operator* (const Vector &v1, const Vector &v2) |
Vector | operator* (const Vector &v1, const FloatType x) |
Vector | operator* (const FloatType x, const Vector &v1) |
Vector | operator- (const Vector &v1) |
std::istream & | operator>> (std::istream &is, Vector &v1) |
std::ostream & | operator<< (std::ostream &os, const Vector &v1) |
Vector & | operator+= (const Vector &v1) |
Vector & | operator-= (const Vector &v1) |
Vector & | operator*= (const Vector &v1) |
Vector & | operator*= (const FloatType x) |
const FloatType & | operator() (const InternalVector::size_type i) const |
FloatType & | operator() (const InternalVector::size_type i) |
Vector & | operator= (const Vector &v1) |
Internal functions (autoresize) | |
bool | autoresize (void) |
static void | _resize (InternalVector &vct1, const InternalVector &vct2) |
static bool | _checksize (const InternalVector &vct1, const InternalVector &vct2) |
static bool | _checksizeVerb (const InternalVector &vct1, const InternalVector &vct2) |
static bool | _checksize (const InternalVector &vct1, const InternalVector::size_type s2) |
static bool | _checksizeVerb (const InternalVector &vct1, const InternalVector::size_type s2) |
Vector class that include the boost::ublas::vector.
The class simply encapsulates the ublas::vector object, and implement a set of standard functions. When the maal::boost::Vector object is constructed, it automatically builds the internal ublas::vector object. The internal object can be access through accessToMotherLib. Finally, it is possible to build the capsule around an existing boost ublas::vector through the appropriate constructor.
maal::boost::Vector::Vector | ( | const InternalVector::size_type | size = 0 | ) | [inline] |
Classical constructor.
Build the internal vector from the demanded size.
maal::boost::Vector::Vector | ( | InternalVector * | clone, |
const bool | proprio = false |
||
) | [inline] |
Build only the capsule around a already existing boost vector object.
maal::boost::Vector::Vector | ( | const Vector & | copy | ) | [inline] |
Build a new internal vector from existing boost vector object by copying the data.
virtual maal::boost::Vector::~Vector | ( | void | ) | [inline, virtual] |
References dynamicVector, and proprio.
static bool maal::boost::Vector::_checksize | ( | const InternalVector & | vct1, |
const InternalVector & | vct2 | ||
) | [inline, static, protected] |
References CHECKRESIZE.
Referenced by addition(), crossProduct(), elementAt(), extract(), multiply(), and substraction().
static bool maal::boost::Vector::_checksize | ( | const InternalVector & | vct1, |
const InternalVector::size_type | s2 | ||
) | [inline, static, protected] |
References CHECKRESIZE.
static bool maal::boost::Vector::_checksizeVerb | ( | const InternalVector & | vct1, |
const InternalVector & | vct2 | ||
) | [inline, static, protected] |
References CHECKRESIZE.
static bool maal::boost::Vector::_checksizeVerb | ( | const InternalVector & | vct1, |
const InternalVector::size_type | s2 | ||
) | [inline, static, protected] |
References CHECKRESIZE.
static void maal::boost::Vector::_resize | ( | InternalVector & | vct1, |
const InternalVector & | vct2 | ||
) | [inline, static, protected] |
References AUTORESIZE.
Referenced by crossProduct(), and multiply().
InternalVector& maal::boost::Vector::accessToMotherLib | ( | void | ) | [inline] |
Access to the boost internal vector.
References vector.
const InternalVector& maal::boost::Vector::accessToMotherLib | ( | void | ) | const [inline] |
Access to the boost internal vector.
References vector.
static Vector& maal::boost::Vector::addition | ( | const Vector & | v1, |
const Vector & | v2, | ||
Vector & | res | ||
) | [inline, static] |
References addition().
Referenced by addition(), and operator+=().
Vector maal::boost::Vector::addition | ( | const Vector & | v2 | ) | const [inline] |
References addition(), and size().
Referenced by addition().
Vector& maal::boost::Vector::addition | ( | const Vector & | v2, |
Vector & | res | ||
) | const [inline] |
References _checksize(), MAAL_CHECKVERBOSE, and vector.
bool maal::boost::Vector::autoresize | ( | void | ) | [inline] |
References AUTORESIZE.
static Vector& maal::boost::Vector::crossProduct | ( | const Vector & | v1, |
const Vector & | v2, | ||
Vector & | res | ||
) | [inline, static] |
References crossProduct().
Referenced by crossProduct().
Vector& maal::boost::Vector::crossProduct | ( | const Vector & | v2, |
Vector & | res | ||
) | const [inline] |
References _checksize(), _resize(), MAAL_CHECKVERBOSE, and vector.
Vector maal::boost::Vector::crossProduct | ( | const Vector & | v2 | ) | [inline] |
References crossProduct(), and size().
const FloatType* maal::boost::Vector::datablock | ( | void | ) | const [inline] |
FloatType* maal::boost::Vector::datablock | ( | void | ) | [inline] |
const FloatType& maal::boost::Vector::elementAt | ( | const InternalVector::size_type | row | ) | const [inline] |
Access to the i-th element in R-only.
This C-style function is equivalent to the C++ operator().
References _checksize(), MAAL_CHECKVERBOSE, and vector.
Referenced by operator()().
FloatType& maal::boost::Vector::elementAt | ( | const InternalVector::size_type | row | ) | [inline] |
Access to the i-th element in RW-mode.
This C-style function is equivalent to the C++ operator().
References _checksize(), MAAL_CHECKVERBOSE, and vector.
Vector& maal::boost::Vector::extract | ( | const InternalVector::size_type | top, |
const InternalVector::size_type | nbrows, | ||
Vector & | C | ||
) | const [inline] |
Extract a part of the vector.
Not implemented yet.
References _checksize(), MAAL_CHECKVERBOSE, and vector.
Vector maal::boost::Vector::extract | ( | const InternalVector::size_type | top, |
const InternalVector::size_type | nbrows | ||
) | const [inline] |
Vector& maal::boost::Vector::fill | ( | const FloatType | value | ) | [inline] |
Vector& maal::boost::Vector::initFromMotherLib | ( | const InternalVector & | bv | ) | [inline] |
Copy the values and data of an existing boost vector.
References vector.
FloatType maal::boost::Vector::max | ( | void | ) | const [inline] |
Not implemented yet.
References ML_NOT_IMPLEMENTED.
FloatType maal::boost::Vector::min | ( | void | ) | const [inline] |
Not implemented yet.
References ML_NOT_IMPLEMENTED.
static Vector& maal::boost::Vector::multiply | ( | const Vector & | v1, |
const Vector & | v2, | ||
Vector & | res | ||
) | [inline, static] |
References multiply().
Referenced by multiply(), and operator*=().
Vector maal::boost::Vector::multiply | ( | const Vector & | v2 | ) | const [inline] |
References multiply(), and size().
Referenced by multiply().
Vector& maal::boost::Vector::multiply | ( | const Vector & | v2, |
Vector & | res | ||
) | const [inline] |
References _checksize(), _resize(), MAAL_CHECKVERBOSE, size(), and vector.
static Vector& maal::boost::Vector::multiply | ( | const Vector & | v1, |
const FloatType | x, | ||
Vector & | res | ||
) | [inline, static] |
References multiply().
Vector maal::boost::Vector::multiply | ( | const FloatType | x | ) | const [inline] |
References multiply(), and size().
Referenced by multiply().
Vector& maal::boost::Vector::multiply | ( | const FloatType | x, |
Vector & | res | ||
) | const [inline] |
References vector.
FloatType maal::boost::Vector::norm | ( | void | ) | const [inline] |
References vector.
FloatType maal::boost::Vector::norm1 | ( | void | ) | const [inline] |
Norm 1 sum( |xi| )
References vector.
FloatType maal::boost::Vector::normInfty | ( | void | ) | const [inline] |
Infinity norm: max( |xi| ).
References vector.
const FloatType& maal::boost::Vector::operator() | ( | const InternalVector::size_type | i | ) | const [inline] |
References vector.
FloatType& maal::boost::Vector::operator() | ( | const InternalVector::size_type | i | ) | [inline] |
References elementAt().
References multiply().
References multiply().
References addition().
References substraction().
Vector& maal::boost::Vector::opposite | ( | Vector & | res | ) | const [inline] |
References vector.
Vector maal::boost::Vector::opposite | ( | void | ) | const [inline] |
References opposite(), and size().
Referenced by opposite().
Vector& maal::boost::Vector::resize | ( | const InternalVector::size_type | nbRows, |
const bool | setZero = true |
||
) | [inline] |
References setZero(), and vector.
Referenced by maal::boost::Matrix::getDiagonal().
FloatType maal::boost::Vector::scalarProduct | ( | const Vector & | v2 | ) | const [inline] |
Scalar product: v1.v2 = sum( x1*x2 ).
References vector.
static FloatType maal::boost::Vector::scalarProduct | ( | const Vector & | v1, |
const Vector & | v2 | ||
) | [inline, static] |
Scalar product: v1.v2 = sum( x1*x2 ).
References vector.
Vector& maal::boost::Vector::setZero | ( | void | ) | [inline] |
unsigned int maal::boost::Vector::size | ( | void | ) | const [inline] |
References vector.
Referenced by addition(), crossProduct(), fill(), multiply(), opposite(), maal::boost::Matrix::setDiagonal(), and substraction().
static Vector& maal::boost::Vector::substraction | ( | const Vector & | v1, |
const Vector & | v2, | ||
Vector & | res | ||
) | [inline, static] |
References substraction().
Referenced by operator-=(), and substraction().
Vector maal::boost::Vector::substraction | ( | const Vector & | v2 | ) | const [inline] |
References size(), and substraction().
Referenced by substraction().
Vector& maal::boost::Vector::substraction | ( | const Vector & | v2, |
Vector & | res | ||
) | const [inline] |
References _checksize(), MAAL_CHECKVERBOSE, and vector.
FloatType maal::boost::Vector::sumSquare | ( | void | ) | const [inline] |
Not implemented yet.
References ML_NOT_IMPLEMENTED.
friend class Matrix [friend] |
std::ostream& operator<< | ( | std::ostream & | os, |
const Vector & | v1 | ||
) | [friend] |
std::istream& operator>> | ( | std::istream & | is, |
Vector & | v1 | ||
) | [friend] |
const bool maal::boost::Vector::AUTORESIZE = true [static, protected] |
Referenced by _resize(), and autoresize().
const bool maal::boost::Vector::CHECKRESIZE = true [static, protected] |
Referenced by _checksize(), and _checksizeVerb().
InternalVector* maal::boost::Vector::dynamicVector [protected] |
Referenced by ~Vector().
bool maal::boost::Vector::proprio [protected] |
Referenced by ~Vector().
InternalVector maal::boost::Vector::staticVector [protected] |
InternalVector& maal::boost::Vector::vector [protected] |
Referenced by accessToMotherLib(), addition(), crossProduct(), datablock(), elementAt(), extract(), fill(), initFromMotherLib(), multiply(), maal::boost::Matrix::multiply(), norm(), norm1(), normInfty(), operator()(), operator=(), opposite(), resize(), scalarProduct(), setZero(), size(), and substraction().