NDEVR
API Documentation
Vector< t_dims, bool >

An boolean specifc Vector which stores vectors of bools in optimal space. More...

Inheritance diagram for Vector< t_dims, bool >:
[legend]
Collaboration diagram for Vector< t_dims, bool >:
[legend]

Public Member Functions

constexpr Vector (const bool &prefix, const Vector< t_dims - 1, bool > &vector)
 Creates a vector where the prefix scaler is combined with the suffix vector.
constexpr Vector (const bool &prefix_a, const bool &prefix_b, const Vector< t_dims - 1, bool > &vector)
 Vectors.
constexpr Vector (const bool &value)
 Sets values in each dimension to the value in the passed in scaler.
constexpr Vector (const bool &x, const bool &y)
 Sets values in each dimension to the respective value in the passed in scaler.
constexpr Vector (const bool &x, const bool &y, const bool &z)
 Sets values in each dimension to the respective value in the passed in scaler.
constexpr Vector (const bool &x, const bool &y, const bool &z, const bool &w)
 Sets values in each dimension to the respective value in the passed in scaler.
constexpr Vector (const bool(&vector)[t_dims])
 Given a container of statically determined array, transforms it to a vector.
constexpr Vector (const Vector< getMax(t_dims - 2, 0), bool > &vector, const bool &suffix_a, const bool &suffix_b)
 Creates a vector where the prefix vector is combined with the suffix scalers.
constexpr Vector (const Vector< t_dims - 1, bool > &vector, const bool &suffix)
 Vectors.
template<class t_vec_type>
constexpr Vector (const Vector< t_dims, t_vec_type > &vector)
 Copy constructor.
template<uint01 t_new_dim, class t_new_type>
constexpr Vector< t_new_dim, t_new_type > as (t_new_type extra_fill_value=0) const
 As the given extra fill value.
constexpr uint01 dimensionalIndex () const
 Used with template arguments MAX or MIN, Gets the dimensional index for the value that is either max or min.
constexpr bool dimensionalValue () const
 Used with template arguments MAX or MIN, Gets the dimensional value for the value that is either max or min.
constexpr t_magnitude_type magnitude () const
 Vectors are commonly used to model forces such as wind, sea current, gravity, and electromagnetism.
constexpr bool magnitudeSquared () const
 Vectors are commonly used to model forces such as wind, sea current, gravity, and electromagnetism.
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.
constexpr operator bool () const
 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 operator bool & ()
 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, bool > operator- () const
 Negation operator.
constexpr Vector< t_dims, bool > & operator= (const bool &scaler)
 Assignment operator.
constexpr Vector< t_dims, bool > & operator= (const Vector< t_dims, bool > &vector)
 Assignment operator.
constexpr BitReference operator[] (uint01 dimension_index)
 Accesses the value of a certain dimension.
constexpr bool product () const
 Returns the product, or value of each dimension multiplied together.
constexpr bool 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 bool Type ()
 Returns the type of this class.

Protected Attributes

BitFlag m_values [(t_dims/8)+(t_dims % 8==0 ? 0 :1)]
 The values[t dims].

Detailed Description

template<uint01 t_dims>
class Vector< t_dims, bool >

An boolean specifc Vector which stores vectors of bools in optimal space.

t_dims: The number of dimensions used in a vector.

Definition at line 44 of file BoolVector.hpp.

Constructor & Destructor Documentation

◆ Vector() [1/10]

template<uint01 t_dims>
template<class t_vec_type>
Vector< t_dims, bool >::Vector ( const Vector< t_dims, t_vec_type > & vector)
inlineconstexpr

Copy constructor.

Author: Tyler Parke

Date: 2017-11-13

Parameters: vector - The vector to copy to this vector.

Definition at line 64 of file BoolVector.hpp.

References cast(), and m_values.

◆ Vector() [2/10]

template<uint01 t_dims>
Vector< t_dims, bool >::Vector ( const bool & value)
inlineexplicitconstexpr

Sets values in each dimension to the value in the passed in scaler.

Author: Tyler Parke

Date: 2017-09-13

Parameters: scaler - The bool to set all dimensions to.

Definition at line 81 of file BoolVector.hpp.

References BitFlag, and m_values.

◆ Vector() [3/10]

