lin
Public Types | Public Member Functions | List of all members
lin::Vector< T, N, MN > Class Template Reference

Generic vector. More...

#include <lin/core/types/vector.hpp>

Inheritance diagram for lin::Vector< T, N, MN >:
lin::internal::Tensor< Vector< T, N, MN > > lin::internal::Base< Vector< T, N, MN > > lin::internal::Mapping< Vector< T, N, MN > > lin::internal::Dimensions< Vector< T, N, MN > > lin::internal::Stream< Vector< T, N, MN > >

Public Types

typedef internal::traits< Vector< T, N, MN > > Traits
 Traits information for this type. More...
 
typedef internal::vector_traits< Vector< T, N, MN > > VectorTraits
 Vector traits information for this type. More...
 
- Public Types inherited from lin::internal::Tensor< Vector< T, N, MN > >
typedef traits< Vector< T, N, MN > > Traits
 Traits information for this type. More...
 
- Public Types inherited from lin::internal::Base< Vector< T, N, MN > >
typedef traits< Vector< T, N, MN > > Traits
 Traits information for this type. More...
 
- Public Types inherited from lin::internal::Mapping< Vector< T, N, MN > >
typedef traits< Vector< T, N, MN > > Traits
 Traits information for this type. More...
 
- Public Types inherited from lin::internal::Stream< Vector< T, N, MN > >
typedef traits< Vector< T, N, MN > > Traits
 Traits information for this type. More...
 

Public Member Functions

constexpr Vector (Vector< T, N, MN > const &)=default
 
constexpr Vector (Vector< T, N, MN > &&)=default
 
constexpr Vector< T, N, MN > & operator= (Vector< T, N, MN > const &)=default
 
constexpr Vector< T, N, MN > & operator= (Vector< T, N, MN > &&)=default
 
constexpr Vector (size_t n)
 Constructs a vector with zero initialized elements are the requested length. More...
 
template<typename U >
constexpr Vector (size_t n, std::initializer_list< U > const &list)
 Constructs a vector with elements initialized from an initializer list and the requested length. More...
 
constexpr void resize (size_t n)
 Resizes the vector's length. More...
 
- Public Member Functions inherited from lin::internal::Tensor< Vector< T, N, MN > >
constexpr Tensor (Tensor< Vector< T, N, MN > > const &)=default
 
constexpr Tensor (Tensor< Vector< T, N, MN > > &&)=default
 
constexpr Tensor ()
 Constructs a new tensor with zeros initialized elements and the largest allowable dimensions. More...
 
constexpr Tensor (size_t r, size_t c)
 Constructs a tensor with zeros initialized elements and the requested dimensions. More...
 
constexpr Tensor (std::initializer_list< T > const &list)
 Constructs a tensor with elements initialized from an initializer list. More...
 
constexpr Tensor (size_t r, size_t c, std::initializer_list< T > const &list)
 Constructs a tensor with elements initialized from an initializer list and the requested dimensions. More...
 
constexpr Tensor (Stream< C > const &s)
 Constructs a tensor by copying in dimensions and elements from another tensor stream. More...
 
constexpr Tensor< Vector< T, N, MN > > & operator= (Tensor< Vector< T, N, MN > > const &)=default
 
constexpr Tensor< Vector< T, N, MN > > & operator= (Tensor< Vector< T, N, MN > > &&)=default
 
constexpr Traits::elem_tdata ()
 Retrives a pointer to the element backing array. More...
 
- Public Member Functions inherited from lin::internal::Base< Vector< T, N, MN > >
constexpr Base (Base< Vector< T, N, MN > > const &)=default
 
constexpr Base (Base< Vector< T, N, MN > > &&)=default
 
constexpr Base< Vector< T, N, MN > > & operator= (Base< Vector< T, N, MN > > const &)=default
 
constexpr Base< Vector< T, N, MN > > & operator= (Base< Vector< T, N, MN > > &&)=default
 
constexpr Traits::elem_tdata ()
 Retrives a pointer to the element backing array. More...
 
constexpr Traits::elem_t const * data () const
 Retrives a constant pointer to the element backing array. More...
 
constexpr Traits::elem_toperator() (size_t i, size_t j)
 Provides read and write access to tensor elements. More...
 
constexpr Traits::elem_toperator() (size_t i)
 Provides read and write access to tensor elements. More...
 
- Public Member Functions inherited from lin::internal::Mapping< Vector< T, N, MN > >
constexpr Mapping (Mapping< Vector< T, N, MN > > const &)=default
 
constexpr Mapping (Mapping< Vector< T, N, MN > > &&)=default
 
constexpr Mapping< Vector< T, N, MN > > & operator= (Mapping< Vector< T, N, MN > > const &)=default
 
constexpr Mapping< Vector< T, N, MN > > & operator= (Mapping< Vector< T, N, MN > > &&)=default
 
constexpr Vector< T, N, MN > & operator= (std::initializer_list< T > const &list)
 Copy an initializer list's elements into the tensor's elements. More...
 
