![]() |
SCOREC core
Parallel unstructured mesh tools
|
run-time (dynamic) vector More...
Public Member Functions | |
| Vector () | |
| default constructor - no allocation | |
| Vector (unsigned n) | |
| construct with n elements | |
| T & | operator() (unsigned i) |
| mutable index operator More... | |
| T const & | operator() (unsigned i) const |
| immutable index operator | |
| Vector< T, 0 > & | operator+= (Vector< T, 0 > const &b) |
| add a vector to this vector | |
| Vector< T, 0 > & | operator-= (Vector< T, 0 > const &b) |
| subtract a vector from this vector | |
| Vector< T, 0 > & | operator*= (T const &s) |
| multiply this vector by a scalar | |
| Vector< T, 0 > & | operator/= (T const &s) |
| divide this vector by a scalar | |
| T | getLength () const |
| get the vector 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 | |
run-time (dynamic) vector
A runtime-sized equivalent of mth::Vector<T,N>. All values are stored in a single dynamically allocated array. Due to the use of dynamic allocation, users should avoid copying class as much as possible. To help with this, we provide things like operator+= instead of operator+ to discourage users from creating temporary copies. The code for these methods is inlined in an effort to keep linear algebra running quickly
Definition at line 132 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 142 of file mthVector.h.
1.9.1