|
ParM
parm
A molecular dynamics library
|
An N-dimensional vector, extending addition and subtraction from the type T to the NVector class. More...
#include <vec.hpp>
Public Types | |
| typedef T * | iterator |
Public Member Functions | |
| NVector () | |
| NVector (const NVector &rhs) | |
| template<class U > | |
| NVector (const NVector< U, N > &rhs) | |
| NVector (const T locs[N]) | |
| const T & | get (const unsigned int n) const |
| void | set (const unsigned int n, const T a) |
| unsigned int | len () const |
| NVector & | operator+= (const NVector &rhs) |
| NVector & | operator-= (const NVector &rhs) |
| template<class U > | |
| NVector & | operator*= (const U rhs) |
| template<class U > | |
| NVector & | operator/= (const U rhs) |
| NVector | operator- () const |
| NVector | operator+ (const NVector &rhs) const |
| NVector | operator- (const NVector &rhs) const |
| T & | operator[] (const unsigned int i) |
| const T & | operator[] (const unsigned int i) const |
| template<class U > | |
| NVector | operator* (const U rhs) const |
| Multiplication by a scalar. More... | |
| template<class U > | |
| NVector | operator/ (const U rhs) const |
| Division by a scalar. More... | |
| T * | begin () |
| T * | end () |
| ~NVector () | |
| template<class U > | |
| NVector< T, N > & | operator*= (const U rhs) |
| template<class U > | |
| NVector< T, N > & | operator/= (const U rhs) |
Protected Attributes | |
| T | vals [N] |
Friends | |
| template<class U , unsigned int M> | |
| ostream & | operator<< (ostream &out, const NVector< U, M > v) |
An N-dimensional vector, extending addition and subtraction from the type T to the NVector class.
This is extended by NumVector for things like multiplication and division, but you can use NVector for something like an array of NumVectors.
| T | a type that can be added and subtracted. |
| N | the number of dimensions. |
| NVector< T, N >::NVector | ( | const NVector< U, N > & | rhs | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Multiplication by a scalar.
| NVector& NVector< T, N >::operator*= | ( | const U | rhs | ) |
| NVector<T,N>& NVector< T, N >::operator*= | ( | const U | rhs | ) |
|
inline |
| NVector< T, N > & NVector< T, N >::operator+= | ( | const NVector< T, N > & | rhs | ) |
|
inline |
| NVector< T, N > & NVector< T, N >::operator-= | ( | const NVector< T, N > & | rhs | ) |
|
inline |
Division by a scalar.
| NVector& NVector< T, N >::operator/= | ( | const U | rhs | ) |
| NVector<T,N>& NVector< T, N >::operator/= | ( | const U | rhs | ) |
|
inline |
|
inline |
|
inline |
|
friend |
|
protected |
1.8.10