constexpr Vector< T, N, MN > & operator= (Stream< C > const &s)
 Copy another tensor's elements into this tenosr's elements. More...
 
constexpr Traits::elem_toperator() (size_t i, size_t j)
 Provides read and write access to tensor elements. More...
 
constexpr Traits::elem_t operator() (size_t i, size_t j) const
 Provides read only access to tensor elements. More...
 
constexpr Traits::elem_toperator() (size_t i)
 Provides read and write access to tensor elements. More...
 
constexpr Traits::elem_t operator() (size_t i) const
 Provides read only access to tensor elements. More...
 
constexpr Traits::elem_toperator[] (size_t i)
 Provides read and write access to tensor elements. More...
 
constexpr Traits::elem_t operator[] (size_t i) const
 Provides read only access to tensor elements. More...
 
- Public Member Functions inherited from lin::internal::Stream< Vector< T, N, MN > >
constexpr Stream (Stream< Vector< T, N, MN > > const &)=default
 
constexpr Stream (Stream< Vector< T, N, MN > > &&)=default
 
constexpr Stream< Vector< T, N, MN > > & operator= (Stream< Vector< T, N, MN > > const &)=default
 
constexpr Stream< Vector< T, N, MN > > & operator= (Stream< Vector< T, N, MN > > &&)=default
 
constexpr size_t rows () const
 
constexpr size_t cols () const
 
constexpr size_t size () const
 
constexpr Traits::elem_t operator() (size_t i, size_t j) const
 Provides read only access to tensor elements. More...
 
constexpr Traits::elem_t operator() (size_t i) const
 Provides read only access to tensor elements. More...
 
constexpr Traits::elem_t operator[] (size_t i) const
 Provides read only access to tensor elements. More...
 
constexpr Traits::eval_t eval () const
 Forces evaluation of this stream to a value backed type. More...
 
- Public Member Functions inherited from lin::internal::Dimensions< Vector< T, N, MN > >
constexpr Dimensions (Dimensions< Vector< T, N, MN > > const &)=default
 
constexpr Dimensions (Dimensions< Vector< T, N, MN > > &&)=default
 
constexpr Dimensions< Vector< T, N, MN > > & operator= (Dimensions< Vector< T, N, MN > > const &)=default
 
constexpr Dimensions< Vector< T, N, MN > > & operator= (Dimensions< Vector< T, N, MN > > &&)=default
 
constexpr size_t rows () const
 
constexpr size_t cols () const
 
constexpr void resize (size_t r, size_t c)
 Resizes a tensor's dimensions. More...
 

Additional Inherited Members

- Protected Member Functions inherited from lin::internal::Stream< Vector< T, N, MN > >
constexpr Vector< T, N, MN > & derived ()
 
constexpr Vector< T, N, MN >const & derived () const
 

Detailed Description

template<typename T, size_t N, size_t MN = N>
class lin::Vector< T, N, MN >

Generic vector.

Template Parameters
TVector element type.
NNumber of elements at compile time (i.e. number of rows).
MNMaximum number of elements (i.e. maximum number of rows).

The template parameters specify the vector's traits. The traits must qualify this type as a column vector.

See also
internal::traits
internal::is_col_vector

Member Typedef Documentation

template<typename T , size_t N, size_t MN = N>
typedef internal::traits<Vector<T, N, MN> > lin::Vector< T, N, MN >::Traits

Traits information for this type.

See also
internal::traits
template<typename T , size_t N, size_t MN = N>
typedef internal::vector_traits<Vector<T, N, MN> > lin::Vector< T, N, MN >::VectorTraits

Vector traits information for this type.

See also
internal::vector_traits

Constructor & Destructor Documentation

template<typename T , size_t N, size_t MN = N>
constexpr lin::Vector< T, N, MN >::Vector ( size_t  n)
inline

Constructs a vector with zero initialized elements are the requested length.

Parameters
nInitial length.

Lin assertion errors will be triggered if the requested length isn't possible given the vector's traits.

See also
internal::has_fixed_rows
internal::has_strictly_bounded_rows
template<typename T , size_t N, size_t MN = N>
template<typename U >
constexpr lin::Vector< T, N, MN >::Vector ( size_t  n,
std::initializer_list< U > const &  list 
)
inline

Constructs a vector with elements initialized from an initializer list and the requested length.

Parameters
nInitial length.
listInitializer list.

Lin assertion errors will be triggered if the requested length isn't possible given the vector's traits.

The initializer list must also be assignable to the vector.

See also
internal::Mapping::operator=(std::initializer_list<T> const &)

Member Function Documentation

template<typename T , size_t N, size_t MN = N>
constexpr void lin::Vector< T, N, MN >::resize ( size_t  n)
inline

Resizes the vector's length.

Parameters
nLength.

Lin assertion errors will be triggered if the requested length isn't possible given the vector's traits.

See also
internal::has_fixed_rows
internal::has_strictly_bounded_rows

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