API Documentation
|
A fixed-size array with better performance compared to dynamic containers. More...
#include <Vector.hpp>
Public Member Functions | |
template<class t_new_type > | |
constexpr Vector< t_dims, t_new_type > | as () const |
template<uint01 t_new_dim, class t_new_type > | |
constexpr Vector< t_new_dim, t_new_type > | as () const |
template<uint01 t_new_dim, class t_new_type > | |
constexpr Vector< t_new_dim, t_new_type > | as (t_new_type extra_fill_value) const |
template<LocationValues t_max_min> | |
constexpr uint01 | dimensionalIndex () const |
template<LocationValues t_max_min> | |
constexpr t_type | dimensionalValue () const |
template<class t_magnitude_type = t_type> | |
constexpr t_magnitude_type | magnitude () const |
constexpr t_type | magnitudeSquared () const |
template<class t_norm_type = t_type> | |
constexpr Vector< t_dims, t_norm_type > | normalized (Vector< t_dims, t_norm_type > value_if_nan=Constant< Vector< t_dims, t_norm_type > >::Invalid) const |
template<uint01 tdims = t_dims, typename = typename std::enable_if<tdims == 1>::type> | |
constexpr | operator const t_type & () const |
template<uint01 tdims = t_dims, typename = typename std::enable_if<tdims == 1>::type> | |
constexpr | operator t_type & () |
constexpr Vector< t_dims, t_type > | operator- () const |
constexpr Vector< t_dims, t_type > & | operator= (const t_type &scaler) |
constexpr const t_type & | operator[] (const uint01 dimension_index) const |
constexpr t_type & | operator[] (uint01 dimension_index) |
constexpr t_type | product () const |
constexpr t_type | sum () const |
constexpr | Vector () noexcept |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &prefix, typename std::enable_if< tdims >=2, const Vector< t_dims - 1, t_type > & >::type vector) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &prefix_a, const t_type &prefix_b, typename std::enable_if< tdims >=3, const Vector< tdims - 1, t_type > & >::type vector) |
constexpr | Vector (const t_type &scaler) noexcept |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, const t_type &y, const t_type &z, const t_type &w, const t_type &v, const t_type &u, const t_type &t, const t_type &s, typename std::enable_if< tdims==9, const t_type & >::type r) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, const t_type &y, const t_type &z, const t_type &w, const t_type &v, typename std::enable_if< tdims==6, const t_type & >::type u) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, const t_type &y, const t_type &z, const t_type &w, typename std::enable_if< tdims==5, const t_type & >::type v) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, const t_type &y, const t_type &z, typename std::enable_if< tdims==4, const t_type & >::type w) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, const t_type &y, const typename std::enable_if< tdims==3, const t_type & >::type z) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const t_type &x, typename std::enable_if< tdims==2, const t_type & >::type y) |
constexpr | Vector (const t_type(&vector)[t_dims]) |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const Vector< getMax(tdims - 2, 0), t_type > &vector, const t_type &suffix_a, typename std::enable_if< tdims >=3, const t_type & >::type suffix_b) |
template<class t_vec_type > | |
constexpr | Vector (const Vector< t_dims, t_vec_type > &vector) noexcept |
template<uint01 tdims = t_dims> | |
constexpr | Vector (const Vector< tdims - 1, t_type > &vector, typename std::enable_if< tdims >=2, const t_type & >::type suffix) |
Static Public Member Functions | |
static constexpr uint01 | NumberOfDimensions () |
static constexpr t_type | Type () |
Protected Attributes | |
t_type | m_values [t_dims] |
A fixed-size array with better performance compared to dynamic containers.
Class: Vector
An element of a vector space. An element of the real coordinate space Rn basis vector, one of a set of vectors (a "basis") that, in linear combination, can represent every vector in a given vector space column vector or row vector, a one-dimensional matrix often representing the solution of a system of linear equations coordinate vector, in linear algebra, an explicit representation of an element of any abstract vector space. Used as the basis for Vertex class, Ray class, Point class etc. Simply stores x,y,z etc in linear memory.
t_dims: The number of dimensions used in a vector. t_type: The numerical type used to store the value in each dimension. This may be a bool, float, integer, angle, or even another vector for multidimensional groupings.
Author: Tyler Parke
Date: 2017-09-13
|
inlineexplicitconstexprnoexcept |
Copy constructor.
Author: Tyler Parke
Date: 2017-11-13
Parameters: vector - The vector to copy to this vector.
|
inlineexplicitconstexprnoexcept |
Sets values in each dimension to the value in the passed in scaler
Author: Tyler Parke
Date: 2017-09-13
Parameters: scaler - The scaler to set all dimensions to.
|
inlineconstexpr |
Sets values in each dimension to the respective value in the passed in scaler. Note the Vector must be 2 dimensions to use this function.
Author: Tyler Parke
Date: 2017-09-13
Parameters: x - The scaler to set the 0th or X dimension to y - The scaler to set the 1st or Y dimension to
|
inlineconstexpr |
Sets values in each dimension to the respective value in the passed in scaler. Note the Vector must be 3 dimensions to use this function.
Author: Tyler Parke
Date: 2017-09-13
Parameters: x - The scaler to set the 0th or X dimension to y - The scaler to set the 1st or Y dimension to z - The scaler to set the 2nd or Z dimension to
|
inlineconstexpr |
Sets values in each dimension to the respective value in the passed in scaler. Note the Vector must be 4 dimensions to use this function.
Author: Tyler Parke
Date: 2017-09-13
Parameters: x - The scaler to set the 0th or X dimension to y - The scaler to set the 1st or Y dimension to z - The scaler to set the 2nd or Z dimension to w - The scaler to set the 3rd or W dimension to
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineexplicitconstexpr |
Given a container of statically determined array, transforms it to a vector
Author: Tyler Parke
Date: 2017-11-13
Parameters: vector - The vector container object.
|
inlineconstexpr |
Vectors. Creates a vector where the prefix vector is combined with the suffix scalers.
Author: Tyler Parke
Date: 2017-11-13
Parameters: vector - The vector. postfix - The postfix.
|
inlineconstexpr |
Vectors. Creates a vector where the prefix vector is combined with the suffix scalers.
Author: Tyler Parke
Date: 2017-11-13
Parameters: vector - The vector. postfix_a - The postfix a. postfix_b - The postfix b.
|
inlineconstexpr |
Vectors. Creates a vector where the prefix scaler is combined with the suffix vector.
Author: Tyler Parke
Date: 2017-11-13
Parameters: prefix - The prefix. vector - The vector.
|
inlineconstexpr |
Vectors. Creates a vector where the prefix scaler values are combined with the suffix vector.
Author: Tyler Parke
Date: 2017-11-13
Parameters: prefix_a - The first prefix. prefix_b - The second prefix. vector - The vector.
|
inlineconstexpr |
As the given extra fill value.
Author: Tyler Parke
Date: 2017-11-13
Parameters: extra_fill_value - (Optional) The extra fill value, or value to set dimensions extra that may be created when t_new_dim > t_dim.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinenodiscardconstexpr |
Used with template arguments MAX or MIN, Gets the dimensional index for the value that is either max or min.
Author: Tyler Parke
Date: 2017-11-13
|
inlinenodiscardconstexpr |
Used with template arguments MAX or MIN, Gets the dimensional value for the value that is either max or min.
Author: Tyler Parke
Date: 2017-11-13
|
inlineconstexpr |
Vectors are commonly used to model forces such as wind, sea current, gravity, and electromagnetism. Calculating the magnitude of vectors is essential for all sorts of problems where forces collide.
Magnitude is defined as the length of a vector. The notation for absolute value. Thus magnitude is the same as length of vector.
Author: Tyler Parke
Date: 2017-11-13
|
inlinenodiscardconstexpr |
Vectors are commonly used to model forces such as wind, sea current, gravity, and electromagnetism. Calculating the magnitude of vectors is essential for all sorts of problems where forces collide.
Magnitude is defined as the length of a vector. The notation for absolute value. Thus magnitude is the same as length of vector.
Author: Tyler Parke
Date: 2017-11-13
|
inlineconstexpr |
Gets the normalized, or unit length representation of this vector.
Author: Tyler Parke
Date: 2017-11-13
|
inlinestaticconstexpr |
Number of dimensions in this vector class.
Author: Tyler Parke
Date: 2017-11-13
|
inlineconstexpr |
|
inlineconstexpr |
For Single dimensional objects, they may also be considered a scaler, thus allow implicit conversion from a vector to a scaler when the dimension of the vector is 1.
Author: Tyler Parke
Date: 2017-11-13
Negation operator.
Author: Tyler Parke
Date: 2017-11-13
|
inlineconstexpr |
Assignment operator.
Author: Tyler Parke
Date: 2017-11-13
Parameters: vector - The vector to set this vector to.
Author: Tyler Parke
Date: 2017-11-13
Parameters: scaler - The scaler to set each dimension to.
|
inlineconstexpr |
|
inlineconstexpr |
Accesses the value of a certain dimension.
Author: Tyler Parke
Date: 2017-11-13
Parameters: dimension_index - The dimensional index of the the value we wish to retrieve.
|
inlinenodiscardconstexpr |
Returns the product, or value of each dimension multiplied together.
Author: Tyler Parke
Date: 2017-11-13
|
inlinenodiscardconstexpr |
Returns the sum, or value of each dimension added together.
Author: Tyler Parke
Date: 2017-11-13
|
inlinestaticconstexpr |
Returns the type of this class. Useful for using decltype to instantiate a member of this class in a static environment.
Author: Tyler Parke
Date: 2017-11-13
|
protected |
The values[t dims].