|
(Note that these are not member functions.)
|
|
template<typename T , std::size_t N> |
| constexpr auto | abs (const Vector< T, N > &v) noexcept -> decltype(abs(T{}), Vector< T, N >{}) |
| | Absolute value function for vectors.
|
| |
|
template<std::size_t I, std::size_t N, typename T > |
| constexpr auto & | get (Vector< T, N > &v) noexcept |
| | Gets the specified element of the given collection.
|
| |
|
template<typename T , std::size_t N> |
| constexpr bool | operator!= (const Vector< T, N > &lhs, const Vector< T, N > &rhs) noexcept |
| | Inequality operator.
|
| |
| template<std::size_t N, typename T1 , typename T2 , typename OT = decltype(T1{} * T2{})> |
| constexpr std::enable_if_t< IsMultipliableV< T1, T2 > &&!IsVectorV< T1 >, Vector< OT, N > > | operator* (const T1 &s, const Vector< T2, N > &a) noexcept |
| | Multiplication operator for non-vector times vector. More...
|
| |
| template<std::size_t N, typename T1 , typename T2 , typename OT = decltype(T1{} * T2{})> |
| constexpr std::enable_if_t< IsMultipliableV< T1, T2 > &&!IsVectorV< T2 >, Vector< OT, N > > | operator* (const Vector< T1, N > &a, const T2 &s) noexcept |
| | Multiplication operator for vector times non-vector. More...
|
| |
| template<typename T1 , typename T2 , std::size_t A, std::size_t B, std::size_t C, typename OT = decltype(T1{} * T2{})> |
| constexpr std::enable_if_t< IsMultipliableV< T1, T2 >, Vector< Vector< OT, C >, A > > | operator* (const Vector< Vector< T1, B >, A > &lhs, const Vector< Vector< T2, C >, B > &rhs) noexcept |
| | Calculates the matrix product of the two given vector of vectors (matrices). More...
|
| |
|
template<typename T1 , typename T2 , std::size_t N> |
| constexpr std::enable_if_t< std::is_same_v< T1, decltype(T1{} *T2{})>, Vector< T1, N > & > | operator*= (Vector< T1, N > &lhs, const T2 rhs) noexcept |
| | Multiplication assignment operator.
|
| |
|
template<typename T , std::size_t N> |
| constexpr std::enable_if_t< std::is_same_v< T, decltype(T{}+T{})>, Vector< T, N > > | operator+ (Vector< T, N > lhs, const Vector< T, N > rhs) noexcept |
| | Adds two vectors component-wise.
|
| |
|
template<typename T , std::size_t N> |
| constexpr std::enable_if_t< std::is_same_v< T, decltype(+T{})>, Vector< T, N > > | operator+ (Vector< T, N > v) noexcept |
| | Unary plus operator.
|
| |
|
template<typename T , std::size_t N> |
| constexpr std::enable_if_t< std::is_same_v< T, decltype(T{}+T{})>, Vector< T, N > & > | operator+= (Vector< T, N > &lhs, const Vector< T, N > rhs) noexcept |
| | Increments the left hand side value by the right hand side value.
|
| |
|
template<typename T , std::size_t N> |
| constexpr std::enable_if_t< std::is_same_v< T, decltype(T{} - T{})>, Vector< T, N > > | operator- (Vector< T, N > lhs, const Vector< T, N > rhs) noexcept |
| | Subtracts two vectors component-wise.
|
| |
|
template<typename T , std::size_t N> |
| constexpr std::enable_if_t< std::is_same_v< T, decltype(-T{})>, Vector< T, N > > | operator- (Vector< T, N > v) noexcept |
| | Unary negation operator.
|
| |
|
template<typename T , std::size_t N> |
| constexpr std::enable_if_t< std::is_same_v< T, decltype(T{} - T{})>, Vector< T, N > & > | operator-= (Vector< T, N > &lhs, const Vector< T, N > rhs) noexcept |
| | Decrements the left hand side value by the right hand side value.
|
| |
|
template<std::size_t N, typename T1 , typename T2 , typename OT = decltype(T1{} / T2{})> |
| constexpr std::enable_if_t< IsDivisableV< T1, T2 > &&!IsVectorV< T2 >, Vector< OT, N > > | operator/ (const Vector< T1, N > &a, const T2 &s) noexcept |
| | Division operator.
|
| |
|
template<typename T1 , typename T2 , std::size_t N> |
| constexpr std::enable_if_t< std::is_same_v< T1, decltype(T1{}/T2{})>, Vector< T1, N > & > | operator/= (Vector< T1, N > &lhs, const T2 rhs) noexcept |
| | Division assignment operator.
|
| |
| template<std::size_t N0, class T0 , std::size_t N1, class T1 > |
| constexpr bool | operator< (const Vector< T0, N0 > &lhs, const Vector< T1, N1 > &rhs) noexcept |
| | Less than operator. More...
|
| |
|
template<typename T , std::size_t N> |
| std::ostream & | operator<< (::std::ostream &os, const Vector< T, N > &value) |
| | Output stream operator.
|
| |
|
template<typename T , std::size_t N> |
| constexpr bool | operator== (const Vector< T, N > &lhs, const Vector< T, N > &rhs) noexcept |
| | Equality operator.
|
| |
template<typename T, std::size_t N>
struct playrho::Vector< T, N >
Vector.
A constexpr and constructor enhanced std::array-like template class for types supporting the + , - , * , and / arithmetic operators ("arithmetic types" as defined by the IsArithmetic type trait) that itself comes with non-member arithmetic operator support making Vector instances arithmetic types as well.
- Note
- This type is trivially default constructible - i.e. default construction performs no actions (no initialization).
- See also
- IsArithmetic, Vector Traits