#include <vector.h>
Public Member Functions | |
| Vector () | |
| Vector (T v) | |
| Vector (T x, T y) | |
| Vector (T x, T y, T z) | |
| Vector (const Vector &a) | |
| Vector & | operator= (const Vector &a) |
| void | setZero () |
| T | operator[] (unsigned int i) const |
| T & | operator[] (unsigned int i) |
| const T * | array () const |
| T * | array () |
| int | dimension () const |
| T | innerProduct (const Vector &a) const |
| T | norm2 () const |
| T | norm () const |
| Vector | unit () const |
| void | invert () |
| Vector | operator- () const |
| Vector & | operator+= (const Vector< T, N > &b) |
| Vector & | operator-= (const Vector< T, N > &b) |
| Vector & | operator *= (T d) |
| Vector & | operator/= (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) |
| 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 *= | ( | T | d | ) |
Multiply *this by d
| Vector< T, N > & operator/= | ( | T | d | ) |
Divide *this by d
Calculate a+b
Calculate a-b
1.5.1