svMultiPhysics
|
The Array3 template class implements a simple interface to 3D arrays. More...
#include <Array3.h>
Public Member Functions | |
Array3 (const int num_rows, const int num_cols, const int num_slices, bool row_major=true) | |
Array3 (const Array3 &rhs) | |
Array copy. More... | |
int | ncols () const |
int | nrows () const |
int | nslices () const |
void | allocate (const int num_rows, const int num_cols, const int num_slices, const bool row_major=true) |
void | check_index (const int i, const int j, const int k) const |
void | clear () |
Free the array data. More... | |
Array< T > | rslice (const int slice) const |
rslice More... | |
T * | slice_data (const int slice) |
void | print (const std::string &label) |
Array< T > | slice (const int slice) const |
Get a slice. More... | |
void | set_row (const int col, const int slice, const std::vector< T > &values) const |
void | set_slice (const int slice, const Array< T > &values) const |
int | size () const |
bool | allocated () |
Test if an array has rows or columns or slices set but no data. More... | |
int | msize () const |
void | resize (const int num_rows, const int num_cols, const int num_slices) |
Resize the array. More... | |
void | set_values (Array< T > &rhs) |
Set the array values from an Array with the equivalent number of values. More... | |
void | read (const std::string &file_name) |
void | write (const std::string &label, bool memory=true) |
void | append (const std::string &label, bool memory=true) |
Array3 & | operator= (const Array3 &rhs) |
Array assignment. More... | |
const T & | operator() (const int row, const int col, const int slice) const |
Get the array value at (row,col). More... | |
T & | operator() (const int row, const int col, const int slice) |
Set the array value at (row,col). More... | |
Array3 & | operator= (const double value) |
Array3< T > | operator* (const T value) const |
Multiply by a scalar. More... | |
Array3< T > & | operator*= (const T value) |
T * | data () const |
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 bool | show_index_check_message |
static double | memory_in_use |
static double | memory_returned |
static bool | write_enabled |
The Array3 template class implements a simple interface to 3D arrays.
A 3D array is defined by (num_rows * num_cols) * num_slices values.
|
inline |
Test if an array has rows or columns or slices set but no data.
[NOTE] This is tfu but need to mimic fortran.
|
inline |
Free the array data.
This is to replicate the Fortran DEALLOCATE().
|
inline |
Set the array value at (row,col).
|
inline |
Get the array value at (row,col).
Multiply by a scalar.
Array assignment.
Copy data to replicate Fortran behavior.
|
inline |
Resize the array.
|
inline |
rslice
Return an Array with data pointing into the Array3 internal data.
|
inline |
Set the array values from an Array with the equivalent number of values.
This sort of replicates the Fortan reshape function.
|
inline |
Get a slice.