maal::boost::Vector Class Reference

Vector class that include the boost::ublas::vector. More...

#include <jrl/mal/boostvector.hh>

List of all members.

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 &copy)
 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.
VectorinitFromMotherLib (const InternalVector &bv)
 Copy the values and data of an existing boost vector.
Modifiors
unsigned int size (void) const
Vectorresize (const InternalVector::size_type nbRows, const bool setZero=true)
Vectorfill (const FloatType value)
VectorsetZero (void)
Vectoropposite (Vector &res) const
Vector opposite (void) const
Accessors

Access to an element, a block of element or the hidden double-array matrix.

const FloatTypedatablock (void) const
 Access to the C-style double matrix.
FloatTypedatablock (void)
 Access to the C-style double matrix.
const FloatTypeelementAt (const InternalVector::size_type row) const
 Access to the i-th element in R-only.
FloatTypeelementAt (const InternalVector::size_type row)
 Access to the i-th element in RW-mode.
Vectorextract (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

Each C-style function is implemented as a C++ operator.

VectorcrossProduct (const Vector &v2, Vector &res) const
Vector crossProduct (const Vector &v2)
Vector multiply (const Vector &v2) const
Vectormultiply (const Vector &v2, Vector &res) const
Vector multiply (const FloatType x) const
Vectormultiply (const FloatType x, Vector &res) const
Vector addition (const Vector &v2) const
Vectoraddition (const Vector &v2, Vector &res) const
Vector substraction (const Vector &v2) const
Vectorsubstraction (const Vector &v2, Vector &res) const
static VectorcrossProduct (const Vector &v1, const Vector &v2, Vector &res)
static Vectormultiply (const Vector &v1, const Vector &v2, Vector &res)
static Vectormultiply (const Vector &v1, const FloatType x, Vector &res)
static Vectoraddition (const Vector &v1, const Vector &v2, Vector &res)
static Vectorsubstraction (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)
Vectoroperator+= (const Vector &v1)
Vectoroperator-= (const Vector &v1)
Vectoroperator*= (const Vector &v1)
Vectoroperator*= (const FloatType x)
const FloatTypeoperator() (const InternalVector::size_type i) const
FloatTypeoperator() (const InternalVector::size_type i)
Vectoroperator= (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)

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

static bool maal::boost::Vector::_checksize ( const InternalVector &  vct1,
const InternalVector &  vct2 
) [inline, static, protected]
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]
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 crossProduct(), and size().

const FloatType* maal::boost::Vector::datablock ( void  ) const [inline]

Access to the C-style double matrix.

References vector, and VRAWDATA.

Access to the C-style double matrix.

References vector, and VRAWDATA.

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]

Extract a part of the vector.

Not implemented yet.

References extract().

Referenced by extract().

Vector& maal::boost::Vector::fill ( const FloatType  value) [inline]

References size(), and vector.

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]
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().

Vector& maal::boost::Vector::operator*= ( const Vector v1) [inline]

References multiply().

Vector& maal::boost::Vector::operator*= ( const FloatType  x) [inline]

References multiply().

Vector& maal::boost::Vector::operator+= ( const Vector v1) [inline]

References addition().

Vector& maal::boost::Vector::operator-= ( const Vector v1) [inline]

References substraction().

Vector& maal::boost::Vector::operator= ( const Vector v1) [inline]

References vector.

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]

References vector.

Referenced by resize().

unsigned int maal::boost::Vector::size ( void  ) const [inline]
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]
FloatType maal::boost::Vector::sumSquare ( void  ) const [inline]

Not implemented yet.

References ML_NOT_IMPLEMENTED.


Friends And Related Function Documentation

friend class Matrix [friend]
Vector operator* ( const Vector v1,
const Vector v2 
) [friend]
Vector operator* ( const Vector v1,
const FloatType  x 
) [friend]
Vector operator* ( const FloatType  x,
const Vector v1 
) [friend]
Vector operator+ ( const Vector v1,
const Vector v2 
) [friend]
Vector operator- ( const Vector v1,
const Vector v2 
) [friend]
Vector operator- ( const Vector v1) [friend]
std::ostream& operator<< ( std::ostream &  os,
const Vector v1 
) [friend]
std::istream& operator>> ( std::istream &  is,
Vector v1 
) [friend]

Member Data Documentation

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]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines