Public Member Functions
fmatvec::Vector< 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< AT >:
fmatvec::Matrix< General, AT >

List of all members.

Public Member Functions

 Vector ()
 Standard constructor.
 Vector (int m)
 Regular Constructor.
 Vector (int m, AT *ele)
 Regular Constructor.
 Vector (int m, Initialization ini, const AT &a=0)
 Regular Constructor.
 Vector (const char *str)
 String Constructor.
 Vector (const Vector< AT > &x)
 Copy Constructor.
 Vector (const Matrix< General, AT > &x)
 Copy Constructor.
Vector< AT > & operator<< (const Vector< AT > &x)
 Copy operator.
Vector< AT > & operator>> (const Vector< AT > &x)
 Reference operator.
Vector< AT > & resize (int n)
 Vector resizing.
Vector< AT > & resize (int n, Initialization ini, const AT &a=0)
 Vector resizing.
Vector< AT > & operator= (const Vector< AT > &x)
 Assignment operator.
AT & operator() (int i)
 Element operator.
const AT & operator() (int i) const
 Element operator.
Vector< AT > & init (const AT &a)
 Initialization.
int size () const
 Size.
int inc () const
 Increment.
Vector< AT > copy () const
 Vector duplicating.
Vector< AT > operator() (int i1, int i2)
 Subvector operator.
const Vector< AT > operator() (int i1, int i2) const
 Subvector operator.
Vector< AT > operator() (const Index &I)
 Subvector operator.
const Vector< 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< AT > T ()
const RowVector< AT > T () const
- Public Member Functions inherited from fmatvec::Matrix< General, AT >
 Matrix ()
 Standard constructor.
 Matrix (int m_, int n_)
 Regular Constructor.
 Matrix (int m_, int n_, Initialization ini, const AT &a=0)
 Regular Constructor.
 Matrix (const Matrix< General, AT > &A)
 Copy Constructor.
 Matrix (int m_, int n_, AT *ele_)
 Regular Constructor.
 Matrix (const char *str)
 String Constructor.
 ~Matrix ()
 Destructor.
Matrix< General, AT > & resize (int m_, int n_)
 Matrix resizing.
Matrix< General, AT > & resize (int m_, int n_, Initialization ini, const AT &a=0)
 Matrix resizing.
Matrix< General, AT > & operator= (const Matrix< General, AT > &A)
 Assignment operator.
template<class T >
Matrix< General, AT > & operator<< (const Matrix< T, AT > &A)
 Copy operator.
Matrix< General, AT > & operator>> (const Matrix< General, AT > &A)
 Reference operator.
AT * operator() ()
 Pointer operator.
const AT * operator() () const
 Pointer operator.
int rows () const
 Number of rows.
int cols () const
 Number of columns.
int ldim () const
 Leading dimension.
bool transposed () const
 Transposed status.
const CBLAS_TRANSPOSE blasTrans () const
 Transposed status.
const CBLAS_ORDER blasOrder () const
 Storage convention.
Matrix< General, AT > operator() (int i1, int j1, int i2, int j2)
 Submatrix operator.
const Matrix< General, AT > operator() (int i1, int j1, int i2, int j2) const
 Submatrix operator.
Matrix< General, AT > operator() (const Index &I, const Index &J)
 Submatrix operator.
const Matrix< General, AT > operator() (const Index &I, const Index &J) const
 Submatrix operator.
Vector< AT > col (int i)
 Column operator.
const Vector< AT > col (int i) const
 Column operator.
RowVector< AT > row (int i)
 Row operator.
const RowVector< AT > row (int i) const
 Row operator.
Matrix< General, AT > & resize ()
 Matrix unsizing.
 operator std::vector< std::vector< AT > > ()
 Cast to std::vector<std::vector<AT> >.
 Matrix (std::vector< std::vector< AT > > m)
 std::vector<std::vector<AT> > Constructor. Constructs and initializes a matrix with a std::vector<std::vector<AT> > object. An assert checks for constant length of each row.
template<class Type >
Matrix< General, AT > & operator<< (const Matrix< Type, AT > &A)

Detailed Description

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

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

Template class Vector of type General, 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< AT >::Vector ( )
inline

Standard constructor.

Constructs a vector with no size.

template<class AT>
fmatvec::Vector< AT >::Vector ( int  m)
inline

Regular Constructor.

Constructs a vector of size m.

