FastUIDraw
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
fastuidraw::vecN< T, N > Class Template Reference

vecN is a simple static array class with no virtual functions and no memory overhead. Supports runtim array index checking and STL style iterators via pointer iterators. More...

#include <vecN.hpp>

Public Types

enum  { array_size = N }
 
typedef const_pointer const_iterator
 iterator typedef to const_pointer
 
typedef const T * const_pointer
 STL compliant typedef.
 
typedef const T & const_reference
 STL compliant typedef.
 
typedef ptrdiff_t difference_type
 STL compliant typedef.
 
typedef pointer iterator
 iterator typedef to pointer
 
typedef T * pointer
 STL compliant typedef.
 
typedef T & reference
 STL compliant typedef.
 
typedef size_t size_type
 STL compliant typedef.
 
typedef T value_type
 STL compliant typedef.
 

Public Member Functions

 vecN (void)
 
 vecN (const T &value)
 
template<size_t M>
 vecN (const vecN< T, M > &obj, const T &value=T())
 
template<typename S , size_type M>
 vecN (const vecN< S, M > &obj, const T &value=T())
 
template<size_t M>
 vecN (const vecN< T, M > &obj, size_type start, size_type stride=1, const T &default_value=T())
 
 vecN (const T &px, const T &py)
 
 vecN (const T &px, const T &py, const T &pz)
 
 vecN (const T &px, const T &py, const T &pz, const T &pw)
 
 vecN (const T &p0, const T &p1, const T &p2, const T &p3, const T &p4)
 
 vecN (const T &p0, const T &p1, const T &p2, const T &p3, const T &p4, const T &p5)
 
 vecN (const T &p0, const T &p1, const T &p2, const T &p3, const T &p4, const T &p5, const T &p6)
 
 vecN (const T &p0, const T &p1, const T &p2, const T &p3, const T &p4, const T &p5, const T &p6, const T &p7)
 
 vecN (const T &p0, const T &p1, const T &p2, const T &p3, const T &p4, const T &p5, const T &p6, const T &p7, const T &p8)
 
 vecN (const vecN< T, N-1 > &p, const T &d)
 
void AddMult (const vecN &dood, const T &mult)
 
atan (void) const
 
reference back (void)
 
const_reference back (void) const
 
iterator begin (void)
 
const_iterator begin (void) const
 
T * c_ptr (void)
 
const T * c_ptr (void) const
 
dot (const vecN &obj) const
 
iterator end (void)
 
const_iterator end (void) const
 
void face_forward (const vecN &referencePt)
 
const vecNfill (const T &obj)
 
reference front (void)
 
const_reference front (void) const
 
L1norm (void) const
 
magnitude (void) const
 
magnitudeSq (void) const
 
void normalize (T tol)
 
void normalize (void)
 
bool operator!= (const vecN &obj) const
 
vecN operator% (const vecN &obj) const
 
vecN operator% (const T &obj) const
 
template<size_t M>
void operator%= (const vecN< T, M > &obj)
 
void operator%= (const T &obj)
 
vecN operator* (const vecN &obj) const
 
vecN operator* (const T &obj) const
 
template<size_t M>
void operator*= (const vecN< T, M > &obj)
 
void operator*= (const T &obj)
 
vecN operator+ (const vecN &obj) const
 
template<size_t M>
void operator+= (const vecN< T, M > &obj)
 
vecN operator- (void) const
 
vecN operator- (const vecN &obj) const
 
template<size_t M>
void operator-= (const vecN< T, M > &obj)
 
vecN operator/ (const vecN &obj) const
 
vecN operator/ (const T &obj) const
 
template<size_t M>
void operator/= (const vecN< T, M > &obj)
 
void operator/= (const T &obj)
 
bool operator< (const vecN &obj) const
 
bool operator<= (const vecN &obj) const
 
const vecNoperator= (const vecN &obj)
 
bool operator== (const vecN &obj) const
 
bool operator> (const vecN &obj) const
 
bool operator>= (const vecN &obj) const
 
