kspaceFirstOrder3D-OMP  1.2
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
ComplexMatrix Class Reference

The class for complex matrices. More...

#include <ComplexMatrix.h>

Inheritance diagram for ComplexMatrix:
Collaboration diagram for ComplexMatrix:

Public Member Functions

 ComplexMatrix ()=delete
 Default constructor not allowed.
 
 ComplexMatrix (const DimensionSizes &dimensionSizes)
 Constructor. More...
 
 ComplexMatrix (const ComplexMatrix &)=delete
 Copy constructor not allowed.
 
virtual ~ComplexMatrix ()
 Destructor. More...
 
ComplexMatrixoperator= (const ComplexMatrix &)
 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...
 
virtual FloatComplexgetComplexData ()
 Get raw complex data out of the class (for direct kernel access). More...
 
virtual const FloatComplexgetComplexData () const
 Get raw complex data out of the class (for direct kernel access). More...
 
FloatComplexoperator[] (const size_t &index)
 Operator []. More...
 
const FloatComplexoperator[] (const size_t &index) const
 Operator [], constant version. More...
 
FloatComplexGetElementFrom3D (const size_t x, const size_t y, const size_t z)
 Get element from 3D matrix. More...
 
const FloatComplexGetElementFrom3D (const size_t x, const size_t y, const size_t z) const
 Get element from 3D matrix, constant version. More...
 
- Public Member Functions inherited from BaseFloatMatrix
 BaseFloatMatrix ()
 Default constructor. More...
 
 BaseFloatMatrix (const BaseFloatMatrix &)=delete
 Copy constructor is not allowed.
 
virtual ~BaseFloatMatrix ()
 Destructor.
 
BaseFloatMatrixoperator= (const BaseFloatMatrix &)=delete
 operator= is not allowed.
 
virtual const DimensionSizesgetDimensionSizes () 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.
 
BaseMatrixoperator= (const BaseMatrix &)=delete
 Operator= is not allowed.
 

Private Member Functions

void initDimensions (const DimensionSizes &dimensionSizes)
 Initialize dimension sizes. More...
 

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.
 

Detailed Description

The class for complex matrices.

Definition at line 51 of file ComplexMatrix.h.

Constructor & Destructor Documentation

◆ ComplexMatrix()

ComplexMatrix::ComplexMatrix ( const DimensionSizes dimensionSizes)
Parameters
[in]dimensionSizes- Dimension sizes of the matrix.

Constructor.

Definition at line 49 of file ComplexMatrix.cpp.

◆ ~ComplexMatrix()

ComplexMatrix::~ComplexMatrix ( )
virtual

Destructor.

Definition at line 60 of file ComplexMatrix.cpp.

Member Function Documentation

◆ getComplexData() [1/2]

virtual FloatComplex* ComplexMatrix::getComplexData ( )
inlinevirtual
Returns
Mutable matrix data

Definition at line 96 of file ComplexMatrix.h.

◆ getComplexData() [2/2]

virtual const FloatComplex* ComplexMatrix::getComplexData ( ) const
inlinevirtual
Returns
Imutable matrix data

Definition at line 105 of file ComplexMatrix.h.

◆ GetElementFrom3D() [1/2]

FloatComplex& ComplexMatrix::GetElementFrom3D ( const size_t  x,
const size_t  y,
const size_t  z 
)
inline

Get element from 3D matrix.

Parameters
[in]x- x dimension
[in]y- y dimension
[in]z- z dimension
Returns
a complex element of the class

Definition at line 137 of file ComplexMatrix.h.

◆ GetElementFrom3D() [2/2]

const FloatComplex& ComplexMatrix::GetElementFrom3D ( const size_t  x,
const size_t  y,
const size_t  z 
) const
inline

Get element from 3D matrix, constant version.

Parameters
[in]x- x dimension
[in]y- y dimension
[in]z- z dimension
Returns
a complex element of the class

Definition at line 152 of file ComplexMatrix.h.

◆ initDimensions()

void ComplexMatrix::initDimensions ( const DimensionSizes dimensionSizes)
private
Parameters
[in]dimensionSizes- Dimension sizes of the matrix.

Initialize matrix dimension sizes.

Definition at line 136 of file ComplexMatrix.cpp.

◆ operator[]() [1/2]

FloatComplex& ComplexMatrix::operator[] ( const size_t &  index)
inline
Parameters
[in]index- 1D index into the matrix.
Returns
An element of the matrix.

Definition at line 115 of file ComplexMatrix.h.

◆ operator[]() [2/2]

const FloatComplex& ComplexMatrix::operator[] ( const size_t &  index) const
inline
Parameters
[in]index- 1D index into the matrix.
Returns
An element of the matrix.

Definition at line 124 of file ComplexMatrix.h.

◆ readData()

void ComplexMatrix::readData ( Hdf5File file,
MatrixName matrixName 
)
virtual

Read matrix from HDF5 file.

Parameters
[in]file- Handle to the HDF5 file.
[in]matrixName- HDF5 dataset name to read from.
Exceptions
ios::failure- If error occurred.

Read data from HDF5 file (do some basic checks). Only from the root group.

Implements BaseMatrix.

Definition at line 69 of file ComplexMatrix.cpp.

◆ writeData()

void ComplexMatrix::writeData ( Hdf5File file,
MatrixName matrixName,
const size_t  compressionLevel 
)
virtual

Write data into HDF5 file.

Parameters
[in]file- Handle to the HDF5 file
[in]matrixName- HDF5 dataset name to write to.
[in]compressionLevel- Compression level for the HDF5 dataset.
Exceptions
ios::failure- If an error occurred.

Write data to HDF5 file (only from the root group).

Implements BaseMatrix.

Definition at line 96 of file ComplexMatrix.cpp.


The documentation for this class was generated from the following files: