![]() |
NDEVR
API Documentation
|
A fixed-size array with N dimensions used as the basis for geometric and mathematical types. More...
Inherited by Bounds< 3, fltp08 >, Bounds< 2, fltp04 >, Bounds< 2, fltp08 >, Bounds< 2, uint04 >, Bounds< 1, uint04 >, Bounds< 1, fltp08 >, Bounds< t_dims, fltp08 >, Bounds< 3, fltp04 >, Bounds< 1, uint08 >, Bounds< t_dims, fltp04 >, Bounds< 1, int >, LineSegment< 3, fltp08 >, LineSegment< t_dims, fltp08 >, LineSegment< 2, fltp08 >, LineSegment< t_dims, fltp04 >, LineSegment< 2, fltp04 >, Matrix< fltp08 >, , , , , , , Triangle< 3, fltp08 >, Vertex< 3, fltp04 >, Vertex< t_dims, fltp04 >, Vertex< t_dims, fltp08 >, Vertex< t_dims, uint04 >, Vertex< 3, fltp08 >, Vertex< 2, fltp08 >, Vertex< 3, uint04 >, Vertex< t_dims, uint08 >, and Vertex< 2, fltp04 >.
Public Member Functions | |
| 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) |
| Creates a vector where the prefix scaler is combined with the suffix 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) |
| Creates a vector where the prefix scaler values are combined with the suffix 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, typename std::enable_if< tdims==4, const t_type & >::type w) |
| Sets values in each dimension to the respective value in the passed in scaler. | |
| 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) |
| Sets values in each dimension to the respective value in the passed in scaler. | |
| template<uint01 tdims = t_dims> | |
| constexpr | Vector (const t_type &x, typename std::enable_if< tdims==2, const t_type & >::type y) |
| Sets values in each dimension to the respective value in the passed in scaler. | |
| constexpr | Vector (const t_type(&vector)[t_dims]) |
| Given a container of statically determined array, transforms it to a vector. | |
| 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) |
| Creates a vector where the prefix vector is combined with the suffix scalers. | |
| 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) |
| Creates a vector where the prefix vector is combined with the suffix scalers. | |
| template<class t_new_type> | |
| constexpr decltype(auto) | as () const |
| Returns the vector as a new time of vector. | |
| template<LocationValues t_max_min> | |
| constexpr uint01 | dimensionalIndex () const |
| Used with template arguments MAX or MIN, Gets the dimensional index for the value that is either max or min. | |
| template<LocationValues t_max_min> | |
| constexpr t_type | dimensionalValue () const |
| Used with template arguments MAX or MIN, Gets the dimensional value for the value that is either max or min. | |
| template<class t_magnitude_type = t_type> | |
| constexpr t_magnitude_type | magnitude () const |
| Vectors are commonly used to model forces such as wind, sea current, gravity, and electromagnetism. | |
| constexpr t_type | magnitudeSquared () const |
| Vectors are commonly used to model forces such as wind, sea current, gravity, and electromagnetism. | |
| 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 |
| Gets the normalized, or unit length representation of this vector. | |
| template<uint01 tdims = t_dims, typename = typename std::enable_if<tdims == 1>::type> | |
| constexpr | operator t_type & () |
| 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. | |
| constexpr Vector< t_dims, t_type > | operator- () const |
| Negation operator. | |
| constexpr Vector< t_dims, t_type > & | operator= (const t_type &scaler) |
| Assignment operator. | |
| constexpr t_type & | operator[] (uint01 dimension_index) |
| Accesses the value of a certain dimension. | |
| constexpr t_type | product () const |
| Returns the product, or value of each dimension multiplied together. | |
| constexpr t_type | sum () const |
| Returns the sum, or value of each dimension added together. | |
Static Public Member Functions | |
| static constexpr uint01 | NumberOfDimensions () |
| Number of dimensions in this vector class. | |
| static constexpr t_type | Type () |
| Returns the type of this class. | |
Protected Attributes | |
| t_type | m_values [t_dims] |
| The values[t dims]. | |
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
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
Definition at line 61 of file Vector.hpp.
|
inlineexplicitconstexprnoexcept |
Copy constructor.
Author: Tyler Parke
Date: 2017-11-13
Parameters: vector - The vector to copy to this vector.
Definition at line 79 of file Vector.hpp.
|
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.
Definition at line 97 of file Vector.hpp.
|
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
Definition at line 117 of file Vector.hpp.
|
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
Definition at line 137 of file Vector.hpp.
|
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
Definition at line 158 of file Vector.hpp.
|
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.
Definition at line 193 of file Vector.hpp.
|
inlineconstexpr |
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.
Definition at line 212 of file Vector.hpp.
|
inlineconstexpr |
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.
Definition at line 234 of file Vector.hpp.
|
inlineconstexpr |
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.
Definition at line 256 of file Vector.hpp.
|
inlineconstexpr |
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.
Definition at line 277 of file Vector.hpp.
|
inlineconstexpr |
Returns the vector as a new time of vector.
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.
Definition at line 301 of file Vector.hpp.
Referenced by DepthAISmoother::DepthAISmoother(), MaterialRaster::addPixelInfo(), WindowInstance::pixelSize(), and TableVectorType< 1, T >::set().
|
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
Definition at line 392 of file Vector.hpp.
|
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
Definition at line 362 of file Vector.hpp.
|
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
Definition at line 470 of file Vector.hpp.
Referenced by LineSegment< 2, t_type, Vertex< 2, t_type > >::length(), and Vector< 3, uint01 >::magnitudeSquared().
|
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
Definition at line 448 of file Vector.hpp.
Referenced by Triangle< t_dims, t_type, t_vertex >::area(), LineSegment< 2, t_type, Vertex< 2, t_type > >::closestPos(), LineSegment< 2, t_type, Vertex< 2, t_type > >::isCollinear(), Vector< 3, uint01 >::magnitude(), Vector< 3, uint01 >::normalized(), AngleDefinitions::Rotation(), and MaterialRaster::Weight().
|
inlineconstexpr |
Gets the normalized, or unit length representation of this vector.
Author: Tyler Parke
Date: 2017-11-13
Definition at line 486 of file Vector.hpp.
Referenced by GravityIntersection::calculateIntersection(), and Triangle< t_dims, t_type, t_vertex >::normal().
|
inlinestaticconstexpr |
Number of dimensions in this vector class.
Author: Tyler Parke
Date: 2017-11-13
Definition at line 614 of file Vector.hpp.
|
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
Definition at line 423 of file Vector.hpp.
|
inlineconstexpr |
Negation operator.
Author: Tyler Parke
Date: 2017-11-13
Definition at line 576 of file Vector.hpp.
|
inlineconstexpr |
Assignment operator.
Sets all values to the value provided in scaler argument.
Author: Tyler Parke
Date: 2017-11-13
Parameters: scaler - The scaler to set each dimension to.
Definition at line 597 of file Vector.hpp.
|
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.
Definition at line 548 of file Vector.hpp.
Referenced by LineSegment< 2, t_type, Vertex< 2, t_type > >::vertex(), and LineSegment< 2, t_type, Vertex< 2, t_type > >::vertex().
|
inlinenodiscardconstexpr |
Returns the product, or value of each dimension multiplied together.
Author: Tyler Parke
Date: 2017-11-13
Definition at line 510 of file Vector.hpp.
Referenced by IcoFile::ConvertRGBAToIcon(), and GridMesh< t_dims >::setupVertexTable().
|
inlinenodiscardconstexpr |
Returns the sum, or value of each dimension added together.
Author: Tyler Parke
Date: 2017-11-13
Definition at line 527 of file Vector.hpp.
Referenced by LineSegment< 2, t_type, Vertex< 2, t_type > >::closestPos().
|
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
Definition at line 626 of file Vector.hpp.