Antkeeper
0.0.1
|
n-dimensional vector. More...
#include <vector.hpp>
Public Types | |
using | element_type = T |
Element type. More... | |
Public Member Functions | |
Element access | |
constexpr element_type & | operator[] (std::size_t i) noexcept |
Returns a reference to the element at a given index. More... | |
constexpr const element_type & | operator[] (std::size_t i) const noexcept |
Returns a reference to the element at a given index. More... | |
constexpr element_type & | front () noexcept |
Returns a reference to the first element. More... | |
constexpr const element_type & | front () const noexcept |
Returns a reference to the first element. More... | |
constexpr element_type & | back () noexcept |
Returns a reference to the last element. More... | |
constexpr const element_type & | back () const noexcept |
Returns a reference to the last element. More... | |
constexpr element_type * | data () noexcept |
Returns a pointer to the element array. More... | |
constexpr const element_type * | data () const noexcept |
Returns a pointer to the element array. More... | |
constexpr element_type & | x () noexcept |
Returns a reference to the first element. More... | |
constexpr const element_type & | x () const noexcept |
Returns a reference to the first element. More... | |
constexpr element_type & | y () noexcept |
Returns a reference to the second element. More... | |
constexpr const element_type & | y () const noexcept |
Returns a reference to the second element. More... | |
constexpr element_type & | z () noexcept |
Returns a reference to the third element. More... | |
constexpr const element_type & | z () const noexcept |
Returns a reference to the third element. More... | |
Iterators | |
constexpr element_type * | begin () noexcept |
Returns an iterator to the first element. More... | |
constexpr const element_type * | begin () const noexcept |
Returns an iterator to the first element. More... | |
constexpr const element_type * | cbegin () const noexcept |
Returns an iterator to the first element. More... | |
constexpr element_type * | end () noexcept |
Returns an iterator to the element following the last element. More... | |
constexpr const element_type * | end () const noexcept |
Returns an iterator to the element following the last element. More... | |
constexpr const element_type * | cend () const noexcept |
Returns an iterator to the element following the last element. More... | |
constexpr std::reverse_iterator< element_type * > | rbegin () noexcept |
Returns a reverse iterator to the first element of the reversed vector. More... | |
constexpr std::reverse_iterator< const element_type * > | rbegin () const noexcept |
Returns a reverse iterator to the first element of the reversed vector. More... | |
constexpr std::reverse_iterator< const element_type * > | crbegin () const noexcept |
Returns a reverse iterator to the first element of the reversed vector. More... | |
constexpr std::reverse_iterator< element_type * > | rend () noexcept |
Returns a reverse iterator to the element following the last element of the reversed vector. More... | |
constexpr std::reverse_iterator< const element_type * > | rend () const noexcept |
Returns a reverse iterator to the element following the last element of the reversed vector. More... | |
constexpr std::reverse_iterator< const element_type * > | crend () const noexcept |
Returns a reverse iterator to the element following the last element of the reversed vector. More... | |
Capacity | |
constexpr std::size_t | size () const noexcept |
Returns the number of elements in the vector. More... | |
Public Attributes | |
element_type | elements [N] |
Array of elements. More... | |
Static Public Attributes | |
static constexpr std::size_t | element_count = N |
Number of elements. More... | |
Conversion | |
template<class U > | |
constexpr | operator vector< U, N > () const noexcept |
Type-casts the elements of this vector using static_cast . More... | |
template<std::size_t M> | |
constexpr | operator vector< T, M > () const noexcept |
Size-casts this vector to a vector with a different number of elements. More... | |
Constants | |
static constexpr vector | zero () noexcept |
Returns a zero vector, where every element is equal to zero. More... | |
static constexpr vector | one () noexcept |
Returns a vector of ones, where every element is equal to one. More... | |
static constexpr vector | infinity () noexcept |
Returns a vector of infinities, where every element is equal to infinity. More... | |
n-dimensional vector.
T | Element type. |
N | Number of elements. |
Definition at line 43 of file vector.hpp.
using math::vector< T, N >::element_type = T |
Element type.
Definition at line 46 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the last element.
Definition at line 142 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the last element.
Definition at line 138 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the first element.
Definition at line 221 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the first element.
Definition at line 217 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the first element.
Definition at line 225 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the element following the last element.
Definition at line 243 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the first element of the reversed vector.
Definition at line 261 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the element following the last element of the reversed vector.
Definition at line 279 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a pointer to the element array.
Definition at line 156 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a pointer to the element array.
Definition at line 152 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the element following the last element.
Definition at line 239 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the element following the last element.
Definition at line 235 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the first element.
Definition at line 128 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the first element.
Definition at line 124 of file vector.hpp.
|
inlinestaticconstexprnoexcept |
Returns a vector of infinities, where every element is equal to infinity.
Definition at line 342 of file vector.hpp.
|
inlinestaticconstexprnoexcept |
Returns a vector of ones, where every element is equal to one.
Definition at line 324 of file vector.hpp.
|
inlineexplicitconstexprnoexcept |
Size-casts this vector to a vector with a different number of elements.
Casting to a greater number of elements causes new elements to be set to zero.
M | Target number of elements. |
Definition at line 92 of file vector.hpp.
|
inlineexplicitconstexprnoexcept |
Type-casts the elements of this vector using static_cast
.
U | Target element type. |
Definition at line 72 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the element at a given index.
i | Index of an element. |
i
. Definition at line 114 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the element at a given index.
i | Index of an element. |
i
. Definition at line 110 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the first element of the reversed vector.
Definition at line 257 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the first element of the reversed vector.
Definition at line 253 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the element following the last element of the reversed vector.
Definition at line 275 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the element following the last element of the reversed vector.
Definition at line 271 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns the number of elements in the vector.
Definition at line 293 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the first element.
Definition at line 169 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the first element.
Definition at line 164 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the second element.
Definition at line 185 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the second element.
Definition at line 180 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the third element.
Definition at line 201 of file vector.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the third element.
Definition at line 196 of file vector.hpp.
|
inlinestaticconstexprnoexcept |
Returns a zero vector, where every element is equal to zero.
Definition at line 306 of file vector.hpp.
|
staticconstexpr |
Number of elements.
Definition at line 49 of file vector.hpp.
element_type math::vector< T, N >::elements[N] |
Array of elements.
Definition at line 52 of file vector.hpp.