|
Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
|
Defines a contiguous storage for two-dimensional numerical data in row-major format. More...
#include <array2d.h>
Public Member Functions | |
| Array2D ()=default | |
| Initialises new instance of the Array2D class with no storage. | |
| Array2D (const size_t nrows, const size_t ncols) | |
| Initialises new instance of the Array2D class. | |
| Array2D (const size_t nrows, const size_t ncols, TYPE value) | |
| Initialises new instance of the Array2D class with custom default value. | |
| Array2D (const size_t nrows, const size_t ncols, std::vector< TYPE > &values) | |
| Initialises new instance of the Array2D class with custom values. | |
| size_t | size () const noexcept |
| Gets the total size of the array storage. | |
| size_t | rows () const noexcept |
| Gets the number of rows in the array. | |
| size_t | columns () const noexcept |
| Gets the number of coluns in the array. | |
| TYPE & | operator() (size_t row, size_t column) |
| Gets a value from the array. | |
| const TYPE & | operator() (size_t row, size_t column) const |
| Gets a read-only value from the array. | |
| void | fill (TYPE value) |
| Fill the array data with a default value. | |
| void | clear () |
| Clears the array data with the default type value. | |
| std::vector< TYPE > | to_vector () |
| Creates a vector copy of the array data. | |
| std::string | to_string () noexcept |
| Creates a string representation of the array data. | |
Defines a contiguous storage for two-dimensional numerical data in row-major format.
| TYPE | The numerical type to store |
|
default |
Initialises new instance of the Array2D class with no storage.
|
inline |
Initialises new instance of the Array2D class.
| nrows | The number of rows in the array |
| ncols | The number fo columns in the array |
| std::invalid_argument | for array with zero size storage; |
|
inline |
Initialises new instance of the Array2D class with custom default value.
| nrows | The number of rows in the array |
| ncols | The number of columns in the array |
| value | The default value to initialise the array values |
| std::invalid_argument | for array with zero size storage; |
|
inline |
Initialises new instance of the Array2D class with custom values.
| nrows | The number of rows in the array |
| ncols | The number of columns in the array |
| values | Array of values to initialise the storage |
| std::invalid_argument | for array size and values size mismatch. |
|
inline |
Clears the array data with the default type value.
|
inlinenoexcept |
Gets the number of coluns in the array.
|
inline |
Fill the array data with a default value.
| value | The default value to store in the array |
|
inline |
Gets a value from the array.
| row | The zero-based row index |
| column | The zero-based columns index |
|
inline |
Gets a read-only value from the array.
| row | The zero-based row index |
| column | The zero-based columns index |
|
inlinenoexcept |
Gets the number of rows in the array.
|
inlinenoexcept |
Gets the total size of the array storage.
|
inlinenoexcept |
Creates a string representation of the array data.
|
inline |
Creates a vector copy of the array data.