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
TIndexMatrix Class Reference

The class for 64b unsigned integers (indices). It is used for sensor_mask_index or sensor_corners_mask to get the address of sampled voxels. More...

#include <IndexMatrix.h>

Inheritance diagram for TIndexMatrix:
Collaboration diagram for TIndexMatrix:

Public Member Functions

 TIndexMatrix (const TDimensionSizes &DimensionSizes)
 Constructor allocating memory. More...
 
virtual ~TIndexMatrix ()
 Destructor.
 
virtual void ReadDataFromHDF5File (THDF5_File &HDF5_File, const char *MatrixName)
 Read data from the HDF5 file. More...
 
virtual void WriteDataToHDF5File (THDF5_File &HDF5_File, const char *MatrixName, const size_t CompressionLevel)
 Write data into the HDF5 file. More...
 
size_t & operator[] (const size_t &index)
 
const size_t & operator[] (const size_t &index) const
 
TDimensionSizes GetTopLeftCorner (const size_t &index) const
 Get the top left corner of the index-th cuboid. More...
 
TDimensionSizes GetBottomRightCorner (const size_t &index) const
 Get the bottom right corner of the index-th cuboid. More...
 
void RecomputeIndicesToCPP ()
 Recompute indices MATALAB->C++. More...
 
void RecomputeIndicesToMatlab ()
 Recompute indices C++ -> MATLAB. More...
 
size_t GetTotalNumberOfElementsInAllCuboids () const
 Get the total number of elements to be sampled within all cuboids. More...
 
- Public Member Functions inherited from TBaseIndexMatrix
 TBaseIndexMatrix ()
 Default constructor.
 
struct TDimensionSizes GetDimensionSizes () const
 Get dimension sizes of the matrix.
 
virtual size_t GetTotalElementCount () const
 Get total 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 ~TBaseIndexMatrix ()
 Destructor.
 
virtual void ZeroMatrix ()
 Zero all elements of the matrix (NUMA first touch). More...
 
virtual size_t * GetRawData ()
 Get raw data out of the class (for direct kernel access).
 
virtual const size_t * 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

 TIndexMatrix ()
 Default constructor not allowed for public.
 
 TIndexMatrix (const TIndexMatrix &src)
 Copy constructor not allowed for public.
 
TIndexMatrixoperator= (const TIndexMatrix &src)
 Operator = not allowed for public.
 
- Protected Member Functions inherited from TBaseIndexMatrix
virtual void AllocateMemory ()
 Memory allocation. More...
 
virtual void FreeMemory ()
 Memory deallocation. More...
 
 TBaseIndexMatrix (const TBaseIndexMatrix &src)
 Copy constructor is not directly allowed.
 
TBaseIndexMatrixoperator= (const TBaseIndexMatrix &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 TBaseIndexMatrix
size_t pTotalElementCount
 Total number of elements.
 
size_t pTotalAllocatedElementCount
 Total number of allocated elements (the array size).
 
struct TDimensionSizes pDimensionSizes
 Dimension sizes.
 
size_t pDataRowSize
 Size of 1D row in X dimension.
 
size_t p2DDataSliceSize
 Size of 2D slab (X,Y).
 
size_t * pMatrixData
 Raw matrix data.
 

Detailed Description

The class for 64b unsigned integers (indices). It is used for sensor_mask_index or sensor_corners_mask to get the address of sampled voxels.

Definition at line 50 of file IndexMatrix.h.

Constructor & Destructor Documentation

TIndexMatrix::TIndexMatrix ( const TDimensionSizes DimensionSizes)

Constructor allocating memory.

Parameters
[in]DimensionSizes- Dimension sizes

Definition at line 61 of file IndexMatrix.cpp.

Here is the call graph for this function:

Member Function Documentation

TDimensionSizes TIndexMatrix::GetBottomRightCorner ( const size_t &  index) const
inline

Get the top bottom right of the index-th cuboid. Cuboids are stored as 6-tuples (two 3D coordinates). This gives the first three coordinates

Parameters
[in]index-Id of the corner
Returns
the bottom right corner

Definition at line 116 of file IndexMatrix.h.

Here is the caller graph for this function:

TDimensionSizes TIndexMatrix::GetTopLeftCorner ( const size_t &  index) const
inline

Get the top left corner of the index-th cuboid. Cuboids are stored as 6-tuples (two 3D coordinates). This gives the first three coordinates

Parameters
[in]index- Id of the corner
Returns
the top left corner

Definition at line 99 of file IndexMatrix.h.

Here is the caller graph for this function:

size_t TIndexMatrix::GetTotalNumberOfElementsInAllCuboids ( ) const

Get total number of elements in all cuboids to be able to allocate output file.

Returns
Total sampled grid points

Definition at line 152 of file IndexMatrix.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

size_t& TIndexMatrix::operator[] ( const size_t &  index)
inline

Operator [].

Parameters
[in]index- 1D index into the matrix
Returns
Value of the index

Definition at line 76 of file IndexMatrix.h.

const size_t& TIndexMatrix::operator[] ( const size_t &  index) const
inline

Operator [], constant version

Parameters
[in]index- 1D index into the matrix
Returns
Value of the index

Definition at line 86 of file IndexMatrix.h.

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

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

Parameters
[in]HDF5_File- HDF5 file handle
[in]MatrixName- HDF5 dataset name
Exceptions
ios:failureif there's an error

Implements TBaseMatrix.

Definition at line 90 of file IndexMatrix.cpp.

Here is the call graph for this function:

void TIndexMatrix::RecomputeIndicesToCPP ( )

Recompute indeces, MATLAB -> C++.

Definition at line 124 of file IndexMatrix.cpp.

Here is the caller graph for this function:

void TIndexMatrix::RecomputeIndicesToMatlab ( )

Recompute indeces, C++ -> MATLAB.

Definition at line 137 of file IndexMatrix.cpp.

Here is the caller graph for this function:

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

Write data to HDF5 file

Parameters
[in]HDF5_File- HDF5 file handle
[in]MatrixName- HDF5 Dataset name
[in]CompressionLevel- Compression level
Exceptions
ios:failureif there's an error

Implements TBaseMatrix.

Definition at line 173 of file IndexMatrix.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: