4#ifndef _da006854_5a52_4f29_8aa1_24be101f8935
5#define _da006854_5a52_4f29_8aa1_24be101f8935
8#include <initializer_list>
15template<std::
size_t N,
typename T>
25 Vector(std::initializer_list<T> && initializer);
39 constexpr std::size_t
size()
const {
return N; }
93 template<
typename Dest>
119template<std::
size_t N,
typename T>
123template<std::
size_t N,
typename T>
127template<std::
size_t N,
typename T>
131template<std::
size_t N,
typename T>
135template<std::
size_t N,
typename T>
139template<std::
size_t N,
typename T>
143template<std::
size_t N,
typename T>
147template<std::
size_t N,
typename T>
156template<std::
size_t N,
typename T>
A vector of arithmetic types.
Definition Vector.h:17
Vector< N, T > & operator%=(T right)
In-place remainder of division by a scalar.
Vector(std::initializer_list< T > &&initializer)
Vector< N, Dest > cast() const
Element-wise cast.
Vector< N, T > & operator=(Vector< N, T > const &)=default
const_iterator cbegin() const
Constant iterator to the first element.
std::array< T, N > Container
Definition Vector.h:19
Vector< N, T > & operator%=(Vector< N, T > const &right)
Elementwise in-place remainder of division.
const_iterator cend() const
Constant iterator after the last element.
Vector< N, T > operator-() const
Opposite operator.
Vector(Vector< N, T > const &)=default
typename Container::iterator iterator
Definition Vector.h:22
Vector< N, T > & operator+=(Vector< N, T > const &right)
Element-wise in-place addition.
Vector< N, T > const & operator+() const
Identity operator.
bool operator==(Vector< N, T > const &other) const
Test equality of all elements.
iterator end()
Iterator after the last element.
const_iterator begin() const
Constant iterator to the first element.
Vector< N, T > & operator/=(T right)
In-place division by a scalar.
Vector(Vector< N, T > &&)=default
T & operator[](std::size_t i)
Access an element.
iterator begin()
Iterator to the first element.
typename Container::const_iterator const_iterator
Definition Vector.h:21
const_iterator end() const
Constant iterator after the last element.
Vector< N, T > & operator=(Vector< N, T > &&)=default
T norm() const
Euclidean norm (i.e. L2 norm)
Vector< N, T > & operator*=(T scalar)
In-place multiplication by a scalar.
Vector< N, T > & operator-=(Vector< N, T > const &right)
Element-wise in-place subtraction.
bool operator!=(Vector< N, T > const &other) const
Test difference of any element.
T const & operator[](std::size_t i) const
Access an element.
constexpr std::size_t size() const
Return the number of elements.
Definition Vector.h:39
typename Container::value_type value_type
Definition Vector.h:20
Definition acceleration.h:17
Vector< N, T > operator*(Vector< N, T > left, T right)
Multiplication by a scalar.
Vector< N, T > operator+(Vector< N, T > left, Vector< N, T > const &right)
Element-wise addition.
std::ostream & operator<<(std::ostream &stream, Vector< N, T > const &v)
Textual representation.
Vector< N, T > operator/(Vector< N, T > left, T right)
Division by a scalar.
Vector< 2, long > Vector2l
2D vector of longs
Definition Vector.h:104
Vector< 3, double > Vector3d
3D vector of doubles
Definition Vector.h:110
Vector< 3, long > Vector3l
3D vector of longs
Definition Vector.h:113
Vector< 2, bool > Vector2b
2D vector of booleans
Definition Vector.h:107
Vector< 3, bool > Vector3b
3D vector of booleans
Definition Vector.h:116
Vector< N, T > operator%(Vector< N, T > left, Vector< N, T > const &right)
Element-wise remainder of division.
Vector< 2, double > Vector2d
2D vector of doubles
Definition Vector.h:101
Vector< N, T > operator-(Vector< N, T > left, Vector< N, T > const &right)
Element-wise subtraction.
msl::Vector< N, T > abs(msl::Vector< N, T > v)
Element-wise absolute value.