vmmlib  1.11.0
Templatized C++ vector and matrix math library
vmml::vector< M, T > Class Template Reference
+ Collaboration diagram for vmml::vector< M, T >:

Public Types

typedef T value_type
 
typedef T * iterator
 
typedef const T * const_iterator
 
typedef std::reverse_iterator< iterator > reverse_iterator
 
typedef std::reverse_iterator< const_iterator > const_reverse_iterator
 

Public Member Functions

 vector (const T &a)
 
 vector (const T &x, const T &y)
 
 vector (const T &x, const T &y, const T &z)
 
 vector (const T &x, const T &y, const T &z, const T &w)
 
 vector (const vector< M-1, T > &vector_, T last_)
 
 vector (const T *values)
 
template<size_t N>
 vector (const vector< N, T > &source_, typename enable_if< N==M-1 >::type *=0)
 
template<size_t N>
 vector (const vector< N, T > &source_, typename enable_if< N==M+1 >::type *=0)
 
template<typename U >
 vector (const vector< M, U > &source_)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
 operator T * ()
 
 operator const T * () const
 
T & operator() (size_t index)
 
const T & operator() (size_t index) const
 
T & at (size_t index)
 
const T & at (size_t index) const
 
T & x ()
 
T & y ()
 
T & z ()
 
T & w ()
 
const T & x () const
 
const T & y () const
 
const T & z () const
 
const T & w () const
 
T & r ()
 
T & g ()
 
T & b ()
 
T & a ()
 
const T & r () const
 
const T & g () const
 
const T & b () const
 
const T & a () const
 
bool operator== (const vector &other) const
 
bool operator!= (const vector &other) const
 
bool equals (const vector &other, T tolerance=std::numeric_limits< T >::epsilon()) const
 
bool operator< (const vector &other) const
 
vectoroperator= (const T *c_array)
 
operator= (T filler)
 
vectoroperator= (const vector &other)
 
template<typename U >
void operator= (const vector< M, U > &other)
 
template<size_t N>
enable_if< N==M-1 >::type * operator= (const vector< N, T > &source_)
 
template<size_t N>
enable_if< N==M+1 >::type * operator= (const vector< N, T > &source_)
 
vector operator* (const vector &other) const
 
vector operator/ (const vector &other) const
 
vector operator+ (const vector &other) const
 
vector operator- (const vector &other) const
 
void operator*= (const vector &other)
 
void operator/= (const vector &other)
 
void operator+= (const vector &other)
 
void operator-= (const vector &other)
 
vector operator* (const T other) const
 
vector operator/ (const T other) const
 
vector operator+ (const T other) const
 
vector operator- (const T other) const
 
void operator*= (const T other)
 
void operator/= (const T other)
 
void operator+= (const T other)
 
void operator-= (const T other)
 
vector operator- () const
 
const vectornegate ()
 
void set (T a)
 
void set (const vector< M-1, T > &v, T a)
 
template<size_t N>
void set (const vector< N, T > &v)
 
void set (T x, T y)
 
void set (T x, T y, T z)
 
void set (T x, T y, T z, T w)
 
template<typename input_iterator_t >
void iter_set (input_iterator_t begin_, input_iterator_t end_)
 
template<typename TT >
vector< M, T > & cross (const vector< M, TT > &b, typename enable_if< M==3, TT >::type *=0)
 
dot (const vector &other) const
 
normalize ()
 
void set_random (int seed=-1)
 
length () const
 
squared_length () const
 
distance (const vector &other) const
 
squared_distance (const vector &other) const
 
product () const
 
template<typename TT >
vector< 3, T > & rotate (T theta, vector< M, TT > axis, typename enable_if< M==3, TT >::type *=0)
 
template<size_t N, size_t O>
vector< N, T > get_sub_vector (typename enable_if< M >=N+O >::type *=0) const
 
template<size_t N, size_t O>
void set_sub_vector (const vector< N, T > &sub, typename enable_if< M >=N+O >::type *=0)
 Set the sub vector of the given length at the given offset. More...
 
template<typename TT >
vector< 3, T > project_point_onto_sphere (const vector< 3, TT > &point, typename enable_if< M==4, TT >::type *=0) const
 
template<typename TT >
distance_to_sphere (const vector< 3, TT > &point, typename enable_if< M==4, TT >::type *=0) const
 
template<typename TT >
distance_to_plane (const vector< 3, TT > &point, typename enable_if< M==4, TT >::type *=0) const
 
template<typename TT >
vector< 3, T > project_point_onto_plane (const vector< 3, TT > &point, typename enable_if< M==4, TT >::type *=0) const
 
size_t find_min_index () const
 
size_t find_max_index () const
 
T & find_min ()
 
T & find_max ()
 
const T & find_min () const
 
const T & find_max () const
 
void clamp (const T &min=0.0, const T &max=1.0)
 
bool is_unit_vector () const
 
void perturb (T perturbation=0.0001)
 
void sqrt_elementwise ()
 
double norm () const
 
void reciprocal ()
 
void reciprocal_safe ()
 
template<typename TT >
void cast_from (const vector< M, TT > &other)
 
size_t nnz () const
 
template<size_t N>
enable_if< N==M-1 >::type * operator= (const vector< N, T > &source_)
 
template<size_t N>
enable_if< N==M+1 >::type * operator= (const vector< N, T > &source_)
 

Static Public Member Functions

static size_t size ()
 

Public Attributes

array [M]
 storage
 

Static Public Attributes

static const size_t DIMENSION = M
 
static const vector FORWARD
 
static const vector BACKWARD
 
static const vector UP
 
static const vector DOWN
 
static const vector LEFT
 
static const vector RIGHT
 
static const vector ONE
 
static const vector ZERO
 
static const vector UNIT_X
 
static const vector UNIT_Y
 
static const vector UNIT_Z
 

Friends

std::ostream & operator<< (std::ostream &os, const vector &vector_)
 

Detailed Description

template<size_t M, typename T>
class vmml::vector< M, T >

Definition at line 43 of file types.hpp.

Member Function Documentation

template<size_t M, typename T >
template<size_t N, size_t O>
vector< N, T > vmml::vector< M, T >::get_sub_vector ( typename enable_if< M >  = N+O,
::type *  = 0 
) const
Returns
the sub vector of the given length at the given offset.

Definition at line 1062 of file vector.hpp.

template<size_t M, typename T >
T vmml::vector< M, T >::product ( ) const
inline
Returns
the product of all elements of this vector

Definition at line 1007 of file vector.hpp.

template<size_t M, typename T>
template<size_t N, size_t O>
void vmml::vector< M, T >::set_sub_vector ( const vector< N, T > &  sub,
typename enable_if< M >  = N+O,
::type *  = 0 
)

Set the sub vector of the given length at the given offset.

Definition at line 1069 of file vector.hpp.


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