template<uint01 t_dims>
Vector< t_dims, bool >::Vector ( const bool & x,
const bool & y )
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 bool to set the 0th or X dimension to y - The bool to set the 1st or Y dimension to

Definition at line 119 of file BoolVector.hpp.

References m_values.

◆ Vector() [4/10]

template<uint01 t_dims>
Vector< t_dims, bool >::Vector ( const bool & x,
const bool & y,
const bool & z )
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.

Parameters
[in]x- The bool to set the 0th or X dimension to
[in]y- The bool to set the 1st or Y dimension to
[in]z- The bool to set the 2nd or Z dimension to

Definition at line 133 of file BoolVector.hpp.

References m_values.

◆ Vector() [5/10]

template<uint01 t_dims>
Vector< t_dims, bool >::Vector ( const bool & x,
const bool & y,
const bool & z,
const bool & w )
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.

Parameters
[in]x- The bool to set the 0th or X dimension to
[in]y- The bool to set the 1st or Y dimension to
[in]z- The bool to set the 2nd or Z dimension to
[in]w- The bool to set the 3rd or W dimension to

Definition at line 149 of file BoolVector.hpp.

References m_values.

◆ Vector() [6/10]

template<uint01 t_dims>
Vector< t_dims, bool >::Vector ( const bool(&) vector[t_dims])
inlineexplicitconstexpr

Given a container of statically determined array, transforms it to a vector.

Parameters
[in]vector- The vector container object.

Definition at line 162 of file BoolVector.hpp.

References m_values.

◆ Vector() [7/10]

template<uint01 t_dims>
Vector< t_dims, bool >::Vector ( const Vector< t_dims - 1, bool > & vector,
const bool & suffix )
inlineconstexpr

Vectors.

Creates a vector where the prefix vector is combined with the suffix boolean.

Parameters
[in]vector- The vector.
[in]suffixA boolean to append to the given vector

Definition at line 173 of file BoolVector.hpp.

References m_values.

◆ Vector() [8/10]

template<uint01 t_dims>
Vector< t_dims, bool >::Vector ( const Vector< getMax(t_dims - 2, 0), bool > & vector,
const bool & suffix_a,
const bool & suffix_b )
inlineconstexpr

Creates a vector where the prefix vector is combined with the suffix scalers.

Parameters
[in]vector- The vector.
[in]postfix_a- The postfix a.
[in]postfix_b- The postfix b.

Definition at line 187 of file BoolVector.hpp.

References m_values.

◆ Vector() [9/10]

template<uint01 t_dims>
Vector< t_dims, bool >::Vector ( const bool & prefix,
const Vector< t_dims - 1, bool > & vector )
inlineconstexpr

Creates a vector where the prefix scaler is combined with the suffix vector.

Parameters
[in]prefixThe prefix.
[in]vectorThe vector.

Definition at line 201 of file BoolVector.hpp.

References m_values.

◆ Vector() [10/10]

template<uint01 t_dims>
Vector< t_dims, bool >::Vector ( const bool & prefix_a,
const bool & prefix_b,
const Vector< t_dims - 1, bool > & vector )
inlineconstexpr

Vectors.

Creates a vector where the prefix scaler values are combined with the suffix vector.

Parameters
[in]prefix_a- The first prefix.
[in]prefix_b- The second prefix.
[in]vector- The vector.

Definition at line 214 of file BoolVector.hpp.

References m_values.

Member Function Documentation

◆ as()

template<uint01 t_dims>
template<uint01 t_new_dim, class t_new_type>
Vector< t_new_dim, t_new_type > Vector< t_dims, bool >::as ( t_new_type extra_fill_value = 0) const
inlineconstexpr

As the given extra fill value.

Parameters
[in]extra_fill_value- (Optional) The extra fill value, or value to set dimensions extra that may be created when t_new_dim > t_dim.
Returns
A Vector<t_new_dim,t_new_type>

Definition at line 230 of file BoolVector.hpp.

References cast(), getMin(), and m_values.

◆ dimensionalIndex()

uint01 Vector< t_dims, bool >::dimensionalIndex ( ) const
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

Returns
The index of the dimension that is either max or min depending on the template t_max_min.

Definition at line 392 of file Vector.hpp.

◆ dimensionalValue()

bool Vector< t_dims, bool >::dimensionalValue ( ) const
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

Returns
The value of the dimension that is either max or min depending on the template t_max_min.

