|
msl 1.3.0
|
A vector of arithmetic types.
#include <Vector.h>
Public Types | |
| using | Container = std::array< T, N > |
| Underlying container. | |
| using | value_type = typename Container::value_type |
| Stored value. | |
| using | const_iterator = typename Container::const_iterator |
| Constant iterator to values. | |
| using | iterator = typename Container::iterator |
| Iterator to values. | |
Public Member Functions | |
| Vector () | |
| Zero-initialize the values. | |
| Vector (std::initializer_list< T > &&initializer) | |
| Initialize the values to given sequence. | |
| ~Vector ()=default | |
| Vector (Vector< N, T > const &)=default | |
| Vector (Vector< N, T > &&)=default | |
| Vector< N, T > & | operator= (Vector< N, T > const &)=default |
| Vector< N, T > & | operator= (Vector< N, T > &&)=default |
| bool | operator== (Vector< N, T > const &other) const |
| Test equality of all elements. | |
| bool | operator!= (Vector< N, T > const &other) const |
| Test difference of any element. | |
| constexpr std::size_t | size () const |
| Return the number of elements. | |
| T const & | operator[] (std::size_t i) const |
| Access an element. | |
| T & | operator[] (std::size_t i) |
| Access an element. | |
| Vector< N, T > & | operator+= (Vector< N, T > const &right) |
| Element-wise in-place addition. | |
| Vector< N, T > & | operator-= (Vector< N, T > const &right) |
| Element-wise in-place subtraction. | |
| Vector< N, T > & | operator*= (T scalar) |
| In-place multiplication by a scalar. | |
| Vector< N, T > & | operator/= (T right) |
| In-place division by a scalar. | |
| Vector< N, T > & | operator%= (Vector< N, T > const &right) |
| Elementwise in-place remainder of division. | |
| Vector< N, T > & | operator%= (T right) |
| In-place remainder of division by a scalar. | |
| Vector< N, T > const & | operator+ () const |
| Identity operator. | |
| Vector< N, T > | operator- () const |
| Opposite operator. | |
| T | norm () const |
| Euclidean norm (i.e. L2 norm) | |
| const_iterator | begin () const |
| Constant iterator to the first element. | |
| const_iterator | end () const |
| Constant iterator after the last element. | |
| const_iterator | cbegin () const |
| Constant iterator to the first element. | |
| const_iterator | cend () const |
| Constant iterator after the last element. | |
| iterator | begin () |
| Iterator to the first element. | |
| iterator | end () |
| Iterator after the last element. | |
| template<typename Dest > | |
| Vector< N, Dest > | cast () const |
| Element-wise cast. | |
| using msl::Vector< N, T >::Container = std::array<T, N> |
Underlying container.
| using msl::Vector< N, T >::value_type = typename Container::value_type |
Stored value.
| using msl::Vector< N, T >::const_iterator = typename Container::const_iterator |
Constant iterator to values.
| using msl::Vector< N, T >::iterator = typename Container::iterator |
Iterator to values.
| msl::Vector< N, T >::Vector | ( | ) |
Zero-initialize the values.
| msl::Vector< N, T >::Vector | ( | std::initializer_list< T > && | initializer | ) |
Initialize the values to given sequence.
Extra values are skipped, missing values are 0-filled
|
default |
|
default |
|
default |
|
default |
|
default |
| bool msl::Vector< N, T >::operator== | ( | Vector< N, T > const & | other | ) | const |
Test equality of all elements.
| bool msl::Vector< N, T >::operator!= | ( | Vector< N, T > const & | other | ) | const |
Test difference of any element.
|
inlineconstexpr |
Return the number of elements.
| T const & msl::Vector< N, T >::operator[] | ( | std::size_t | i | ) | const |
Access an element.
| T & msl::Vector< N, T >::operator[] | ( | std::size_t | i | ) |
Access an element.
| Vector< N, T > & msl::Vector< N, T >::operator+= | ( | Vector< N, T > const & | right | ) |
Element-wise in-place addition.
| Vector< N, T > & msl::Vector< N, T >::operator-= | ( | Vector< N, T > const & | right | ) |
Element-wise in-place subtraction.
| Vector< N, T > & msl::Vector< N, T >::operator*= | ( | T | scalar | ) |
In-place multiplication by a scalar.
| Vector< N, T > & msl::Vector< N, T >::operator/= | ( | T | right | ) |
In-place division by a scalar.
| Vector< N, T > & msl::Vector< N, T >::operator%= | ( | Vector< N, T > const & | right | ) |
Elementwise in-place remainder of division.
| Vector< N, T > & msl::Vector< N, T >::operator%= | ( | T | right | ) |
In-place remainder of division by a scalar.
| Vector< N, T > const & msl::Vector< N, T >::operator+ | ( | ) | const |
Identity operator.
| Vector< N, T > msl::Vector< N, T >::operator- | ( | ) | const |
Opposite operator.
| T msl::Vector< N, T >::norm | ( | ) | const |
Euclidean norm (i.e. L2 norm)
| const_iterator msl::Vector< N, T >::begin | ( | ) | const |
Constant iterator to the first element.
| const_iterator msl::Vector< N, T >::end | ( | ) | const |
Constant iterator after the last element.
| const_iterator msl::Vector< N, T >::cbegin | ( | ) | const |
Constant iterator to the first element.
| const_iterator msl::Vector< N, T >::cend | ( | ) | const |
Constant iterator after the last element.
| iterator msl::Vector< N, T >::begin | ( | ) |
Iterator to the first element.
| iterator msl::Vector< N, T >::end | ( | ) |
Iterator after the last element.
| Vector< N, Dest > msl::Vector< N, T >::cast | ( | ) | const |
Element-wise cast.