lbm_reference
Public Member Functions | Protected Attributes | List of all members
Vec3< T > Class Template Reference

Three component vector of type specified by template parameter. More...

#include <Vec.h>

+ Inheritance diagram for Vec3< T >:
+ Collaboration diagram for Vec3< T >:

Public Member Functions

operator* (const Vec3< T > &v) const
 Inner product operator. More...
 
Vec3< T > operator* (const T a) const
 Multiplication with scalar operator. More...
 
void operator*= (const T a) const
 In-place multiplication with scalar operator. More...
 
Vec3< T > operator+ (const Vec3< T > &v) const
 Addition operator. More...
 
void operator+= (const Vec3< T > &v)
 In-place addition operator. More...
 
T & operator[] (int i)
 Non-constant access operator. More...
 
const T & operator[] (int i) const
 Constant access operator. More...
 
 Vec3 ()
 Default constructor. More...
 
 Vec3 (const Vec3 &v)
 Copy constructor. More...
 
 Vec3 (T x, T y, T z)
 Constructor to set all three components. More...
 
virtual ~Vec3 ()
 Destructor. More...
 

Protected Attributes

std::vector< T > data_
 The stl vector to hold the data. More...
 

Detailed Description

template<typename T>
class Vec3< T >

Three component vector of type specified by template parameter.

Template Parameters
TType of the vector elements

Definition at line 15 of file Vec.h.

Constructor & Destructor Documentation

template<typename T>
Vec3< T >::Vec3 ( )
inline

Default constructor.

Creates a zero length vector

Definition at line 27 of file Vec.h.

template<typename T>
Vec3< T >::Vec3 ( const Vec3< T > &  v)
inline

Copy constructor.

Parameters
[in]vVector to copy from

Definition at line 33 of file Vec.h.

template<typename T>
Vec3< T >::Vec3 ( x,
y,
z 
)
inline

Constructor to set all three components.

Parameters
[in]xFirst component
[in]ySecond component
[in]zThird component

Definition at line 41 of file Vec.h.

template<typename T>
virtual Vec3< T >::~Vec3 ( )
inlinevirtual

Destructor.

Clears the vector

Definition at line 51 of file Vec.h.

Member Function Documentation

template<typename T>
T Vec3< T >::operator* ( const Vec3< T > &  v) const
inline

Inner product operator.

Parameters
[in]vVector to scalar multiply with this vector
Returns
Scalar product of this and given vector

Definition at line 101 of file Vec.h.

template<typename T>
Vec3<T> Vec3< T >::operator* ( const T  a) const
inline

Multiplication with scalar operator.

Parameters
[in]aScalar to multiply this vector with
Returns
Vector scaled by given scalar

Definition at line 110 of file Vec.h.

template<typename T>
void Vec3< T >::operator*= ( const T  a) const
inline

In-place multiplication with scalar operator.

Parameters
[in]aScalar to multiply this vector with in-place

Definition at line 118 of file Vec.h.

template<typename T>
Vec3<T> Vec3< T >::operator+ ( const Vec3< T > &  v) const
inline

Addition operator.

Parameters
[in]vVector to add to this vector
Returns
Vector sum of this vector and given vector

Definition at line 82 of file Vec.h.

template<typename T>
void Vec3< T >::operator+= ( const Vec3< T > &  v)
inline

In-place addition operator.

Parameters
[in]vVector to add to this vector in-place

Definition at line 90 of file Vec.h.

template<typename T>
T& Vec3< T >::operator[] ( int  i)
inline

Non-constant access operator.

Parameters
[in]iVector component to return
Returns
Reference to specified component of template type

Definition at line 64 of file Vec.h.

template<typename T>
const T& Vec3< T >::operator[] ( int  i) const
inline

Constant access operator.

Parameters
[in]iVector component to return
Returns
Const reference to specified component of template type

Definition at line 71 of file Vec.h.

Member Data Documentation

template<typename T>
std::vector<T> Vec3< T >::data_
protected

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