kspaceFirstOrder3D-OMP
1.2
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
Abstract base class for float based matrices defining basic interface. Higher dimensional matrices stored as 1D arrays, row-major order. More...
#include <BaseFloatMatrix.h>
Public Member Functions | |
BaseFloatMatrix () | |
Default constructor. More... | |
BaseFloatMatrix (const BaseFloatMatrix &)=delete | |
Copy constructor is not allowed. | |
virtual | ~BaseFloatMatrix () |
Destructor. | |
BaseFloatMatrix & | operator= (const BaseFloatMatrix &)=delete |
operator= is not allowed. | |
virtual const DimensionSizes & | getDimensionSizes () const |
Get dimension sizes of the matrix. More... | |
virtual size_t | size () const |
Size of the matrix. More... | |
virtual size_t | capacity () const |
The capacity of the matrix (this may differ from size due to padding, etc.). More... | |
virtual void | copyData (const BaseFloatMatrix &src) |
Copy data from other matrix with the same size. More... | |
virtual void | zeroMatrix () |
Zero all elements of the matrix (NUMA first touch). More... | |
virtual void | scalarDividedBy (const float scalar) |
Calculate matrix = scalar / matrix. More... | |
virtual float * | getData () |
Get raw data out of the class (for direct kernel access). More... | |
virtual const float * | getData () const |
Get raw data out of the class (for direct kernel access), const version. More... | |
Public Member Functions inherited from BaseMatrix | |
BaseMatrix () | |
Default constructor. | |
BaseMatrix (const BaseMatrix &)=delete | |
Copy constructor is not allowed. | |
virtual | ~BaseMatrix () |
Destructor. | |
BaseMatrix & | operator= (const BaseMatrix &)=delete |
Operator= is not allowed. | |
virtual void | readData (Hdf5File &file, MatrixName &matrixName)=0 |
Read matrix from HDF5 file. More... | |
virtual void | writeData (Hdf5File &file, MatrixName &matrixName, const size_t compressionLevel)=0 |
Write data into HDF5 file. More... | |
Protected Member Functions | |
virtual void | allocateMemory () |
Aligned memory allocation (both on CPU and GPU). More... | |
virtual void | freeMemory () |
Memory allocation (both on CPU and GPU). More... | |
Protected Attributes | |
size_t | mSize |
Total number of used elements. | |
size_t | mCapacity |
Total number of allocated elements (in terms of floats). | |
DimensionSizes | mDimensionSizes |
Dimension sizes. | |
size_t | mRowSize |
Size of a 1D row in X dimension. | |
size_t | mSlabSize |
Size of a XY slab. | |
float * | mData |
Raw matrix data. | |
Abstract base class for float based matrices defining basic interface. Higher dimensional matrices stored as 1D arrays, row-major order. The I/O is done via HDF5 files.
Definition at line 47 of file BaseFloatMatrix.h.
BaseFloatMatrix::BaseFloatMatrix | ( | ) |
Default constructor.
Definition at line 56 of file BaseFloatMatrix.cpp.
|
protectedvirtual |
std::bad_alloc | - If there's not enough memory. |
Memory allocation based on the capacity and aligned at kDataAlignment
Reimplemented in FftwComplexMatrix.
Definition at line 114 of file BaseFloatMatrix.cpp.
|
inlinevirtual |
Implements BaseMatrix.
Definition at line 75 of file BaseFloatMatrix.h.
|
virtual |
[in] | src | - Matrix to copy data in. |
Copy data from another matrix with same size.
Definition at line 70 of file BaseFloatMatrix.cpp.
|
protectedvirtual |
Free memory.
Reimplemented in FftwComplexMatrix.
Definition at line 133 of file BaseFloatMatrix.cpp.
|
inlinevirtual |
Definition at line 96 of file BaseFloatMatrix.h.
|
inlinevirtual |
Definition at line 102 of file BaseFloatMatrix.h.
|
inlinevirtual |
Implements BaseMatrix.
Definition at line 65 of file BaseFloatMatrix.h.
|
virtual |
[in] | scalar | - Scalar constant |
Calculate matrix = scalar / matrix.
Definition at line 96 of file BaseFloatMatrix.cpp.
|
inlinevirtual |
|
virtual |
Zero all allocated elements in parallel for NUMA first touch.
Definition at line 83 of file BaseFloatMatrix.cpp.