HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VectorN< V, S, N > Class Template Reference

#include <Types.h>

+ Inheritance diagram for VectorN< V, S, N >:

Classes

class  Hash
 Function object for hashing vectors. More...
 

Public Types

using Iterator = typename std::array< S, N >::iterator
 
using ConstIterator = typename std::array< S, N >::const_iterator
 

Public Member Functions

 VectorN ()
 
 VectorN (Uninit)
 
 VectorN (S s)
 
 VectorN (const std::array< S, N > &arr)
 
 VectorN (const vector< S > &vec)
 
 VectorN (const S *begin, const S *end)
 
Comparison Operators
bool operator== (const V &rhs) const
 Return true if the given vector is identical to this one. More...
 
bool operator!= (const V &rhs) const
 Return true if the given vector differs from this one. More...
 
bool operator< (const V &rhs) const
 Compare two vectors lexicographically. More...
 
Indexing Operators
Soperator[] (size_t i)
 Return the scalar value at the given index. More...
 
const Soperator[] (size_t i) const
 Return the const scalar value at the given index. More...
 
Component-wise Operators
operator+ (const V &rhs) const
 Component-wise addition of two vectors. More...
 
VectorNoperator+= (const V &rhs)
 Component-wise addition of two vectors. More...
 
operator- (const V &rhs) const
 Component-wise subtraction of two vectors. More...
 
VectorNoperator-= (const V &rhs)
 Component-wise subtraction of two vectors. More...
 
operator* (const V &rhs) const
 Component-wise multiplication of two vectors. More...
 
VectorNoperator*= (const V &rhs)
 Component-wise multiplication of two vectors. More...
 
operator/ (const V &rhs) const
 Component-wise division of two vectors. More...
 
VectorNoperator/= (const V &rhs)
 Component-wise division of two vectors. More...
 
operator* (S s) const
 Component-wise multiplication of a vector by a scalar. More...
 
VectorNoperator*= (S s)
 Component-wise multiplication of a vector by a scalar. More...
 
operator/ (S s) const
 Component-wise division of a vector by a scalar. More...
 
VectorNoperator/= (S s)
 Component-wise division of a vector by a scalar. More...
 
operator- () const
 Unary negation of a vector. More...
 
Geometric Methods
S getMagnitude () const
 Return the magnitude of the vector. More...
 
getNormalized () const
 Return a normalized vector. More...
 
S dot (const V &rhs) const
 Return the dot product of two vectors. More...
 
Iterators
Iterator begin ()
 
ConstIterator begin () const
 
Iterator end ()
 
ConstIterator end () const
 
Utility
Sdata ()
 Return a pointer to the underlying data array. More...
 
const Sdata () const
 Return a const pointer to the underlying data array. More...
 

Static Public Member Functions

Static Methods
static constexpr size_t numElements ()
 Return the number of scalar elements for the vector. More...
 

Protected Attributes

std::array< S, N > _arr
 

Detailed Description

template<class V, class S, size_t N>
class VectorN< V, S, N >

The class template for vectors of scalar values. Inherited by Vector2, Vector3, Vector4, Color3, and Color4.

Template parameter V is the vector subclass, S is the scalar element type, and N is the number of scalar elements in the vector.

Definition at line 55 of file Types.h.

Member Typedef Documentation

template<class V, class S, size_t N>
using VectorN< V, S, N >::ConstIterator = typename std::array<S, N>::const_iterator

Definition at line 59 of file Types.h.

template<class V, class S, size_t N>
using VectorN< V, S, N >::Iterator = typename std::array<S, N>::iterator

Definition at line 58 of file Types.h.

Constructor & Destructor Documentation

template<class V, class S, size_t N>
VectorN< V, S, N >::VectorN ( )
inline

Definition at line 62 of file Types.h.

template<class V, class S, size_t N>
VectorN< V, S, N >::VectorN ( Uninit  )
inlineexplicit

Definition at line 63 of file Types.h.

template<class V, class S, size_t N>
VectorN< V, S, N >::VectorN ( S  s)
inlineexplicit

Definition at line 64 of file Types.h.

template<class V, class S, size_t N>
VectorN< V, S, N >::VectorN ( const std::array< S, N > &  arr)
inlineexplicit

Definition at line 65 of file Types.h.

template<class V, class S, size_t N>
VectorN< V, S, N >::VectorN ( const vector< S > &  vec)
inlineexplicit

Definition at line 66 of file Types.h.

template<class V, class S, size_t N>
VectorN< V, S, N >::VectorN ( const S begin,
const S end 
)
inlineexplicit

Definition at line 67 of file Types.h.

Member Function Documentation

template<class V, class S, size_t N>
Iterator VectorN< V, S, N >::begin ( void  )
inline

Definition at line 241 of file Types.h.

template<class V, class S, size_t N>
ConstIterator VectorN< V, S, N >::begin ( void  ) const
inline

Definition at line 242 of file Types.h.

