Public Member Functions
fmatvec::Vector< Ref, AT > Class Template Reference

This is a vector class of general shape in dense storage format. More...

#include <vector.h>

Inheritance diagram for fmatvec::Vector< Ref, AT >:
fmatvec::Matrix< General, Ref, Ref, AT >

List of all members.

Public Member Functions

 Vector ()
 Standard constructor.
 Vector (int m, Noinit ini)
 Vector (int m, Init ini=INIT, const AT &a=0)
 Vector (int m, AT *ele)
 Regular Constructor.
 Vector (const char *str)
 String Constructor.
 Vector (const Vector< Ref, AT > &x)
 Copy Constructor.
template<class Row >
 Vector (const Vector< Row, AT > &x)
template<class Type , class Row , class Col >
 Vector (const Matrix< Type, Row, Col, AT > &x)
Vector< Ref, AT > & resize ()
Vector< Ref, AT > & resize (int m, Noinit)
Vector< Ref, AT > & resize (int m, Init ini=INIT, const AT &a=0)
template<class Row >
Vector< Ref, AT > & operator<< (const Vector< Row, AT > &x)
 Copy operator.
Vector< Ref, AT > & operator>> (const Vector< Ref, AT > &x)
 Reference operator.
Vector< Ref, AT > & operator>> (const Matrix< General, Ref, Ref, AT > &A)
 Reference operator.
Vector< Ref, AT > & operator= (const Vector< Ref, AT > &x)
 Assignment operator.
template<class Row >
Vector< Ref, AT > & operator= (const Vector< Row, AT > &x)
AT & operator() (int i)
 Element operator.
const AT & operator() (int i) const
 Element operator.
AT & er (int i)
const AT & er (int i) const
AT & et (int i)
const AT & et (int i) const
AT & e (int i)
const AT & e (int i) const
Vector< Ref, AT > & init (const AT &a=0)
 Initialization.
Vector< Ref, AT > & init (Init, const AT &a=0)
Vector< Ref, AT > & init (Noinit, const AT &a=0)
int size () const
 Size.
int inc () const
 Increment.
Vector< Ref, AT > copy () const
 Vector duplicating.
Vector< Ref, AT > operator() (int i1, int i2)
 Subvector operator.
const Vector< Ref, AT > operator() (int i1, int i2) const
 Subvector operator.
Vector< Ref, AT > operator() (const Index &I)
 Subvector operator.
const Vector< Ref, AT > operator() (const Index &I) const
 Subvector operator.
 operator std::vector< AT > ()
 Cast to std::vector<AT>.
 Vector (std::vector< AT > v)
 std::vector<AT> Constructor. Constructs and initializes a vector with a std::vector<AT> object.
RowVector< Ref, AT > T ()
const RowVector< Ref, AT > T () const

Detailed Description

template<class AT>
class fmatvec::Vector< Ref, AT >

This is a vector class of general shape in dense storage format.

Template class Vector of type General<Ref,Ref>, id. shape is general and storage form is dense. The template parameter AT defines the atomic type of the vector. Valid types are int, float, double, complex<float> and complex<double>


Constructor & Destructor Documentation

template<class AT >
fmatvec::Vector< Ref, AT >::Vector ( ) [inline]

Standard constructor.

Constructs a vector with no size.

template<class AT >
fmatvec::Vector< Ref, AT >::Vector ( int  m,
AT *  ele 
) [inline]

Regular Constructor.

Constructs a vector of size m with the pyhsical memory given by ele_;

Parameters:
mThe size.
eleThe physical memory the vector will point to.
template<class AT >
fmatvec::Vector< Ref, AT >::Vector ( const char *  str) [inline]

String Constructor.

Constructs and initializes a vector with a string in a matlab-like notation. The entries are seperated by semicolons. For example

 Vector<double> x("[3;1;2]");

constructs the vector

\[ x=\begin{pmatrix}3\\ 1 \\ 2\end{pmatrix} \]

Parameters:
strThe string the vector will be initialized with.
template<class AT >
fmatvec::Vector< Ref, AT >::Vector ( const Vector< Ref, AT > &  x) [inline]

Copy Constructor.

Constructs a reference to the vector x.

Attention:
The physical memory of the vector x will not be copied, only referenced.
Parameters:
xThe vector that will be referenced.
template<class AT >
fmatvec::Vector< Ref, AT >::Vector ( std::vector< AT >  v) [inline]

std::vector<AT> Constructor. Constructs and initializes a vector with a std::vector<AT> object.

Parameters:
vThe std::vector<AT> the vector will be initialized with.

Member Function Documentation

template<class AT >
Vector< Ref, AT > fmatvec::Vector< Ref, AT >::copy ( ) const [inline]

