fmatvec  0.0.0
fmatvec::RowVector< Var, AT > Class Template Reference

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

#include <var_row_vector.h>

Inheritance diagram for fmatvec::RowVector< Var, AT >:
[legend]

Public Types

using iterator = AT *
 
using const_iterator = const AT *
 
using value_type = AT
 
- Public Types inherited from fmatvec::Matrix< General, Fixed< 1 >, Var, AT >
using value_type = AT
 
using shape_type = General
 

Public Member Functions

 RowVector ()
 Standard constructor. More...
 
 RowVector (RowVector< Var, AT > &&src) noexcept
 
RowVector< Var, AT > & operator= (RowVector< Var, AT > &&src) noexcept
 
 RowVector (Transpose, Vector< Var, AT > &&src)
 
 RowVector (int n, Noinit ini)
 
 RowVector (int n, Init ini=INIT, const AT &a=AT())
 
 RowVector (const RowVector< Var, AT > &x)
 Copy Constructor. More...
 
template<class Row >
 RowVector (const RowVector< Row, AT > &A)
 Copy Constructor. More...
 
template<class Type , class Row , class Col >
 RowVector (const Matrix< Type, Row, Col, AT > &A)
 Copy Constructor. More...
 
 RowVector (const char *str)
 String Constructor. More...
 
RowVector< Var, AT > & resize (int n, Noinit)
 
RowVector< Var, AT > & resize (int n, Init ini=INIT, const AT &a=AT())
 
RowVector< Var, AT > & operator= (const RowVector< Var, AT > &x)
 Assignment operator. More...
 
template<class Row >
RowVector< Var, AT > & operator= (const RowVector< Row, AT > &x)
 Assignment operator. More...
 
template<class Row >
RowVector< Var, AT > & operator<<= (const RowVector< Row, AT > &x)
 Rowvector assignment. More...
 
RowVector< Var, AT > & operator<<= (RowVector< Var, AT > &&src)
 
AT & operator() (int i)
 Element operator. More...
 
const AT & operator() (int i) const
 Element operator. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
AT & e (int i)
 
const AT & e (int i) const
 Element operator. More...
 
RowVector< Var, AT > & init (const AT &val=AT())
 Initialization. More...
 
RowVector< Var, AT > & init (Init, const AT &a=AT())
 
RowVector< Var, AT > & init (Noinit, const AT &a=AT())
 
constexpr int size () const
 Size. More...
 
int inc () const
 Increment. More...
 
 operator std::vector< AT > () const
 Cast to std::vector<AT>. More...
 
 RowVector (const std::vector< AT > &v)
 std::vector<AT> Constructor. Constructs and initializes a vector with a std::vector<AT> object. More...
 
- Public Member Functions inherited from fmatvec::Matrix< General, Fixed< 1 >, Var, 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 > > () const
 Cast to std::vector<std::vector<AT>>. More...
 

Static Public Attributes

static constexpr bool isVector {true}
 
- Static Public Attributes inherited from fmatvec::Matrix< General, Fixed< 1 >, Var, AT >
static constexpr bool isVector
 

Friends

class Vector< Var, AT >
 

Detailed Description

template<class AT>
class fmatvec::RowVector< 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

◆ RowVector() [1/6]

template<class AT >
fmatvec::RowVector< Var, AT >::RowVector ( )
inlineexplicit

Standard constructor.

Constructs a vector with no size.

◆ RowVector() [2/6]

template<class AT >
fmatvec::RowVector< Var, AT >::RowVector ( const RowVector< Var, AT > &  x)
inline

Copy Constructor.

Constructs a copy of the vector x.

Parameters
xThe vector that will be copied.

◆ RowVector() [3/6]

template<class AT >
template<class Row >
fmatvec::RowVector< Var, AT >::RowVector ( const RowVector< Row, AT > &  A)
inline

Copy Constructor.

Constructs a copy of the vector x.

Parameters
xThe vector that will be copied.

◆ RowVector() [4/6]

template<class AT >
template<class Type , class Row , class Col >
fmatvec::RowVector< Var, AT >::RowVector ( const Matrix< Type, Row, Col, AT > &  A)
inlineexplicit

Copy Constructor.

Constructs a copy of the vector x.

Parameters
xThe vector that will be copied.

◆ RowVector() [5/6]

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

RowVector<double> x("[3;1;2]");
Definition: matrix.h:170

constructs the vector

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

Parameters
strThe string the vector will be initialized with.

◆ RowVector() [6/6]

template<class AT >
fmatvec::RowVector< Var, AT >::RowVector ( const std::vector< AT > &  v)
inlineexplicit

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

◆ e()

template<class AT >
const AT & fmatvec::RowVector< Var, AT >::e ( int  i) const
inline

Element operator.

See e(int)

◆ inc()

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

Increment.

Todo:
Docu
Returns
The increment.

◆ init()

template<class AT >
RowVector< Var, AT > & fmatvec::RowVector< Var, AT >::init ( const AT &  val = AT())
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.

◆ operator std::vector< AT >()

template<class AT >
fmatvec::RowVector< Var, AT >::operator std::vector< AT >
inlineexplicit

Cast to std::vector<AT>.

Returns
The std::vector<AT> representation of the vector

◆ operator()() [1/2]

template<class AT >
AT & fmatvec::RowVector< 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 in debug mode.
See also
operator()(int) const

◆ operator()() [2/2]

template<class AT >
const AT & fmatvec::RowVector< Var, AT >::operator() ( int  i) const
inline

Element operator.

See operator()(int)

◆ operator<<=()

template<class AT >
template<class Row >
RowVector< Var, AT > & fmatvec::RowVector< Var, AT >::operator<<= ( const RowVector< Row, AT > &  x)
inline

Rowvector assignment.

Copies the vector given by x.

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

◆ operator=() [1/2]

template<class AT >
template<class Row >
RowVector< Var, AT > & fmatvec::RowVector< Var, AT >::operator= ( const RowVector< Row, AT > &  x)
inline

Assignment operator.

Copies the vector given by x .

Parameters
xThe vector to be assigned.
Returns
A reference to the calling vector.

◆ operator=() [2/2]

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

◆ size()

template<class AT >
constexpr int fmatvec::RowVector< Var, AT >::size ( ) const
inlineconstexpr

Size.

Returns
The size of the vector.

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