Tiny Vector Matrix library using Expression Templates | Sourceforge Project Page |
#include <tvmet/Vector.h>
Public Types | |
enum | { Size = Sz } |
Dimensions. More... | |
enum | { ops_assign = Size, ops = ops_assign, use_meta = ops < 8 ? true : false } |
Complexity counter. More... | |
typedef T | value_type |
Data type of the tvmet::Vector. | |
typedef T & | reference |
Reference type of the tvmet::Vector data elements. | |
typedef const T & | const_reference |
const reference type of the tvmet::Vector data elements. | |
typedef T * | iterator |
STL iterator interface. | |
typedef const T * | const_iterator |
STL const_iterator interface. | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
STL reverse iterator interface. | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
STL const reverse iterator interface. | |
typedef VectorConstReference< T, Size > | ConstReference |
Public Member Functions | |
iterator | begin () |
STL iterator interface. | |
iterator | end () |
STL iterator interface. | |
const_iterator | begin () const |
STL const_iterator interface. | |
const_iterator | end () const |
STL const_iterator interface. | |
reverse_iterator | rbegin () |
STL reverse iterator interface reverse begin. | |
const_reverse_iterator | rbegin () const |
STL const reverse iterator interface reverse begin. | |
reverse_iterator | rend () |
STL reverse iterator interface reverse end. | |
const_reverse_iterator | rend () const |
STL const reverse iterator interface reverse end. | |
value_type | front () |
STL vector front element. | |
const_reference | front () const |
STL vector const front element. | |
value_type | back () |
STL vector back element. | |
const_reference | back () const |
STL vector const back element. | |
~Vector () | |
Default Destructor. | |
Vector () | |
Default Constructor. | |
Vector (const Vector &rhs) | |
Copy Constructor, not explicit! | |
template<class InputIterator> | |
Vector (InputIterator first, InputIterator last) | |
Constructor with STL iterator interface. | |
template<class InputIterator> | |
Vector (InputIterator first, std::size_t sz) | |
Constructor with STL iterator interface. | |
Vector (value_type rhs) | |
Constructor with initializer for all elements. | |
Vector (value_type x0, value_type x1) | |
Default Constructor with initializer list. | |
Vector (value_type x0, value_type x1, value_type x2) | |
Default Constructor with initializer list. | |
Vector (value_type x0, value_type x1, value_type x2, value_type x3) | |
Default Constructor with initializer list. | |
Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4) | |
Default Constructor with initializer list. | |
Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4, value_type x5) | |
Default Constructor with initializer list. | |
Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4, value_type x5, value_type x6) | |
Default Constructor with initializer list. | |
Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4, value_type x5, value_type x6, value_type x7) | |
Default Constructor with initializer list. | |
Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4, value_type x5, value_type x6, value_type x7, value_type x8) | |
Default Constructor with initializer list. | |
Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4, value_type x5, value_type x6, value_type x7, value_type x8, value_type x9) | |
Default Constructor with initializer list. | |
template<class E> | |
Vector (const XprVector< E, Size > &e) | |
Construct a vector by expression. | |
CommaInitializer< Vector, Size > | operator= (value_type rhs) |
Assign a value_type on array, this can be used for a single value or a comma separeted list of values. | |
value_type *__restrict | data () |
const value_type *__restrict | data () const |
value_type &__restrict | operator() (std::size_t i) |
value_type | operator() (std::size_t i) const |
value_type &__restrict | operator[] (std::size_t i) |
value_type | operator[] (std::size_t i) const |
ConstReference | const_ref () const |
Return a const Reference of the internal data. | |
XprVector< ConstReference, Size > | as_expr () const |
Return the vector as const expression. | |
template<class T2, class Assign> | |
void | assign_to (Vector< T2, Size > &dest, const Assign &assign_fn) const |
assign this to a vector expression using the functional assign_fn. | |
template<class T2> | |
Vector & | operator= (const Vector< T2, Size > &rhs) |
assign a given Vector element wise to this vector. | |
template<class E> | |
Vector & | operator= (const XprVector< E, Size > &rhs) |
assign a given XprVector element wise to this vector. | |
Vector & | operator+= (value_type) |
Vector & | operator-= (value_type) |
Vector & | operator *= (value_type) |
Vector & | operator/= (value_type) |
Vector & | operator%= (std::size_t) |
Vector & | operator^= (std::size_t) |
Vector & | operator &= (std::size_t) |
Vector & | operator|= (std::size_t) |
Vector & | operator<<= (std::size_t) |
Vector & | operator>>= (std::size_t) |
template<class T2> | |
Vector & | M_add_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | M_sub_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | M_mul_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | M_div_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | M_mod_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | M_xor_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | M_and_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | M_or_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | M_shl_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | M_shr_eq (const Vector< T2, Size > &) |
template<class E> | |
Vector & | M_add_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | M_sub_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | M_mul_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | M_div_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | M_mod_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | M_xor_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | M_and_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | M_or_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | M_shl_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | M_shr_eq (const XprVector< E, Size > &) |
template<class T2> | |
Vector & | alias_assign (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | alias_add_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | alias_sub_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | alias_mul_eq (const Vector< T2, Size > &) |
template<class T2> | |
Vector & | alias_div_eq (const Vector< T2, Size > &) |
template<class E> | |
Vector & | alias_assign (const XprVector< E, Size > &) |
template<class E> | |
Vector & | alias_add_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | alias_sub_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | alias_mul_eq (const XprVector< E, Size > &) |
template<class E> | |
Vector & | alias_div_eq (const XprVector< E, Size > &) |
std::ostream & | print_xpr (std::ostream &os, std::size_t l=0) const |
Member function for expression level printing. | |
std::ostream & | print_on (std::ostream &os) const |
Member function for printing internal data. | |
Static Public Member Functions | |
static bool | empty () |
STL vector empty() - returns allways false. | |
static std::size_t | size () |
The size of the vector. | |
static std::size_t | max_size () |
STL vector max_size() - returns allways Size. | |
static Info | info () |
Get an info object of this vector. | |
Private Member Functions | |
Vector & | assign_value (value_type rhs) |
This is a helper for assigning a comma separated initializer list. | |
Static Private Member Functions | |
template<class Dest, class Src, class Assign> | |
static void | do_assign (dispatch< true >, Dest &dest, const Src &src, const Assign &assign_fn) |
Wrapper for meta assign. | |
template<class Dest, class Src, class Assign> | |
static void | do_assign (dispatch< false >, Dest &dest, const Src &src, const Assign &assign_fn) |
Wrapper for loop assign. | |
Private Attributes | |
value_type | m_data [Size] |
The data of vector self. | |
Friends | |
class | CommaInitializer |
Classes | |
struct | Info |
Structure for info printing as Vector<T, Size>. More... |
typedef T tvmet::Vector< T, Sz >::value_type |
Data type of the tvmet::Vector.
typedef T& tvmet::Vector< T, Sz >::reference |
Reference type of the tvmet::Vector data elements.
typedef const T& tvmet::Vector< T, Sz >::const_reference |
const reference type of the tvmet::Vector data elements.
typedef T* tvmet::Vector< T, Sz >::iterator |
STL iterator interface.
typedef const T* tvmet::Vector< T, Sz >::const_iterator |
STL const_iterator interface.
typedef std::reverse_iterator<iterator> tvmet::Vector< T, Sz >::reverse_iterator |
STL reverse iterator interface.
typedef std::reverse_iterator<const_iterator> tvmet::Vector< T, Sz >::const_reverse_iterator |
STL const reverse iterator interface.
typedef VectorConstReference<T, Size> tvmet::Vector< T, Sz >::ConstReference |
anonymous enum |
anonymous enum |
tvmet::Vector< T, Sz >::~Vector | ( | ) | [inline] |
Default Destructor.
tvmet::Vector< T, Sz >::Vector | ( | ) | [inline, explicit] |
Default Constructor.
The allocated memory region isn't cleared. If you want a clean use the constructor argument zero.
tvmet::Vector< T, Sz >::Vector | ( | const Vector< T, Sz > & | rhs | ) | [inline] |
Copy Constructor, not explicit!
tvmet::Vector< T, Sz >::Vector | ( | InputIterator | first, | |
InputIterator | last | |||
) | [inline, explicit] |
Constructor with STL iterator interface.
The data will be copied into the vector self, there isn't any stored reference to the array pointer.
tvmet::Vector< T, Sz >::Vector | ( | InputIterator | first, | |
std::size_t | sz | |||
) | [inline, explicit] |
Constructor with STL iterator interface.
The data will be copied into the vector self, there isn't any stored reference to the array pointer.
tvmet::Vector< T, Sz >::Vector | ( | value_type | rhs | ) | [inline, explicit] |
Constructor with initializer for all elements.
tvmet::Vector< T, Sz >::Vector | ( | value_type | x0, | |
value_type | x1 | |||
) | [inline, explicit] |
Default Constructor with initializer list.
tvmet::Vector< T, Sz >::Vector | ( | value_type | x0, | |
value_type | x1, | |||
value_type | x2 | |||
) | [inline, explicit] |
Default Constructor with initializer list.
tvmet::Vector< T, Sz >::Vector | ( | value_type | x0, | |
value_type | x1, | |||
value_type | x2, | |||
value_type | x3 | |||
) | [inline, explicit] |
Default Constructor with initializer list.
tvmet::Vector< T, Sz >::Vector | ( | value_type | x0, | |
value_type | x1, | |||
value_type | x2, | |||
value_type | x3, | |||
value_type | x4 | |||
) | [inline, explicit] |
Default Constructor with initializer list.
tvmet::Vector< T, Sz >::Vector | ( | value_type | x0, | |
value_type | x1, | |||
value_type | x2, | |||
value_type | x3, | |||
value_type | x4, | |||
value_type | x5 | |||
) | [inline, explicit] |
Default Constructor with initializer list.
tvmet::Vector< T, Sz >::Vector | ( | value_type | x0, | |
value_type | x1, | |||
value_type | x2, | |||
value_type | x3, | |||
value_type | x4, | |||
value_type | x5, | |||
value_type | x6 | |||
) | [inline, explicit] |
Default Constructor with initializer list.
tvmet::Vector< T, Sz >::Vector | ( | value_type | x0, | |
value_type | x1, | |||
value_type | x2, | |||
value_type | x3, | |||
value_type | x4, | |||
value_type | x5, | |||
value_type | x6, | |||
value_type | x7 | |||
) | [inline, explicit] |
Default Constructor with initializer list.
tvmet::Vector< T, Sz >::Vector | ( | value_type | x0, | |
value_type | x1, | |||
value_type | x2, | |||
value_type | x3, | |||
value_type | x4, | |||
value_type | x5, | |||
value_type | x6, | |||
value_type | x7, | |||
value_type | x8 | |||
) | [inline, explicit] |
Default Constructor with initializer list.
tvmet::Vector< T, Sz >::Vector | ( | value_type | x0, | |
value_type | x1, | |||
value_type | x2, | |||
value_type | x3, | |||
value_type | x4, | |||
value_type | x5, | |||
value_type | x6, | |||
value_type | x7, | |||
value_type | x8, | |||
value_type | x9 | |||
) | [inline, explicit] |
Default Constructor with initializer list.
tvmet::Vector< T, Sz >::Vector | ( | const XprVector< E, Size > & | e | ) | [inline, explicit] |
Construct a vector by expression.
iterator tvmet::Vector< T, Sz >::begin | ( | ) | [inline] |
STL iterator interface.
iterator tvmet::Vector< T, Sz >::end | ( | ) | [inline] |
STL iterator interface.
const_iterator tvmet::Vector< T, Sz >::begin | ( | ) | const [inline] |
STL const_iterator interface.
const_iterator tvmet::Vector< T, Sz >::end | ( | ) | const [inline] |
STL const_iterator interface.
reverse_iterator tvmet::Vector< T, Sz >::rbegin | ( | ) | [inline] |
STL reverse iterator interface reverse begin.
const_reverse_iterator tvmet::Vector< T, Sz >::rbegin | ( | ) | const [inline] |
STL const reverse iterator interface reverse begin.
reverse_iterator tvmet::Vector< T, Sz >::rend | ( | ) | [inline] |
STL reverse iterator interface reverse end.
const_reverse_iterator tvmet::Vector< T, Sz >::rend | ( | ) | const [inline] |
STL const reverse iterator interface reverse end.
value_type tvmet::Vector< T, Sz >::front | ( | ) | [inline] |
STL vector front element.
const_reference tvmet::Vector< T, Sz >::front | ( | ) | const [inline] |
STL vector const front element.
value_type tvmet::Vector< T, Sz >::back | ( | ) | [inline] |
STL vector back element.
const_reference tvmet::Vector< T, Sz >::back | ( | ) | const [inline] |
STL vector const back element.
static bool tvmet::Vector< T, Sz >::empty | ( | ) | [inline, static] |
STL vector empty() - returns allways false.
static std::size_t tvmet::Vector< T, Sz >::size | ( | ) | [inline, static] |
The size of the vector.
static std::size_t tvmet::Vector< T, Sz >::max_size | ( | ) | [inline, static] |
STL vector max_size() - returns allways Size.
CommaInitializer<Vector, Size> tvmet::Vector< T, Sz >::operator= | ( | value_type | rhs | ) | [inline] |
Assign a value_type on array, this can be used for a single value or a comma separeted list of values.
value_type* __restrict tvmet::Vector< T, Sz >::data | ( | ) | [inline] |
const value_type* __restrict tvmet::Vector< T, Sz >::data | ( | ) | const [inline] |
value_type& __restrict tvmet::Vector< T, Sz >::operator() | ( | std::size_t | i | ) | [inline] |
value_type tvmet::Vector< T, Sz >::operator() | ( | std::size_t | i | ) | const [inline] |
value_type& __restrict tvmet::Vector< T, Sz >::operator[] | ( | std::size_t | i | ) | [inline] |
value_type tvmet::Vector< T, Sz >::operator[] | ( | std::size_t | i | ) | const [inline] |
ConstReference tvmet::Vector< T, Sz >::const_ref | ( | ) | const [inline] |
Return a const Reference of the internal data.
XprVector<ConstReference, Size> tvmet::Vector< T, Sz >::as_expr | ( | ) | const [inline] |
Return the vector as const expression.
static void tvmet::Vector< T, Sz >::do_assign | ( | dispatch< true > | , | |
Dest & | dest, | |||
const Src & | src, | |||
const Assign & | assign_fn | |||
) | [inline, static, private] |
Wrapper for meta assign.
static void tvmet::Vector< T, Sz >::do_assign | ( | dispatch< false > | , | |
Dest & | dest, | |||
const Src & | src, | |||
const Assign & | assign_fn | |||
) | [inline, static, private] |
Wrapper for loop assign.
void tvmet::Vector< T, Sz >::assign_to | ( | Vector< T2, Size > & | dest, | |
const Assign & | assign_fn | |||
) | const [inline] |
assign this to a vector expression using the functional assign_fn.
Vector& tvmet::Vector< T, Sz >::operator= | ( | const Vector< T2, Size > & | rhs | ) | [inline] |
assign a given Vector element wise to this vector.
The operator=(const Vector&) is compiler generated.
Vector& tvmet::Vector< T, Sz >::operator= | ( | const XprVector< E, Size > & | rhs | ) | [inline] |
assign a given XprVector element wise to this vector.
Vector& tvmet::Vector< T, Sz >::assign_value | ( | value_type | rhs | ) | [inline, private] |
This is a helper for assigning a comma separated initializer list.
It's equal to Vector& operator=(value_type) which does replace it.
Vector< T, Sz > & tvmet::Vector< T, Sz >::operator+= | ( | value_type | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::operator-= | ( | value_type | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::operator *= | ( | value_type | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::operator/= | ( | value_type | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::operator%= | ( | std::size_t | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::operator^= | ( | std::size_t | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::operator &= | ( | std::size_t | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::operator|= | ( | std::size_t | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::operator<<= | ( | std::size_t | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::operator>>= | ( | std::size_t | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::M_add_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::M_sub_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::M_mul_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::M_div_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::M_mod_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::M_xor_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::M_and_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::M_or_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::M_shl_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::M_shr_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::M_add_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::M_sub_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::M_mul_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::M_div_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::M_mod_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::M_xor_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::M_and_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::M_or_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::M_shl_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::M_shr_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::alias_assign | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::alias_add_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::alias_sub_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::alias_mul_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T1, Sz > & tvmet::Vector< T1, Sz >::alias_div_eq | ( | const Vector< T2, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::alias_assign | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::alias_add_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::alias_sub_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::alias_mul_eq | ( | const XprVector< E, Size > & | ) | [inline] |
Vector< T, Sz > & tvmet::Vector< T, Sz >::alias_div_eq | ( | const XprVector< E, Size > & | ) | [inline] |
static Info tvmet::Vector< T, Sz >::info | ( | ) | [inline, static] |
Get an info object of this vector.
std::ostream & tvmet::Vector< T, Sz >::print_xpr | ( | std::ostream & | os, | |
std::size_t | l = 0 | |||
) | const [inline] |
Member function for expression level printing.
std::ostream & tvmet::Vector< T, Sz >::print_on | ( | std::ostream & | os | ) | const [inline] |
Member function for printing internal data.
friend class CommaInitializer [friend] |
value_type tvmet::Vector< T, Sz >::m_data[Size] [private] |
The data of vector self.
Author: |