Vector duplicating.

The calling vector returns a deep copy of itself.

Returns:
The duplicate of the calling vector.

Reimplemented from fmatvec::Matrix< General, Ref, Ref, AT >.

template<class AT >
int fmatvec::Vector< Ref, AT >::inc ( ) const [inline]

Increment.

Todo:
Docu
Returns:
The increment.
template<class AT >
Vector< Ref, AT > & fmatvec::Vector< Ref, AT >::init ( const AT &  a = 0) [inline]

Initialization.

Initializes all elements of the calling vector with the value given by a.

Parameters:
aValue all elements will be initialized with.
Returns:
A reference to the calling vector.

Reimplemented from fmatvec::Matrix< General, Ref, Ref, AT >.

template<class AT >
fmatvec::Vector< Ref, AT >::operator std::vector< AT > ( ) [inline]

Cast to std::vector<AT>.

Returns:
The std::vector<AT> representation of the vector
template<class AT >
AT& fmatvec::Vector< Ref, AT >::operator() ( int  i) [inline]

Element operator.

Returns a reference to the i-th element.

Parameters:
iThe i-th element.
Returns:
A reference to the element x(i).
Remarks:
The bounds are checked by default. To change this behavior, define FMATVEC_NO_BOUNDS_CHECK.
See also:
operator()(int) const
template<class AT >
const AT& fmatvec::Vector< Ref, AT >::operator() ( int  i) const [inline]

Element operator.

See operator()(int)

template<class AT >
Vector< Ref, AT > fmatvec::Vector< Ref, AT >::operator() ( int  i1,
int  i2 
) [inline]

Subvector operator.

Returns a subvector of the calling vector.

Attention:
The subvector and the calling vector will share the same physical memory.
Parameters:
i1The starting element.
i2The ending element.
Returns:
A subvector of the calling vector.

Reimplemented from fmatvec::Matrix< General, Ref, Ref, AT >.

template<class AT >
const Vector< Ref, AT > fmatvec::Vector< Ref, AT >::operator() ( int  i1,
int  i2 
) const [inline]

Subvector operator.

See operator()(int,int);

Reimplemented from fmatvec::Matrix< General, Ref, Ref, AT >.

template<class AT >
Vector< Ref, AT > fmatvec::Vector< Ref, AT >::operator() ( const Index &  I) [inline]

Subvector operator.

Returns a subvector of the calling vector.

Attention:
The subvector and the calling vector will share the same physical memory.
Parameters:
IIndex containing the starting and the ending element.
Returns:
A subvector of the calling vector.

Reimplemented from fmatvec::Matrix< General, Ref, Ref, AT >.

References fmatvec::Index::end(), and fmatvec::Index::start().

template<class AT >
const Vector< Ref, AT > fmatvec::Vector< Ref, AT >::operator() ( const Index &  I) const [inline]
template<class AT >
template<class Row >
Vector< Ref, AT > & fmatvec::Vector< Ref, AT >::operator<< ( const Vector< Row, AT > &  x) [inline]

Copy operator.

Copies the vector given by x.

Parameters:
xThe vector to be copied.
Returns:
A reference to the calling vector.
template<class AT >
Vector< Ref, AT > & fmatvec::Vector< Ref, AT >::operator= ( const Vector< Ref, AT > &  x) [inline]

Assignment operator.

Copies the vector given by x by calling operator<<().

Parameters:
xThe vector to be assigned.
Returns:
A reference to the calling vector.
Remarks:
To call operator>>() by default, define FMATVEC_NO_DEEP_ASSIGNMENT
See also:
operator<<(), operator>>()

References size().

template<class AT >
Vector< Ref, AT > & fmatvec::Vector< Ref, AT >::operator>> ( const Vector< Ref, AT > &  x) [inline]

Reference operator.

References the vector given by x.

Parameters:
xThe vector to be referenced.
Returns:
A reference to the calling vector.
template<class AT >
Vector< Ref, AT > & fmatvec::Vector< Ref, AT >::operator>> ( const Matrix< General, Ref, Ref, AT > &  A) [inline]

Reference operator.

References the matrix given by A.

Parameters:
AThe matrix to be referenced.
Returns:
A reference to the calling matrix.

Reimplemented from fmatvec::Matrix< General, Ref, Ref, AT >.

References fmatvec::Matrix< General, Ref, Ref, AT >::cols(), and fmatvec::Matrix< General, Ref, Ref, AT >::rows().

template<class AT >
int fmatvec::Vector< Ref, AT >::size ( ) const [inline]

Size.

Returns:
The size of the vector.

Referenced by fmatvec::operator+(), and operator=().


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