| kspaceFirstOrder3D-OMP 1.1 The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D

- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions Variables Typedefs Enumerations Friends Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TMatrixContainer Class Reference

Class implementing the matrix container. More...

`#include <MatrixContainer.h>`

Collaboration diagram for TMatrixContainer:
[legend]

## 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.

## Detailed Description

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.

## Constructor & Destructor Documentation

TMatrixContainer::~TMatrixContainer | ( |  | ) |
| virtual

Destructor of TMatrixContainer.

Definition at line 144 of file MatrixContainer.cpp.

## Member Function Documentation

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.

Here is the call graph for this function:

Here is the caller graph for this function:

void TMatrixContainer::CreateAllObjects | ( |  | ) |

Create all matrix objects in the container.

Exceptions

  errors | cause an exception bad_alloc.

Definition at line 155 of file MatrixContainer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool TMatrixContainer::empty | ( |  | ) | const
| inline

Is the container empty?

Returns
  true if the container is empty

Definition at line 189 of file MatrixContainer.h.

void TMatrixContainer::FreeAllMatrices | ( |  | ) |

Free all matrix objects.

Definition at line 267 of file MatrixContainer.cpp.

Here is the caller graph for this function:
template<typename T >

T& TMatrixContainer::GetMatrix | ( | const TMatrixID | MatrixID | ) |
| inline

This template routine returns the reference to the matrix recasted to the specific class.

Parameters

  [in] | MatrixID | - Matrix identifier

Returns
  Base Matrix

Definition at line 240 of file MatrixContainer.h.

Here is the caller graph for this function:

TMatrixRecord& TMatrixContainer::GetMatrixRecord | ( | const TMatrixID | MatrixID | ) |
| inline

Get matrix record (data and information).

Parameters

  [in] | MatrixID | - Matrix identifier

Returns
  the matrix record.

Definition at line 216 of file MatrixContainer.h.

void TMatrixContainer::LoadDataFromCheckpointHDF5File | ( | THDF5_File & | HDF5_File | ) |

Load selected matrices from checkpoint HDF5 file.

Parameters

  [in] | HDF5_File | - HDF5 file handle

Definition at line 232 of file MatrixContainer.cpp.

Here is the caller graph for this function:

void TMatrixContainer::LoadDataFromInputHDF5File | ( | THDF5_File & | HDF5_File | ) |

Load all marked matrices from the HDF5 file.

Parameters

  [in] | HDF5_File | - HDF5 file handle

Definition at line 215 of file MatrixContainer.cpp.

Here is the caller graph for this function:

TMatrixRecord& TMatrixContainer::operator[] | ( | const TMatrixID | MatrixID | ) |
| inline

operator [].

Parameters

  [in] | MatrixID | - Matrix identifier

Returns
  the matrix record.

Definition at line 227 of file MatrixContainer.h.

void TMatrixContainer::PrintErrorAndThrowException | ( | const char * | FMT,
|  | const string | HDF5MatrixName,
|  | const char * | File,
|  | const int | Line
| ) |  |
| private

Print error and and throw an exception.

Exceptions

  bad_alloc |

Parameters

  [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.

Here is the caller graph for this function:

size_t TMatrixContainer::size | ( |  | ) | const
| inline

Get number of matrices in the container.

Returns
  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.

Parameters

  [in] | HDF5_File |

Definition at line 248 of file MatrixContainer.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:

- MatrixClasses/MatrixContainer.h
- MatrixClasses/MatrixContainer.cpp