kspaceFirstOrder3D-OMP
1.2
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
The class for real matrices. More...
#include <RealMatrix.h>
Public Member Functions | |
RealMatrix ()=delete | |
Default constructor is not allowed. | |
RealMatrix (const DimensionSizes &dimensionSizes) | |
Constructor. More... | |
RealMatrix (const RealMatrix &)=delete | |
Copy constructor not allowed. | |
virtual | ~RealMatrix () |
Destructor. More... | |
RealMatrix & | operator= (const RealMatrix &) |
Operator= is not allowed. | |
virtual void | readData (Hdf5File &file, MatrixName &matrixName) |
Read matrix from HDF5 file. More... | |
virtual void | writeData (Hdf5File &file, MatrixName &matrixName, const size_t compressionLevel) |
Write data into HDF5 file. More... | |
float & | operator[] (const size_t &index) |
operator[]. More... | |
const float & | operator[] (const size_t &index) const |
Operator[], constant version. More... | |
float & | getElementFrom3D (const size_t x, const size_t y, const size_t z) |
Get element from 3D matrix. More... | |
const float & | getElementFrom3D (const size_t x, const size_t y, const size_t z) const |
Get element from 3D matrix, const version. More... | |
Public Member Functions inherited from BaseFloatMatrix | |
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. | |
Private Member Functions | |
void | initDimensions (const DimensionSizes &dimensionSizes) |
Init dimension. More... | |
Static Private Attributes | |
static constexpr size_t | kChunkSize1D4MB = 1048576 |
Number of elements to get 4MB block of data. | |
static constexpr size_t | kChunkSize1D1MB = 262144 |
Number of elements to get 1MB block of data. | |
static constexpr size_t | kChunkSize1D256kB = 65536 |
Number of elements to get 256KB block of data. | |
Additional Inherited Members | |
Protected Member Functions inherited from BaseFloatMatrix | |
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 inherited from BaseFloatMatrix | |
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. | |
The class for real matrices (floats) on both CPU and GPU side.
Definition at line 47 of file RealMatrix.h.
RealMatrix::RealMatrix | ( | const DimensionSizes & | dimensionSizes | ) |
[in] | dimensionSizes | - Dimension sizes of the matrix. |
Constructor.
Definition at line 52 of file RealMatrix.cpp.
|
virtual |
Destructor.
Definition at line 63 of file RealMatrix.cpp.
|
inline |
[in] | x | - x dimension |
[in] | y | - y dimension |
[in] | z | - z dimension |
Definition at line 107 of file RealMatrix.h.
|
inline |
[in] | x | - z dimension |
[in] | y | - y dimension |
[in] | z | - z dimension |
Definition at line 119 of file RealMatrix.h.
|
private |
Set necessary dimensions and auxiliary variables.
Definition at line 147 of file RealMatrix.cpp.
|
inline |
[in] | index | - 1D index into the matrix. |
Definition at line 92 of file RealMatrix.h.
|
inline |
[in] | index | - 1D index into the matrix. |
Definition at line 98 of file RealMatrix.h.
|
virtual |
Read matrix from HDF5 file.
[in] | file | - Handle to the HDF5 file |
[in] | matrixName | - HDF5 dataset name to read from |
ios::failure | - If error occurred. |
Read data data from HDF5 file (only from the root group).
Implements BaseMatrix.
Definition at line 72 of file RealMatrix.cpp.
|
virtual |
Write data into HDF5 file.
[in] | file | - Handle to the HDF5 file |
[in] | matrixName | - HDF5 dataset name to write to |
[in] | compressionLevel | - Compression level for the HDF5 dataset |
ios::failure | - If an error occurred. |
Write data to HDF5 file (only from the root group)
Implements BaseMatrix.
Definition at line 94 of file RealMatrix.cpp.