![]() |
|
#include <vector_matrix.h>
Public Member Functions | |
| VectorMatrix () | |
| Default constructor - constructs an empty matrix. More... | |
| VectorMatrix (const unsigned &n, const unsigned &m, const VALUE_TYPE &val) | |
| Constructor - constructs an n by m matrix with value val. More... | |
| VectorMatrix (const unsigned &n, const unsigned &m) | |
| virtual | ~VectorMatrix () |
| Default virtual destructor. More... | |
| const unsigned | nrow () const |
| returns the number of rows. This is the outer Vector size. More... | |
| const unsigned | ncol () const |
| Vector< VALUE_TYPE > & | operator[] (const size_t i) |
| [] access function to the i-th inner vector. More... | |
| const Vector< VALUE_TYPE > & | operator[] (const size_t i) const |
| [] access function to the i-th inner vector const version More... | |
| void | clear () |
| void | resize (const size_t &n, const size_t &m, VALUE_TYPE val=VALUE_TYPE()) |
| void | assign (const size_t &n, const size_t &m, const VALUE_TYPE &val) |
Protected Member Functions | |
| void | build_vectors (const unsigned &n, const unsigned &m) |
| Builds an n by m VectorMatrix with default VALUE_TYPE. More... | |
| void | build_vectors_and_value (const unsigned &n, const unsigned &m, const VALUE_TYPE &val) |
| Build an m by n VectorMatrix with VALUE_TYPE val. More... | |
Protected Attributes | |
| Vector< Vector< VALUE_TYPE > > | Vector_matrix |
VectorMatrix is a generalised, STL-map-based, matrix based on a Vector of Vectors.
Example of usage:
|
inline |
Default constructor - constructs an empty matrix.
References oomph::VectorMatrix< VALUE_TYPE >::Vector_matrix.
|
inline |
Constructor - constructs an n by m matrix with value val.
References oomph::VectorMatrix< VALUE_TYPE >::build_vectors_and_value(), m, and calibrate::val.
|
inline |
Constructor - constructs an n by m matrix, the value is defined by the default initialisation of VALUE_TYPE.
References oomph::VectorMatrix< VALUE_TYPE >::build_vectors(), and m.
|
inlinevirtual |
|
inline |
Any elements held in the container before the call are destroyed and replaced by newly constructed elements (no assignments of elements take place). This causes an automatic reallocation of the allocated storage space if -and only if- the new vector size surpasses the current vector capacity. This invokes std::assign on both the outer vector and the inner vectors.
References m, n, calibrate::val, and oomph::VectorMatrix< VALUE_TYPE >::Vector_matrix.
Referenced by main().
|
inlineprotected |
Builds an n by m VectorMatrix with default VALUE_TYPE.
References m, n, and oomph::VectorMatrix< VALUE_TYPE >::Vector_matrix.
Referenced by oomph::VectorMatrix< VALUE_TYPE >::VectorMatrix().
|
inlineprotected |
Build an m by n VectorMatrix with VALUE_TYPE val.
References m, n, calibrate::val, and oomph::VectorMatrix< VALUE_TYPE >::Vector_matrix.
Referenced by oomph::VectorMatrix< VALUE_TYPE >::VectorMatrix().
|
inline |
Clears the outer vector. Calling Vector::clear() will invoke the destructor of all the inner Vectors.
References oomph::VectorMatrix< VALUE_TYPE >::Vector_matrix.
Referenced by main(), and oomph::VectorMatrix< VALUE_TYPE >::~VectorMatrix().
|
inline |
return the number of columns. This is the size of the first inner vectors, or returns 0 if the outer vector is of size 0 (this->nrow() is 0).
References oomph::VectorMatrix< VALUE_TYPE >::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::VectorMatrix< VALUE_TYPE >::Vector_matrix.
Referenced by oomph::BlockPreconditioner< MATRIX >::get_concatenated_block(), and main().
|
inline |
returns the number of rows. This is the outer Vector size.
References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::VectorMatrix< VALUE_TYPE >::Vector_matrix.
Referenced by oomph::BlockPreconditioner< MATRIX >::get_concatenated_block(), main(), and oomph::VectorMatrix< VALUE_TYPE >::ncol().
|
inline |
[] access function to the i-th inner vector.
References i, and oomph::VectorMatrix< VALUE_TYPE >::Vector_matrix.
|
inline |
[] access function to the i-th inner vector const version
References i, and oomph::VectorMatrix< VALUE_TYPE >::Vector_matrix.
|
inline |
Resize the existing VectorMatrix. WARNING: This invokes the resize function in std::vector, as such, only new values are assigned, old values as kept. e.g. if vec = [2,2,2], then vec.resize(5,3) gives vec = [2, 2, 2, 3, 3].
References i, m, n, calibrate::val, and oomph::VectorMatrix< VALUE_TYPE >::Vector_matrix.
Referenced by main().
|
protected |
Here's the generalised matrix structure: A Vector of Vector to templated by VALUE_TYPE.
Referenced by oomph::VectorMatrix< VALUE_TYPE >::assign(), oomph::VectorMatrix< VALUE_TYPE >::build_vectors(), oomph::VectorMatrix< VALUE_TYPE >::build_vectors_and_value(), oomph::VectorMatrix< VALUE_TYPE >::clear(), oomph::VectorMatrix< VALUE_TYPE >::ncol(), oomph::VectorMatrix< VALUE_TYPE >::nrow(), oomph::VectorMatrix< VALUE_TYPE >::operator[](), oomph::VectorMatrix< VALUE_TYPE >::resize(), and oomph::VectorMatrix< VALUE_TYPE >::VectorMatrix().