Vector Class Template Reference
[Fixed-size vector]

Fixed-length vector. More...

#include <vector.h>

List of all members.

Public Member Functions

 Vector ()
 Vector (T v)
 Vector (T x, T y)
 Vector (T x, T y, T z)
 Vector (const Vector &a)
Vectoroperator= (const Vector &a)
void setZero ()
operator[] (unsigned int i) const
T & operator[] (unsigned int i)
const T * array () const
T * array ()
int dimension () const
innerProduct (const Vector &a) const
norm2 () const
norm () const
Vector unit () const
void invert ()
Vector operator- () const
Vectoroperator+= (const Vector< T, N > &b)
Vectoroperator-= (const Vector< T, N > &b)
Vectoroperator *= (T d)
Vectoroperator/= (T d)

Friends

template<typename T1, int N1>
Vector< T1, N1 > operator+ (const Vector< T1, N1 > &a, const Vector< T1, N1 > &b)
template<typename T1, int N1>
Vector< T1, N1 > operator- (const Vector< T1, N1 > &a, const Vector< T1, N1 > &b)
template<typename T1, int N1>
Vector< T1, N1 > operator * (T1 d, const Vector< T1, N1 > &a)
template<typename T1, int N1>
Vector< T1, N1 > operator * (const Vector< T1, N1 > &a, T1 d)
template<typename T1, int N1>
Vector< T1, N1 > operator/ (const Vector< T1, N1 > &a, T1 d)


Detailed Description

template<typename T, int N>
class StepCore::Vector< T, N >

Fixed-length vector.


Constructor & Destructor Documentation

Vector (  )  [inline]

Constructs uninitialized Vector

Vector ( v  )  [inline, explicit]

Constructs Vector filled with v

Vector ( x,
y 
) [inline, explicit]

Constructs Vector (x, y)

Vector ( x,
y,
z 
) [inline, explicit]

Constructs Vector (x, y, z)

Vector ( const Vector< T, N > &  a  )  [inline]

Copy constructor


Member Function Documentation

Vector< T, N > & operator= ( const Vector< T, N > &  a  )  [inline]

Copies a to *this

void setZero (  )  [inline]

Resets all components of *this to zero

T operator[] ( unsigned int  i  )  const [inline]

Get component of the Vector

T& operator[] ( unsigned int  i  )  [inline]

Get reference to the component of the Vector

const T* array (  )  const [inline]

Get contents of the Vector as constant array

T* array (  )  [inline]

Get contents of the Vector as array

int dimension (  )  const [inline]

Get Vector dimension

T innerProduct ( const Vector< T, N > &  a  )  const

Calculate inner product of *this and a

T norm2 (  )  const [inline]

Calculate square of the norm of *this

T norm (  )  const [inline]

Calculate the norm of *this

Vector unit (  )  const [inline]

Calculate unit vector with the same direction as *this

void invert (  ) 

Invert all components of *this (*this = -*this)

Vector< T, N > operator- (  )  const

Calculate -*this

Vector< T, N > & operator+= ( const Vector< T, N > &  b  ) 

Add b to *this

Vector< T, N > & operator-= ( const Vector< T, N > &  b  ) 

Subtract b from *this

Vector< T, N > & operator *= ( d  ) 

Multiply *this by d

Vector< T, N > & operator/= ( d  ) 

Divide *this by d


Friends And Related Function Documentation

Vector<T1,N1> operator+ ( const Vector< T1, N1 > &  a,
const Vector< T1, N1 > &  b 
) [friend]

Calculate a+b

Vector<T1,N1> operator- ( const Vector< T1, N1 > &  a,
const Vector< T1, N1 > &  b 
) [friend]

Calculate a-b

Vector<T1,N1> operator * ( T1  d,
const Vector< T1, N1 > &  a 
) [friend]

Calculate d * a

Vector<T1,N1> operator * ( const Vector< T1, N1 > &  a,
T1  d 
) [friend]

Calculate a * d

Vector<T1,N1> operator/ ( const Vector< T1, N1 > &  a,
T1  d 
) [friend]

Calculate a / d


The documentation for this class was generated from the following file:
Generated on Thu Mar 15 14:23:37 2007 for StepCore by  doxygen 1.5.1