Parameters:
mThe size.
Remarks:
The vector will be initialised to zero by default. This default behavior can be changed by defining FMATVEC_NO_INITIALIZATION.
template<class AT>
fmatvec::Vector< 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< AT >::Vector ( int  m,
Initialization  ini,
const AT &  a = 0 
)
inline

Regular Constructor.

Constructs a vector of size m. The vector will be initialized to the value given by a (default 0), if ini is set to INIT. If init is set to NONINIT, the vector will not be initialized.

Parameters:
mThe size.
iniINIT means initialization, NONINIT means no initialization.
aThe value, the vector will be initialized with (default 0)
template<class AT>
fmatvec::Vector< 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
    @code 
    Vector<double> x("[3;1;2]");
    \endcode
    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< AT >::Vector ( const Vector< 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< AT >::Vector ( const Matrix< General, AT > &  x)
inlineexplicit
template<class AT >
fmatvec::Vector< AT >::Vector ( std::vector< AT >  v)

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.

References fmatvec::Vector< AT >::size().


Member Function Documentation

template<class AT >
Vector< AT > fmatvec::Vector< AT >::copy ( ) const

Vector duplicating.

The calling vector returns a deep copy of itself.

Returns:
The duplicate of the calling vector.

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

template<class AT>
int fmatvec::Vector< AT >::inc ( ) const
inline

Increment.

Todo:
Docu
Returns:
The increment.
template<class AT >
Vector< AT > & fmatvec::Vector< AT >::init ( const AT &  a)

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, AT >.

template<class AT >
fmatvec::Vector< AT >::operator std::vector< AT > ( )

Cast to std::vector<AT>.

Returns:
The std::vector<AT> representation of the vector
template<class AT>
AT& fmatvec::Vector< 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< AT >::operator() ( int  i) const
inline

Element operator.

See operator()(int)

template<class AT >
Vector< AT > fmatvec::Vector< AT >::operator() ( int  i1,
int  i2 
)

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, AT >.

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

Subvector operator.

See operator()(int,int);

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

template<class AT >
Vector< AT > fmatvec::Vector< AT >::operator() ( const Index &  I)

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, AT >.

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

template<class AT >
const Vector< AT > fmatvec::Vector< AT >::operator() ( const Index &  I) const

Subvector operator.

See operator()(const Index&)

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

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

template<class AT >
Vector< AT > & fmatvec::Vector< AT >::operator<< ( const Vector< AT > &  x)

Copy operator.

Copies the vector given by x.

Parameters:
xThe vector to be copied.
Returns:
A reference to the calling vector.

References fmatvec::Vector< AT >::resize(), and fmatvec::Vector< AT >::size().

Referenced by fmatvec::Vector< AT >::operator=().

template<class AT>
Vector<AT>& fmatvec::Vector< AT >::operator= ( const Vector< 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 fmatvec::Vector< AT >::operator<<(), and fmatvec::Vector< AT >::operator>>().

template<class AT >
Vector< AT > & fmatvec::Vector< AT >::operator>> ( const Vector< AT > &  x)

Reference operator.

References the vector given by x.

Parameters:
xThe vector to be referenced.
Returns:
A reference to the calling vector.

Referenced by fmatvec::Vector< AT >::operator=().

template<class AT>
Vector<AT>& fmatvec::Vector< AT >::resize ( int  n)
inline

Vector resizing.

Resizes the vector to size n.

Parameters:
nThe size.
Returns:
A reference to the calling vector.
Remarks:
The vector will be initialised to zero by default. To change this behavior, define FMATVEC_NO_INITIALIZATION.

References fmatvec::Matrix< General, AT >::resize().

Referenced by fmatvec::Vector< AT >::operator<<().

template<class AT>
Vector<AT>& fmatvec::Vector< AT >::resize ( int  n,
Initialization  ini,
const AT &  a = 0 
)
inline

Vector resizing.

Resizes the vector to size n. The vector will be initialized to the value given by a (default 0), if ini is set to INIT. If init is set to NONINIT, the vector will not be initialized.

Parameters:
nThe size.
iniINIT means initialization, NONINIT means no initialization.
aThe value, the vector will be initialized with (default 0)
Returns:
A reference to the calling vector.

References fmatvec::Matrix< General, AT >::resize().

template<class AT>
int fmatvec::Vector< AT >::size ( ) const
inline

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