kspaceFirstOrder3D-OMP
1.1
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
Class implementing the matrix container. More...
#include <MatrixContainer.h>
Public Member Functions | |
TMatrixContainer () | |
Constructor. | |
virtual | ~TMatrixContainer () |
Destructor. More... | |
size_t | size () const |
Get number of matrices in the container. More... | |
bool | empty () const |
Is the container empty? More... | |
void | CreateAllObjects () |
Create instances of all objects in the container. More... | |
void | LoadDataFromInputHDF5File (THDF5_File &HDF5_File) |
Load all matrices from the HDF5 file. More... | |
void | LoadDataFromCheckpointHDF5File (THDF5_File &HDF5_File) |
Load all matrices from the HDF5 file. More... | |
void | StoreDataIntoCheckpointHDF5File (THDF5_File &HDF5_File) |
Store selected matrices into the checkpoint file. More... | |
void | FreeAllMatrices () |
Free all matrices - destroy them. More... | |
void | AddMatricesIntoContainer () |
Set all matrices recored - populate the container. More... | |
TMatrixRecord & | GetMatrixRecord (const TMatrixID MatrixID) |
Get matrix record (data and information). More... | |
TMatrixRecord & | operator[] (const TMatrixID MatrixID) |
operator []. More... | |
template<typename T > | |
T & | GetMatrix (const TMatrixID MatrixID) |
Get the matrix with a specific type from the container. More... | |
Private Types | |
typedef map< TMatrixID, TMatrixRecord > | TMatrixRecordContainer |
Datatype for map associating the matrix ID enum and matrix record. | |
Private Member Functions | |
TMatrixContainer (const TMatrixContainer &src) | |
Copy constructor is not allowed for public. | |
TMatrixContainer & | operator= (const TMatrixContainer &src) |
Operator = is not allowed for public. | |
void | PrintErrorAndThrowException (const char *FMT, const string HDF5MatrixName, const char *File, const int Line) |
Print error and throw an exception. More... | |
Private Attributes | |
TMatrixRecordContainer | MatrixContainer |
Map holding the container. | |
This container is responsible to maintain all the matrices in the code except the output streams. The matrices are allocated, freed, loaded stored and checkpointed from here.
Definition at line 165 of file MatrixContainer.h.
|
virtual |
Destructor of TMatrixContainer.
Definition at line 144 of file MatrixContainer.cpp.
void TMatrixContainer::AddMatricesIntoContainer | ( | ) |
This function defines common matrices in K-Wave. All matrices records are created here.
Definition at line 287 of file MatrixContainer.cpp.
void TMatrixContainer::CreateAllObjects | ( | ) |
Create all matrix objects in the container.
errors | cause an exception bad_alloc. |
Definition at line 155 of file MatrixContainer.cpp.
|
inline |
Is the container empty?
Definition at line 189 of file MatrixContainer.h.
void TMatrixContainer::FreeAllMatrices | ( | ) |
Free all matrix objects.
Definition at line 267 of file MatrixContainer.cpp.
|
inline |
This template routine returns the reference to the matrix recasted to the specific class.
[in] | MatrixID | - Matrix identifier |
Definition at line 240 of file MatrixContainer.h.
|
inline |
Get matrix record (data and information).
[in] | MatrixID | - Matrix identifier |
Definition at line 216 of file MatrixContainer.h.
void TMatrixContainer::LoadDataFromCheckpointHDF5File | ( | THDF5_File & | HDF5_File | ) |
Load selected matrices from checkpoint HDF5 file.
[in] | HDF5_File | - HDF5 file handle |
Definition at line 232 of file MatrixContainer.cpp.
void TMatrixContainer::LoadDataFromInputHDF5File | ( | THDF5_File & | HDF5_File | ) |
Load all marked matrices from the HDF5 file.
[in] | HDF5_File | - HDF5 file handle |
Definition at line 215 of file MatrixContainer.cpp.
|
inline |
operator [].
[in] | MatrixID | - Matrix identifier |
Definition at line 227 of file MatrixContainer.h.
|
private |
Print error and and throw an exception.
bad_alloc |
[in] | FMT | - format of error |
[in] | HDF5MatrixName | - HDF5 dataset name |
[in] | File | - File of error |
[in] | Line | - Line of error |
Definition at line 585 of file MatrixContainer.cpp.
|
inline |
Get number of matrices in the container.
Definition at line 179 of file MatrixContainer.h.
void TMatrixContainer::StoreDataIntoCheckpointHDF5File | ( | THDF5_File & | HDF5_File | ) |
Store selected matrices into the checkpoint file.
[in] | HDF5_File |
Definition at line 248 of file MatrixContainer.cpp.