![]() |
SCOREC core
Parallel unstructured mesh tools
|
compile-time (static) vector of size N More...
Public Member Functions | |
| Vector () | |
| default constructor | |
| Vector (unsigned n) | |
| construct with n elems More... | |
| Vector (T const *v) | |
| construct from an array | |
| T & | operator() (unsigned i) |
| mutable index operator More... | |
| T const & | operator() (unsigned i) const |
| immutable index operator | |
| Vector< T, N > & | operator+= (Vector< T, N > const &b) |
| add a vector to this vector | |
| Vector< T, N > | operator+ (Vector< T, N > const &b) const |
| add two vectors | |
| Vector< T, N > & | operator-= (Vector< T, N > const &b) |
| subtract a vector from this vector | |
| Vector< T, N > | operator- (Vector< T, N > const &b) const |
| subtract two vectors | |
| Vector< T, N > | operator* (T const &s) const |
| multiply a vector times a scalar More... | |
| Vector< T, N > | operator/ (T const &s) const |
| divide a vector by a scalar More... | |
| T | operator* (Vector< T, N > const &b) const |
| vector dot product More... | |
| T | getLength () const |
| get the vector magnitude | |
| Vector< T, N > | normalize () const |
| divide the vector by its magnitude | |
| void | zero () |
| zero the vector | |
Public Member Functions inherited from can::Array< T, 0 > | |
| Array () | |
| default constructor - no allocation | |
| Array (unsigned n) | |
| construct with n elems | |
| Array (Array< T, 0 > const &other) | |
| copy constructor | |
| ~Array () | |
| destructor - need to delete elems | |
| Array< T, 0 > & | operator= (Array< T, 0 > const &other) |
| assignment operator | |
| T & | operator[] (unsigned i) |
| mutable index operator | |
| T const & | operator[] (unsigned i) const |
| immutable index operator | |
| unsigned | size () const |
| get the size of this array | |
| void | resize (unsigned n) |
| resize the array | |
compile-time (static) vector of size N
This class endows Array<T,N> with the standard mathematical properties of a linear algebra vector. The vector is templated on scalar type so that math can be performed for a variety of (meaningful) scalar types.
Definition at line 29 of file mthVector.h.
|
inline |
construct with n elems
A dummy constructor Vector(n) is provided so that dynamic and static vectors can be used interchangebly
Definition at line 37 of file mthVector.h.
|
inline |
mutable index operator
An index operator (i) is provided so that mth::Vector and mth::Matrix share a common index operator
Definition at line 47 of file mthVector.h.
|
inline |
multiply a vector times a scalar
currently there is no scalar times vector operator, so do be sure to put scalar on the right hand side
Definition at line 84 of file mthVector.h.
|
inline |
vector dot product
we chose the default vector-vector multiplication operator to be the dot product. so far this seems to have been a good choice
Definition at line 104 of file mthVector.h.
|
inline |
1.9.1