const_reference operator[] (size_type j) const
 
reference operator[] (size_type j)
 
void swap (vecN &obj)
 
vecN unit_vector (void) const
 
vecN unit_vector (T tol) const
 
reference w (void)
 
const_reference w (void) const
 
reference x (void)
 
const_reference x (void) const
 
reference y (void)
 
const_reference y (void) const
 
reference z (void)
 
const_reference z (void) const
 

Static Public Member Functions

static size_t size (void)
 

Friends

vecN operator* (const T &obj, const vecN &vec)
 
vecN operator/ (const T &obj, const vecN &vec)
 

Detailed Description

template<typename T, size_t N>
class fastuidraw::vecN< T, N >

vecN is a simple static array class with no virtual functions and no memory overhead. Supports runtim array index checking and STL style iterators via pointer iterators.

Parameters
Ttypename with a constructor that takes no arguments.
Nsize of array

Definition at line 42 of file vecN.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<typename T, size_t N>
anonymous enum
Enumerator
array_size 

Enumeration value for length of array.

Definition at line 45 of file vecN.hpp.

Constructor & Destructor Documentation

◆ vecN() [1/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( void  )
inline

Ctor, no intiliaztion on POD types.

Definition at line 110 of file vecN.hpp.

◆ vecN() [2/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( const T &  value)
inlineexplicit

Ctor. Calls T::operator= on each element of the array.

Parameters
valueconstant reference to a T value.

Definition at line 119 of file vecN.hpp.

◆ vecN() [3/14]

template<typename T, size_t N>
template<size_t M>
fastuidraw::vecN< T, N >::vecN ( const vecN< T, M > &  obj,
const T &  value = T() 
)
inlineexplicit

Copy constructor from array of different size. Calls T::operator= on each array element, if M<N then for each element beyond M, T::operator= is called with the parameter value.

Template Parameters
Msize of other array.
Parameters
objconstant reference to copy elements from.
valueconstant reference for value to use beyond index M

Definition at line 138 of file vecN.hpp.

◆ vecN() [4/14]

template<typename T, size_t N>
template<typename S , size_type M>
fastuidraw::vecN< T, N >::vecN ( const vecN< S, M > &  obj,
const T &  value = T() 
)
inlineexplicit

Ctor Calls T::operator= on each array element, if M<N then for each element beyond M, T::operator= is called with the parameter value.

Template Parameters
Msize of other array.
Parameters
objconstant reference to copy elements from.
valueconstant reference for value to use beyond index M

Definition at line 164 of file vecN.hpp.

◆ vecN() [5/14]

template<typename T, size_t N>
template<size_t M>
fastuidraw::vecN< T, N >::vecN ( const vecN< T, M > &  obj,
size_type  start,
size_type  stride = 1,
const T &  default_value = T() 
)
inline

Copy constructor from array of different size specifying the range Copies every stride'th value stored at obj starting at index start to this. For elements of this which are not assigned in this fashion, they are assigned as default_value.

Template Parameters
Msize of other array.
Parameters
objconstant reference to copy elements from.
startfirst index of M to use
stridestride of copying
default_value

Definition at line 191 of file vecN.hpp.

◆ vecN() [6/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( const T &  px,
const T &  py 
)
inline

Conveniance ctor, will fail to compile unless N=2.

Parameters
pxvalue to which to assing the return value of x().
pyvalue to which to assing the return value of y().

Definition at line 213 of file vecN.hpp.

◆ vecN() [7/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( const T &  px,
const T &  py,
const T &  pz 
)
inline

Conveniance ctor, will fail to compile unless N=3.

Parameters
pxvalue to which to assing the return value of x().
pyvalue to which to assing the return value of y().
pzvalue to which to assing the return value of z().

Definition at line 226 of file vecN.hpp.

◆ vecN() [8/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( const T &  px,
const T &  py,
const T &  pz,
const T &  pw 
)
inline

Conveniance ctor, will fail to compile unless N=4.

Parameters
pxvalue to which to assing the return value of x().
pyvalue to which to assing the return value of y().
pzvalue to which to assing the return value of z().
pwvalue to which to assing the return value of w().

Definition at line 241 of file vecN.hpp.

◆ vecN() [9/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( const T &  p0,
const T &  p1,
const T &  p2,
const T &  p3,
const T &  p4 
)
inline

Conveniance ctor, will fail to compile unless N=5

Parameters
p0value to which to assing the return value of operator[](0)
p1value to which to assing the return value of operator[](1)
p2value to which to assing the return value of operator[](2)
p3value to which to assing the return value of operator[](3)
p4value to which to assing the return value of operator[](4)

Definition at line 258 of file vecN.hpp.

◆ vecN() [10/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( const T &  p0,
const T &  p1,
const T &  p2,
const T &  p3,
const T &  p4,
const T &  p5 
)
inline

Conveniance ctor, will fail to compile unless N=6

Parameters
p0value to which to assing the return value of operator[](0)
p1value to which to assing the return value of operator[](1)
p2value to which to assing the return value of operator[](2)
p3value to which to assing the return value of operator[](3)
p4value to which to assing the return value of operator[](4)
p5value to which to assing the return value of operator[](5)

Definition at line 278 of file vecN.hpp.

◆ vecN() [11/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( const T &  p0,
const T &  p1,
const T &  p2,
const T &  p3,
const T &  p4,
const T &  p5,
const T &  p6 
)
inline

Conveniance ctor, will fail to compile unless N=7

Parameters
p0value to which to assing the return value of operator[](0)
p1value to which to assing the return value of operator[](1)
p2value to which to assing the return value of operator[](2)
p3value to which to assing the return value of operator[](3)
p4value to which to assing the return value of operator[](4)
p5value to which to assing the return value of operator[](5)
p6value to which to assing the return value of operator[](6)

Definition at line 300 of file vecN.hpp.

◆ vecN() [12/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( const T &  p0,
const T &  p1,
const T &  p2,
const T &  p3,
const T &  p4,
const T &  p5,
const T &  p6,
const T &  p7 
)
inline

Conveniance ctor, will fail to compile unless N=8

Parameters
p0value to which to assing the return value of operator[](0)
p1value to which to assing the return value of operator[](1)
p2value to which to assing the return value of operator[](2)
p3value to which to assing the return value of operator[](3)
p4value to which to assing the return value of operator[](4)
p5value to which to assing the return value of operator[](5)
p6value to which to assing the return value of operator[](6)
p7value to which to assing the return value of operator[](7)

Definition at line 325 of file vecN.hpp.

◆ vecN() [13/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( const T &  p0,
const T &  p1,
const T &  p2,
const T &  p3,
const T &  p4,
const T &  p5,
const T &  p6,
const T &  p7,
const T &  p8 
)
inline

Conveniance ctor, will fail to compile unless N=9

Parameters
p0value to which to assing the return value of operator[](0)
p1value to which to assing the return value of operator[](1)
p2value to which to assing the return value of operator[](2)
p3value to which to assing the return value of operator[](3)
p4value to which to assing the return value of operator[](4)
p5value to which to assing the return value of operator[](5)
p6value to which to assing the return value of operator[](6)
p7value to which to assing the return value of operator[](7)
p8value to which to assing the return value of operator[](8)

Definition at line 352 of file vecN.hpp.

◆ vecN() [14/14]

template<typename T, size_t N>
fastuidraw::vecN< T, N >::vecN ( const vecN< T, N-1 > &  p,
const T &  d 
)
inline

Conveniance function.

Parameters
pgives valeus for array indices 0 to N-2 inclusive
dgives value for array index N-1

Definition at line 373 of file vecN.hpp.

Member Function Documentation

◆ AddMult()

template<typename T, size_t N>
void fastuidraw::vecN< T, N >::AddMult ( const vecN< T, N > &  dood,
const T &  mult 
)
inline

Conveniance function, increments this vecN by dood*mult by doing so on each component individually, slighly more efficient than operator+=(dood*mult).

Definition at line 859 of file vecN.hpp.

◆ atan()

template<typename T, size_t N>
T fastuidraw::vecN< T, N >::atan ( void  ) const
inline

Conveniance function only for N = 2, equivalent to

t_atan(y(), x())

Definition at line 1047 of file vecN.hpp.

◆ back() [1/2]

template<typename T, size_t N>
reference fastuidraw::vecN< T, N >::back ( void  )
inline

STL compliant back() function.

Definition at line 1090 of file vecN.hpp.

◆ back() [2/2]

template<typename T, size_t N>
const_reference fastuidraw::vecN< T, N >::back ( void  ) const
inline

STL compliant back() function.

Definition at line 1096 of file vecN.hpp.

◆ begin() [1/2]

template<typename T, size_t N>
iterator fastuidraw::vecN< T, N >::begin ( void  )
inline

STL compliant iterator function.

Definition at line 1066 of file vecN.hpp.

◆ begin() [2/2]

template<typename T, size_t N>
const_iterator fastuidraw::vecN< T, N >::begin ( void  ) const
inline

STL compliant iterator function.

Definition at line 1072 of file vecN.hpp.

◆ c_ptr() [1/2]

template<typename T, size_t N>
T* fastuidraw::vecN< T, N >::c_ptr ( void  )
inline

Returns a C-style pointer to the array.

Definition at line 400 of file vecN.hpp.

◆ c_ptr() [2/2]

template<typename T, size_t N>
const T* fastuidraw::vecN< T, N >::c_ptr ( void  ) const
inline

Returns a constant C-style pointer to the array.

Definition at line 406 of file vecN.hpp.

◆ dot()

template<typename T, size_t N>
T fastuidraw::vecN< T, N >::dot ( const vecN< T, N > &  obj) const
inline

Performs inner product against another vecN. uses operator+=(T&, const T&) and operator*(T, T)

Parameters
objvecN to perform inner product against

Definition at line 804 of file vecN.hpp.

◆ end() [1/2]

template<typename T, size_t N>
iterator fastuidraw::vecN< T, N >::end ( void  )
inline

STL compliant iterator function.

Definition at line 1078 of file vecN.hpp.

◆ end() [2/2]

template<typename T, size_t N>
const_iterator fastuidraw::vecN< T, N >::end ( void  ) const
inline

STL compliant iterator function.

Definition at line 1084 of file vecN.hpp.

◆ face_forward()

template<typename T, size_t N>
void fastuidraw::vecN< T, N >::face_forward ( const vecN< T, N > &  referencePt)
inline

Conveniance geometryic function; if dot(*this, referencePt) is negative, negates the elements of this

Parameters
referencePtrefrence point to face forward to.

Definition at line 873 of file vecN.hpp.

◆ fill()

template<typename T, size_t N>
const vecN& fastuidraw::vecN< T, N >::fill ( const T &  obj)
inline

Set all values of array, performs operator=(T&, const T&) on each element of the array agains obj.

Parameters
objValue to set all objects as.

Definition at line 516 of file vecN.hpp.

◆ front() [1/2]

template<typename T, size_t N>
reference fastuidraw::vecN< T, N >::front ( void  )
inline

STL compliant front() function.

Definition at line 1102 of file vecN.hpp.

◆ front() [2/2]

template<typename T, size_t N>
const_reference fastuidraw::vecN< T, N >::front ( void  ) const
inline

STL compliant front() function.

Definition at line 1108 of file vecN.hpp.

◆ L1norm()

template<typename T, size_t N>
T fastuidraw::vecN< T, N >::L1norm ( void  ) const
inline

Computes the sum of t_abs() of each of the elements of the vecN.

Definition at line 840 of file vecN.hpp.

◆ magnitude()

template<typename T, size_t N>
T fastuidraw::vecN< T, N >::magnitude ( void  ) const
inline

Conveninace function, equivalent to

t_sqrt(dot(*this))

Definition at line 830 of file vecN.hpp.

◆ magnitudeSq()

template<typename T, size_t N>
T fastuidraw::vecN< T, N >::magnitudeSq ( void  ) const
inline

Conveninace function, equivalent to

dot(*this)

Definition at line 820 of file vecN.hpp.

◆ normalize() [1/2]

template<typename T, size_t N>
void fastuidraw::vecN< T, N >::normalize ( tol)
inline

Normalize this vecN up to a tolerance, equivalent to

Parameters
toltolerance to avoid dividing by too small values

Definition at line 995 of file vecN.hpp.

◆ normalize() [2/2]

template<typename T, size_t N>
void fastuidraw::vecN< T, N >::normalize ( void  )
inline

Normalize this vecN to a default tolerancee, equivalent to

normalize( T(0.00001*0.00001)

Definition at line 1011 of file vecN.hpp.

◆ operator!=()

template<typename T, size_t N>
bool fastuidraw::vecN< T, N >::operator!= ( const vecN< T, N > &  obj) const
inline

Provided as a conveniance, equivalent to

Parameters
objvecN to which to compare.

Definition at line 916 of file vecN.hpp.

◆ operator%() [1/2]

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::operator% ( const vecN< T, N > &  obj) const
inline

Component-wise modulas operator returns the componenet-wise modulas of two arrays.

Parameters
objright hand side of % operator

Definition at line 604 of file vecN.hpp.

◆ operator%() [2/2]

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::operator% ( const T &  obj) const
inline

Component-wise modulas against a singleton

Parameters
objright hand side of % operator

Definition at line 640 of file vecN.hpp.

◆ operator%=() [1/2]

template<typename T, size_t N>
template<size_t M>
void fastuidraw::vecN< T, N >::operator%= ( const vecN< T, M > &  obj)
inline

Component-wise modulas increment operator against an array of possibly different size, if M is smaller then only those indexes less than M are affected.

Parameters
objright hand side of /= operator

Definition at line 719 of file vecN.hpp.

◆ operator%=() [2/2]

template<typename T, size_t N>
void fastuidraw::vecN< T, N >::operator%= ( const T &  obj)
inline

Increment divide operator against a singleton, i.e. increment divide each element of this against the passed T value.

Parameters
objright hind side of operator/=

Definition at line 764 of file vecN.hpp.

◆ operator*() [1/2]

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::operator* ( const vecN< T, N > &  obj) const
inline

Component-wise multiplication operator, returns the componenet-wise multiplication of two arrays.

Parameters
objright hand side of * operator

Definition at line 576 of file vecN.hpp.

◆ operator*() [2/2]

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::operator* ( const T &  obj) const
inline

Component-wise multiplication operator against a singleton

Parameters
objright hand side of * operator

Definition at line 616 of file vecN.hpp.

◆ operator*=() [1/2]

template<typename T, size_t N>
template<size_t M>
void fastuidraw::vecN< T, N >::operator*= ( const vecN< T, M > &  obj)
inline

Component-wise multiplication increment operator against an array of possibly different size, if M is smaller then only those indexes less than M are affected.

Parameters
objright hand side of *= operator

Definition at line 687 of file vecN.hpp.

◆ operator*=() [2/2]

template<typename T, size_t N>
void fastuidraw::vecN< T, N >::operator*= ( const T &  obj)
inline

Increment multiply operator against a singleton, i.e. increment multiple each element of this against the passed T value.

Parameters
objright hind side of operator*=

Definition at line 734 of file vecN.hpp.

◆ operator+()

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::operator+ ( const vecN< T, N > &  obj) const
inline

Compoenent wise addition operator returns the componenet wise addition of two arrays.

Parameters
objright hand side of + operator

Definition at line 548 of file vecN.hpp.

◆ operator+=()

template<typename T, size_t N>
template<size_t M>
void fastuidraw::vecN< T, N >::operator+= ( const vecN< T, M > &  obj)
inline

Component-wise addition increment operator against an array of possibly different size, if M is smaller then only those indexes less than M are affected.

Parameters
objright hand side of += operator

Definition at line 655 of file vecN.hpp.

◆ operator-() [1/2]

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::operator- ( void  ) const
inline

Component-wise negation operator. returns the componenet-wise negation

Definition at line 531 of file vecN.hpp.

◆ operator-() [2/2]

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::operator- ( const vecN< T, N > &  obj) const
inline

Component-wise subtraction operator returns the componenet-wise subtraction of two arrays.

Parameters
objright hand side of - operator

Definition at line 562 of file vecN.hpp.

◆ operator-=()

template<typename T, size_t N>
template<size_t M>
void fastuidraw::vecN< T, N >::operator-= ( const vecN< T, M > &  obj)
inline

Component-wise subtraction increment operator against an array of possibly different size, if M is smaller then only those indexes less than M are affected.

Parameters
objright hand side of -= operator

Definition at line 671 of file vecN.hpp.

◆ operator/() [1/2]

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::operator/ ( const vecN< T, N > &  obj) const
inline

Component-wise division operator, returns the componenet-wise division of two arrays.

Parameters
objright hand side of / operator

Definition at line 590 of file vecN.hpp.

◆ operator/() [2/2]

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::operator/ ( const T &  obj) const
inline

Component-wise division against a singleton

Parameters
objright hand side of / operator

Definition at line 628 of file vecN.hpp.

◆ operator/=() [1/2]

template<typename T, size_t N>
template<size_t M>
void fastuidraw::vecN< T, N >::operator/= ( const vecN< T, M > &  obj)
inline

Component-wise division increment operator against an array of possibly different size, if M is smaller then only those indexes less than M are affected.

Parameters
objright hand side of /= operator

Definition at line 703 of file vecN.hpp.

◆ operator/=() [2/2]

template<typename T, size_t N>
void fastuidraw::vecN< T, N >::operator/= ( const T &  obj)
inline

Increment divide operator against a singleton, i.e. increment divide each element of this against the passed T value.

Parameters
objright hind side of operator/=

Definition at line 749 of file vecN.hpp.

◆ operator<()

template<typename T, size_t N>
bool fastuidraw::vecN< T, N >::operator< ( const vecN< T, N > &  obj) const
inline

Returns lexographical operator< by performing on individual elements.

Parameters
objvecN to which to compare.

Definition at line 927 of file vecN.hpp.

◆ operator<=()

template<typename T, size_t N>
bool fastuidraw::vecN< T, N >::operator<= ( const vecN< T, N > &  obj) const
inline

Provided as a conveniance, equivalent to

operator<(obj) || operator==(obj);
Parameters
objvecN to which to compare.

Definition at line 955 of file vecN.hpp.

◆ operator=()

template<typename T, size_t N>
const vecN& fastuidraw::vecN< T, N >::operator= ( const vecN< T, N > &  obj)
inline

Assignment operator, performs operator=(T&, const T&) on each element.

Parameters
objconstant reference to a same sized array.

Definition at line 498 of file vecN.hpp.

◆ operator==()

template<typename T, size_t N>
bool fastuidraw::vecN< T, N >::operator== ( const vecN< T, N > &  obj) const
inline

Equality operator by checking each array index individually.

Parameters
objvecN to which to compare.

Definition at line 892 of file vecN.hpp.

◆ operator>()

template<typename T, size_t N>
bool fastuidraw::vecN< T, N >::operator> ( const vecN< T, N > &  obj) const
inline

Provided as a conveniance, equivalent to

obj.operator<(*this)
Parameters
objvecN to which to compare.

Definition at line 968 of file vecN.hpp.

◆ operator>=()

template<typename T, size_t N>
bool fastuidraw::vecN< T, N >::operator>= ( const vecN< T, N > &  obj) const
inline

Provided as a conveniance, equivalent to

!operator<(obj)
Parameters
objvecN to which to compare.

Definition at line 981 of file vecN.hpp.

◆ operator[]() [1/2]

template<typename T, size_t N>
const_reference fastuidraw::vecN< T, N >::operator[] ( size_type  j) const
inline

Return a constant refernce to the j'th element.

Parameters
jindex of element to return.

Definition at line 413 of file vecN.hpp.

◆ operator[]() [2/2]

template<typename T, size_t N>
reference fastuidraw::vecN< T, N >::operator[] ( size_type  j)
inline

Return a refernce to the j'th element.

Parameters
jindex of element to return.

Definition at line 424 of file vecN.hpp.

◆ size()

template<typename T, size_t N>
static size_t fastuidraw::vecN< T, N >::size ( void  )
inlinestatic

STL compliand size function, note that it is static since the size of the array is determined by the template parameter N.

Definition at line 1060 of file vecN.hpp.

◆ swap()

template<typename T, size_t N>
void fastuidraw::vecN< T, N >::swap ( vecN< T, N > &  obj)
inline

Swap operation

Parameters
objobject with which to swap

Definition at line 388 of file vecN.hpp.

◆ unit_vector() [1/2]

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::unit_vector ( void  ) const
inline

Returns the vector that would be made by calling normalize(void).

Definition at line 1021 of file vecN.hpp.

◆ unit_vector() [2/2]

template<typename T, size_t N>
vecN fastuidraw::vecN< T, N >::unit_vector ( tol) const
inline

Returns the vector that would be made by calling normalize(T).

Definition at line 1033 of file vecN.hpp.

◆ w() [1/2]

template<typename T, size_t N>
reference fastuidraw::vecN< T, N >::w ( void  )
inline

Conveniance readability member function, equivalent to operator[](3). Fails to compile if N is not atleast 4.

Definition at line 459 of file vecN.hpp.

◆ w() [2/2]

template<typename T, size_t N>
const_reference fastuidraw::vecN< T, N >::w ( void  ) const
inline

Conveniance readability member function, equivalent to operator[](3). Fails to compile if N is not atleast 4.

Definition at line 490 of file vecN.hpp.

◆ x() [1/2]

template<typename T, size_t N>
reference fastuidraw::vecN< T, N >::x ( void  )
inline

Conveniance readability member function, equivalent to operator[](0).

Definition at line 435 of file vecN.hpp.

◆ x() [2/2]

template<typename T, size_t N>
const_reference fastuidraw::vecN< T, N >::x ( void  ) const
inline

Conveniance readability member function, equivalent to operator[](0).

Definition at line 466 of file vecN.hpp.

◆ y() [1/2]

template<typename T, size_t N>
reference fastuidraw::vecN< T, N >::y ( void  )
inline

Conveniance readability member function, equivalent to operator[](1). Fails to compile if N is not atleast 2.

Definition at line 443 of file vecN.hpp.

◆ y() [2/2]

template<typename T, size_t N>
const_reference fastuidraw::vecN< T, N >::y ( void  ) const
inline

Conveniance readability member function, equivalent to operator[](1). Fails to compile if N is not atleast 2.

Definition at line 474 of file vecN.hpp.

◆ z() [1/2]

template<typename T, size_t N>
reference fastuidraw::vecN< T, N >::z ( void  )
inline

Conveniance readability member function, equivalent to operator[](2). Fails to compile if N is not atleast 3.

Definition at line 451 of file vecN.hpp.

◆ z() [2/2]

template<typename T, size_t N>
const_reference fastuidraw::vecN< T, N >::z ( void  ) const
inline

Conveniance readability member function, equivalent to operator[](2). Fails to compile if N is not atleast 3.

Definition at line 482 of file vecN.hpp.

Friends And Related Function Documentation

◆ operator*

template<typename T, size_t N>
vecN operator* ( const T &  obj,
const vecN< T, N > &  vec 
)
friend

Component-wise multiplication against a singleton

Parameters
objleft hand side of * operator
vecright hand side of * operator

Definition at line 778 of file vecN.hpp.

◆ operator/

template<typename T, size_t N>
vecN operator/ ( const T &  obj,
const vecN< T, N > &  vec 
)
friend

Component-wise divition against a singleton

Parameters
objleft hand side of / operator
vecright hand side of / operator

Definition at line 791 of file vecN.hpp.


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