template<class V, class S, size_t N>
S* VectorN< V, S, N >::data ( )
inline

Return a pointer to the underlying data array.

Definition at line 252 of file Types.h.

template<class V, class S, size_t N>
const S* VectorN< V, S, N >::data ( ) const
inline

Return a const pointer to the underlying data array.

Definition at line 255 of file Types.h.

template<class V, class S, size_t N>
S VectorN< V, S, N >::dot ( const V &  rhs) const
inline

Return the dot product of two vectors.

Definition at line 229 of file Types.h.

template<class V, class S, size_t N>
Iterator VectorN< V, S, N >::end ( void  )
inline

Definition at line 244 of file Types.h.

template<class V, class S, size_t N>
ConstIterator VectorN< V, S, N >::end ( void  ) const
inline

Definition at line 245 of file Types.h.

template<class V, class S, size_t N>
S VectorN< V, S, N >::getMagnitude ( ) const
inline

Return the magnitude of the vector.

Definition at line 214 of file Types.h.

template<class V, class S, size_t N>
V VectorN< V, S, N >::getNormalized ( ) const
inline

Return a normalized vector.

Definition at line 223 of file Types.h.

template<class V, class S, size_t N>
static constexpr size_t VectorN< V, S, N >::numElements ( )
inlinestatic

Return the number of scalar elements for the vector.

Definition at line 275 of file Types.h.

template<class V, class S, size_t N>
bool VectorN< V, S, N >::operator!= ( const V &  rhs) const
inline

Return true if the given vector differs from this one.

Definition at line 76 of file Types.h.

template<class V, class S, size_t N>
V VectorN< V, S, N >::operator* ( const V &  rhs) const
inline

Component-wise multiplication of two vectors.

Definition at line 133 of file Types.h.

template<class V, class S, size_t N>
V VectorN< V, S, N >::operator* ( S  s) const
inline

Component-wise multiplication of a vector by a scalar.

Definition at line 167 of file Types.h.

template<class V, class S, size_t N>
VectorN& VectorN< V, S, N >::operator*= ( const V &  rhs)
inline

Component-wise multiplication of two vectors.

Definition at line 142 of file Types.h.

template<class V, class S, size_t N>
VectorN& VectorN< V, S, N >::operator*= ( S  s)
inline

Component-wise multiplication of a vector by a scalar.

Definition at line 176 of file Types.h.

template<class V, class S, size_t N>
V VectorN< V, S, N >::operator+ ( const V &  rhs) const
inline

Component-wise addition of two vectors.

Definition at line 99 of file Types.h.

template<class V, class S, size_t N>
VectorN& VectorN< V, S, N >::operator+= ( const V &  rhs)
inline

Component-wise addition of two vectors.

Definition at line 108 of file Types.h.

template<class V, class S, size_t N>
V VectorN< V, S, N >::operator- ( const V &  rhs) const
inline

Component-wise subtraction of two vectors.

Definition at line 116 of file Types.h.

template<class V, class S, size_t N>
V VectorN< V, S, N >::operator- ( ) const
inline

Unary negation of a vector.

Definition at line 201 of file Types.h.

template<class V, class S, size_t N>
VectorN& VectorN< V, S, N >::operator-= ( const V &  rhs)
inline

Component-wise subtraction of two vectors.

Definition at line 125 of file Types.h.

template<class V, class S, size_t N>
V VectorN< V, S, N >::operator/ ( const V &  rhs) const
inline

Component-wise division of two vectors.

Definition at line 150 of file Types.h.

template<class V, class S, size_t N>
V VectorN< V, S, N >::operator/ ( S  s) const
inline

Component-wise division of a vector by a scalar.

Definition at line 184 of file Types.h.

template<class V, class S, size_t N>
VectorN& VectorN< V, S, N >::operator/= ( const V &  rhs)
inline

Component-wise division of two vectors.

Definition at line 159 of file Types.h.

template<class V, class S, size_t N>
VectorN& VectorN< V, S, N >::operator/= ( S  s)
inline

Component-wise division of a vector by a scalar.

Definition at line 193 of file Types.h.

template<class V, class S, size_t N>
bool VectorN< V, S, N >::operator< ( const V &  rhs) const
inline

Compare two vectors lexicographically.

Definition at line 79 of file Types.h.

template<class V, class S, size_t N>
bool VectorN< V, S, N >::operator== ( const V &  rhs) const
inline

Return true if the given vector is identical to this one.

Definition at line 73 of file Types.h.

template<class V, class S, size_t N>
S& VectorN< V, S, N >::operator[] ( size_t  i)
inline

Return the scalar value at the given index.

Definition at line 89 of file Types.h.

template<class V, class S, size_t N>
const S& VectorN< V, S, N >::operator[] ( size_t  i) const
inline

Return the const scalar value at the given index.

Definition at line 92 of file Types.h.

Member Data Documentation

template<class V, class S, size_t N>
std::array<S, N> VectorN< V, S, N >::_arr
protected

Definition at line 280 of file Types.h.


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