Definition at line 362 of file Vector.hpp.

◆ magnitude()

t_magnitude_type Vector< t_dims, bool >::magnitude ( ) const
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

Returns
The magnitude, or length, of the vector.

Definition at line 470 of file Vector.hpp.

◆ magnitudeSquared()

bool Vector< t_dims, bool >::magnitudeSquared ( ) const
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

Returns
The magnitude, or length, of the vector squared.

Definition at line 448 of file Vector.hpp.

◆ normalized()

Vector< t_dims, t_norm_type > Vector< t_dims, bool >::normalized ( Vector< t_dims, t_norm_type > value_if_nan = Constant<Vector<t_dims, t_norm_type>>::Invalid) const
inlineconstexpr

Gets the normalized, or unit length representation of this vector.


Author: Tyler Parke

Date: 2017-11-13

Returns
A Vector<t_dims,t_norm_type&gt representing the normalized form of this vector;

Definition at line 486 of file Vector.hpp.

◆ NumberOfDimensions()

template<uint01 t_dims>
constexpr uint01 Vector< t_dims, bool >::NumberOfDimensions ( )
inlinestaticconstexpr

Number of dimensions in this vector class.

Returns
The total number of dimensions in this vector space.

Definition at line 339 of file BoolVector.hpp.

◆ operator bool()

template<uint01 t_dims>
Vector< t_dims, bool >::operator bool ( ) const
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.

Returns
The result of the operation.

Definition at line 249 of file BoolVector.hpp.

References m_values.

◆ operator bool &()

Vector< t_dims, bool >::operator bool & ( )
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

Returns
The result of the operation.

Definition at line 423 of file Vector.hpp.

◆ operator-()

Vector< t_dims, bool > Vector< t_dims, bool >::operator- ( ) const
inlineconstexpr

Negation operator.


Author: Tyler Parke

Date: 2017-11-13

Returns
A vector where each dimension is the opposite(-) of the original dimension

Definition at line 576 of file Vector.hpp.

◆ operator=() [1/2]

template<uint01 t_dims>
Vector< t_dims, bool > & Vector< t_dims, bool >::operator= ( const bool & scaler)
inlineconstexpr

Assignment operator.

Setes all values to the value provided in scaler argument.

Parameters
[in]scalerThe scaler to set each dimension to.
Returns
A reference of this object (Useful for chaining '=' together).

Definition at line 296 of file BoolVector.hpp.

References BitFlag, and m_values.

◆ operator=() [2/2]

template<uint01 t_dims>
Vector< t_dims, bool > & Vector< t_dims, bool >::operator= ( const Vector< t_dims, bool > & vector)
inlineconstexpr

Assignment operator.

Parameters
[in]vector- The vector to set this vector to.
Returns
A reference of this object (Useful for chaining '=' together).

Definition at line 284 of file BoolVector.hpp.

References Vector< t_dims, t_type >::m_values, and m_values.

◆ operator[]()

template<uint01 t_dims>
BitReference Vector< t_dims, bool >::operator[] ( uint01 dimension_index)
inlineconstexpr

Accesses the value of a certain dimension.

Parameters
[in]dimension_index- The dimensional index of the the value we wish to retrieve.
Returns
The value at the given dimension_index.

Definition at line 263 of file BoolVector.hpp.

References m_values.

◆ product()

bool Vector< t_dims, bool >::product ( ) const
inlinenodiscardconstexpr

Returns the product, or value of each dimension multiplied together.


Author: Tyler Parke

Date: 2017-11-13

Returns
The value of each dimension multiplied together.

Definition at line 510 of file Vector.hpp.

◆ sum()

bool Vector< t_dims, bool >::sum ( ) const
inlinenodiscardconstexpr

Returns the sum, or value of each dimension added together.


Author: Tyler Parke

Date: 2017-11-13

Returns
The value of each dimension added together.

Definition at line 527 of file Vector.hpp.

◆ Type()

template<uint01 t_dims>
constexpr bool Vector< t_dims, bool >::Type ( )
inlinestaticconstexpr

Returns the type of this class.

Useful for using decltype to instantiate a member of this class in a static environment.

Returns
The type of this class. Object is inavlid outside of decl.

Definition at line 346 of file BoolVector.hpp.


The documentation for this class was generated from the following file: