kspaceFirstOrder3D-OMP  1.1
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
 All Classes Files Functions Variables Typedefs Enumerations Friends Pages
TRealMatrix Class Reference

The class for real matrices. More...

#include <RealMatrix.h>

Inheritance diagram for TRealMatrix:
Collaboration diagram for TRealMatrix:

Public Member Functions

 TRealMatrix (const TDimensionSizes &DimensionSizes)
 Constructor. More...
 
virtual ~TRealMatrix ()
 Destructor.
 
virtual void ReadDataFromHDF5File (THDF5_File &HDF5_File, const char *MatrixName)
 Read data from the HDF5 file - only from the root group. More...
 
virtual void WriteDataToHDF5File (THDF5_File &HDF5_File, const char *MatrixName, const size_t CompressionLevel)
 Write data into the 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...
 
- Public Member Functions inherited from TBaseFloatMatrix
 TBaseFloatMatrix ()
 Default constructor.
 
virtual TDimensionSizes GetDimensionSizes () const
 Get dimension sizes of the matrix.
 
virtual size_t GetTotalElementCount () const
 Get element count of the matrix.
 
virtual size_t GetTotalAllocatedElementCount () const
 Get total allocated element count (might differ from total element count used for the simulation because of padding).
 
virtual ~TBaseFloatMatrix ()
 Destructor.
 
virtual void CopyData (const TBaseFloatMatrix &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)
 Divide scalar/ matrix_element[i]. More...
 
virtual float * GetRawData ()
 Get raw data out of the class (for direct kernel access).
 
virtual const float * GetRawData () const
 Get raw data out of the class (for direct kernel access).
 
- Public Member Functions inherited from TBaseMatrix
 TBaseMatrix ()
 Default constructor.
 
virtual ~TBaseMatrix ()
 Destructor.
 

Protected Member Functions

 TRealMatrix ()
 Default constructor is not allowed for public.
 
 TRealMatrix (const TRealMatrix &src)
 Copy constructor not allowed for public.
 
TRealMatrixoperator= (const TRealMatrix &src)
 Operator = is not allowed for public.
 
virtual void InitDimensions (const TDimensionSizes &DimensionSizes)
 Init dimension. More...
 
- Protected Member Functions inherited from TBaseFloatMatrix
virtual void AllocateMemory ()
 Memory allocation. More...
 
virtual void FreeMemory ()
 Memory deallocation. More...
 
 TBaseFloatMatrix (const TBaseFloatMatrix &src)
 Copy constructor is not directly allowed.
 
TBaseFloatMatrixoperator= (const TBaseFloatMatrix &src)
 operator = is not directly allowed.
 

Static Private Attributes

static const size_t ChunkSize_1D_4MB = 1048576
 Number of elements to get 4MB block of data.
 
static const size_t ChunkSize_1D_1MB = 262144
 Number of elements to get 1MB block of data.
 
static const size_t ChunkSize_1D_256KB = 65536
 Number of elements to get 256KB block of data.
 

Additional Inherited Members

- Protected Attributes inherited from TBaseFloatMatrix
size_t pTotalElementCount
 Total number of elements.
 
size_t pTotalAllocatedElementCount
 Total number of allocated elements (in terms of floats).
 
struct TDimensionSizes pDimensionSizes
 Dimension sizes.
 
size_t pDataRowSize
 Size of a 1D row in X dimension.
 
size_t p2DDataSliceSize
 Size of a 2D slab (X,Y).
 
float * pMatrixData
 Raw matrix data.
 

Detailed Description

The class for real matrices (floats)

Definition at line 48 of file RealMatrix.h.

Constructor & Destructor Documentation

TRealMatrix::TRealMatrix ( const TDimensionSizes DimensionSizes)

Constructor.

Parameters
[in]DimensionSizes- Dimension sizes

Definition at line 60 of file RealMatrix.cpp.

Here is the call graph for this function:

Member Function Documentation

float& TRealMatrix::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
an element

Definition at line 101 of file RealMatrix.h.

void TRealMatrix::InitDimensions ( const TDimensionSizes DimensionSizes)
protectedvirtual

Set necessary dimensions and auxiliary variables.

Parameters
[in]DimensionSizes- 3D Dimension sizes

Definition at line 171 of file RealMatrix.cpp.

Here is the caller graph for this function:

float& TRealMatrix::operator[] ( const size_t &  index)
inline

operator [].

Parameters
[in]index- 1D index
Returns
an element

Definition at line 76 of file RealMatrix.h.

const float& TRealMatrix::operator[] ( const size_t &  index) const
inline

operator [], constant version.

Parameters
[in]index- 1D index
Returns
an element

Definition at line 88 of file RealMatrix.h.

void TRealMatrix::ReadDataFromHDF5File ( THDF5_File HDF5_File,
const char *  MatrixName 
)
virtual

Read data data from HDF5 file (only from the root group).

Parameters
[in]HDF5_File- HDF5 file
[in]MatrixName- HDF5 dataset name
Exceptions
ios::failureif error occurred.

Implements TBaseMatrix.

Definition at line 77 of file RealMatrix.cpp.

Here is the call graph for this function:

void TRealMatrix::WriteDataToHDF5File ( THDF5_File HDF5_File,
const char *  MatrixName,
const size_t  CompressionLevel 
)
virtual

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

Parameters
[in]HDF5_File- HDF5 file
[in]MatrixName- HDF5 Matrix name
[in]CompressionLevel- Compression level
Exceptions
ios::failureif an error occurred

Implements TBaseMatrix.

Definition at line 114 of file RealMatrix.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


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