|
svMultiPhysics
|
The Vector template class is used for storing int and double data. More...
#include <Vector.h>
Classes | |
| class | Iterator |
| This class provides an interface to access Vector like STL containers. More... | |
Public Member Functions | |
| Vector (const int size) | |
| Vector (const int size, T *data) | |
| Vector (std::initializer_list< T > values) | |
| Vector (const Vector &rhs) | |
| bool | allocated () const |
| void | clear () |
| Free the array data. | |
| void | print (const std::string &label) |
| void | resize (const int size) |
| Resize the vector's memory. | |
| void | grow (const int size, T value={}) |
| Grow the vector. | |
| void | set_values (std::initializer_list< T > values) |
| void | set_values (std::vector< T > values) |
| void | read (const std::string &file_name) |
| void | write (const std::string &label, const T offset={}) const |
| Vector & | operator= (const Vector &rhs) |
| Vector assigment. | |
| Vector & | operator= (const double value) |
| int | size () const |
| int | msize () const |
| const T & | operator() (const int i) const |
| T & | operator() (const int i) |
| const T & | operator[] (const int i) const |
| T & | operator[] (const int i) |
| Vector< T > | operator+ (const Vector< T > &vec) const |
| Add and subtract vectors. | |
| Vector< T > | operator- (const Vector< T > &x) const |
| Vector< T > | operator+ (const T value) const |
| Add and subtract a scalar from a vector. | |
| Vector< T > | operator- (const T value) const |
| Vector< T > | operator/ (const T value) const |
| Divide by a scalar. | |
| Vector< T > | operator* (const T value) const |
| Multiply by a scalar. | |
| Vector< T > | operator- () const |
| Negate. | |
| Vector< T > | abs () const |
| Absolute value. | |
| Vector< T > | cross (const Vector< T > &v2) |
| Cross product. | |
| T | dot (const Vector< T > &v2) |
| Dot product. | |
| T | min () const |
| T | max () const |
| T | sum () const |
| Iterator | begin () const |
| Iterator | end () const |
| T * | data () const |
| void | allocate (const int size) |
| void | check_index (const int i) const |
| void | check_type () const |
| Check that the Vector template type is int or double. | |
| bool | show_index_check_message |
| double | memory_in_use |
| double | memory_returned |
| int | num_allocated |
| int | active |
| bool | write_enabled |
Static Public Member Functions | |
| static void | memory (const std::string &prefix="") |
| static void | stats (const std::string &prefix="") |
Static Public Attributes | |
| static int | num_allocated |
| static int | active |
| static double | memory_in_use |
| static double | memory_returned |
| static bool | write_enabled |
| static bool | show_index_check_message |
The Vector template class is used for storing int and double data.
|
inline |
Check that the Vector template type is int or double.
|
inline |
Free the array data.
This is to replicate the Fortran DEALLOCATE().
Cross product.
|
inline |
Grow the vector.
Multiply by a scalar.
Add and subtract a scalar from a vector.
Add and subtract vectors.
Divide by a scalar.
Vector assigment.
Note: There are two ways to do this:
1) Swap pointers to data_
2) Copy data_
Fortran using 2) I think.
|
inline |
Resize the vector's memory.