All Classes Namespaces Functions Typedefs Enumerations Pages
Public Member Functions | List of all members
fmatvec::Vector< Var, AT > Class Template Reference

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

#include <var_vector.h>

Inheritance diagram for fmatvec::Vector< Var, AT >:
fmatvec::Matrix< General, Var, Fixed< 1 >, AT >

Public Member Functions

 Vector ()
 Standard constructor. More...
 
 Vector (int m, Noinit ini)
 
 Vector (int m, Init ini=INIT, const AT &a=0)
 
 Vector (const char *str)
 String Constructor. More...
 
 Vector (const Vector< Var, AT > &x)
 Copy Constructor. More...
 
template<class Row >
 Vector (const Vector< Row, AT > &x)
 
template<class Type , class Row , class Col >
 Vector (const Matrix< Type, Row, Col, AT > &A)
 
Vector< Var, AT > & resize ()
 
Vector< Var, AT > & resize (int m, Noinit)
 
Vector< Var, AT > & resize (int m, Init ini=INIT, const AT &a=0)
 
Vector< Var, AT > & operator= (const Vector< Var, AT > &x)
 Assignment operator. More...
 
template<class Row >
Vector< Var, AT > & operator= (const Vector< Row, AT > &x)
 
template<class Row >
Vector< Var, AT > & operator<< (const Vector< Row, AT > &x)
 Copy operator. More...
 
AT & operator() (int i)
 Element operator. More...
 
const AT & operator() (int i) const
 Element operator. More...
 
AT & e (int i)
 
const AT & e (int i) const
 Element operator. More...
 
Vector< Var, AT > & init (const AT &a=0)
 Initialization. More...
 
Vector< Var, AT > & init (Init, const AT &a=0)
 
Vector< Var, AT > & init (Noinit, const AT &a=0)
 
int size () const
 Size. More...
 
int inc () const
 Increment. More...
 
 operator std::vector< AT > ()
 Cast to std::vector<AT>. More...
 
 Vector (std::vector< AT > v)
 std::vector<AT> Constructor. Constructs and initializes a vector with a std::vector<AT> object. More...
 
const RowVector< Var, AT > T () const
 
const Vector< Var, AT > operator() (const Range< Var, Var > &I) const
 
template<class Row >
void set (const Range< Var, Var > &I, const Vector< Row, AT > &x)
 
- Public Member Functions inherited from fmatvec::Matrix< General, Var, Fixed< 1 >, AT >
AT & operator() (int i, int j)
 Standard constructor. More...
 
const AT & operator() (int i, int j) const
 Element operator. More...
 
AT & e (int i, int j)
 
const AT & e (int i, int j) const
 
int rows () const
 Number of rows. More...
 
int cols () const
 Number of columns. More...
 
 operator std::vector< std::vector< AT > > ()
 Cast to std::vector<std::vector<AT> >. More...
 

Detailed Description

template<class AT>
class fmatvec::Vector< Var, 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< Var, AT >::Vector ( )
inline

Standard constructor.

Constructs a vector with no size.

template<class AT >
fmatvec::Vector< Var, 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< Var, AT >::Vector ( const Vector< Var, 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< Var, 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 >
const AT& fmatvec::Vector< Var, AT >::e ( int  i) const
inline

Element operator.

See e(int)

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

Increment.

Todo:
Docu
Returns
The increment.
template<class AT >
Vector< Var, AT > & fmatvec::Vector< Var, 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.
template<class AT >
fmatvec::Vector< Var, 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< Var, 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< Var, AT >::operator() ( int  i) const
inline

Element operator.

See operator()(int)

template<class AT >
template<class Row >
Vector< Var, AT > & fmatvec::Vector< Var, 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< Var, AT > & fmatvec::Vector< Var, AT >::operator= ( const Vector< Var, AT > &  x)
inline

Assignment operator.

Copies the vector given by x .

Parameters
xThe vector to be assigned.
Returns
A reference to the calling vector.
template<class AT >
int fmatvec::Vector< Var, AT >::size ( ) const
inline

Size.

Returns
The size of the vector.

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

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML