![]() |
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 | |
![]() | |
Array () | |
default constructor - necessary | |
Array (Array< T, N > const &other) | |
copy constructor | |
~Array () | |
elems is destroyed automatically | |
Array< T, N > & | operator= (Array< T, N > 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 | |
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 |