kspaceFirstOrder3D-OMP  1.2
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
BaseMatrix.h
Go to the documentation of this file.
1 /**
2  * @file BaseMatrix.h
3  *
4  * @author Jiri Jaros \n
5  * Faculty of Information Technology \n
6  * Brno University of Technology \n
7  * jarosjir@fit.vutbr.cz
8  *
9  * @brief The header file of the common ancestor of all matrix classes. A pure abstract class.
10  *
11  * @version kspaceFirstOrder3D 2.16
12  *
13  * @date 11 July 2012, 11:34 (created) \n
14  * 04 September 2017, 11:02 (revised)
15  *
16  * @copyright Copyright (C) 2017 Jiri Jaros and Bradley Treeby.
17  *
18  * This file is part of the C++ extension of the [k-Wave Toolbox](http://www.k-wave.org).
19  *
20  * This file is part of the k-Wave. k-Wave is free software: you can redistribute it and/or modify it under the terms
21  * of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the
22  * License, or (at your option) any later version.
23  *
24  * k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
25  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
26  * more details.
27  *
28  * You should have received a copy of the GNU Lesser General Public License along with k-Wave.
29  * If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).
30  */
31 
32 
33 #ifndef BASE_MATRIX_H
34 #define BASE_MATRIX_H
35 
36 
37 #include <Utils/DimensionSizes.h>
38 #include <Hdf5/Hdf5File.h>
39 
40 /**
41  * @class BaseMatrix
42  * @brief Abstract base class. The common ancestor defining the common interface and allowing derived classes to be
43  * allocated, freed and loaded from the file using the Matrix container.
44  *
45  * @details Abstract base class. The common ancestor defining the common interface and allowing derived classes to be
46  * allocated, freed and loaded from the file using the Matrix container. The I/O is done via HDF5 files.
47  */
49 {
50  public:
51  /// Default constructor.
52  BaseMatrix() {};
53  /// Copy constructor is not allowed.
54  BaseMatrix(const BaseMatrix&) = delete;
55  /// Destructor
56  virtual ~BaseMatrix() {};
57 
58  /// Operator= is not allowed.
59  BaseMatrix& operator=(const BaseMatrix&) = delete;
60 
61  /**
62  * @brief Get dimension sizes of the matrix.
63  * @return Dimension sizes of the matrix.
64  */
65  virtual const DimensionSizes& getDimensionSizes() const = 0;
66  /**
67  * @brief Size of the matrix.
68  * @return Number of elements.
69  */
70  virtual size_t size() const = 0;
71  /**
72  * @brief The capacity of the matrix (this may differ from size due to padding, etc.).
73  * @return Capacity of the currently allocated storage.
74  */
75  virtual size_t capacity() const = 0;
76 
77  /**
78  * @brief Read matrix from HDF5 file.
79  * @details Read matrix from HDF5 file.
80  * @param [in] file - Handle to the HDF5 file.
81  * @param [in] matrixName - HDF5 dataset name to read from.
82  */
83  virtual void readData(Hdf5File& file,
84  MatrixName& matrixName) = 0;
85  /**
86  * @brief Write data into HDF5 file.
87  * @details Write data into HDF5 file.
88  * @param [in] file - Handle to the HDF5 file.
89  * @param [in] matrixName - HDF5 dataset name to write to.
90  * @param [in] compressionLevel - Compression level for the HDF5 dataset.
91  */
92  virtual void writeData(Hdf5File& file,
93  MatrixName& matrixName,
94  const size_t compressionLevel) = 0;
95 };// end of BaseMatrix
96 //----------------------------------------------------------------------------------------------------------------------
97 
98 #endif /* BASE_MATRIX_H */
virtual size_t size() const =0
Size of the matrix.
The header file containing the HDF5 related classes.
virtual size_t capacity() const =0
The capacity of the matrix (this may differ from size due to padding, etc.).
Abstract base class. The common ancestor defining the common interface and allowing derived classes t...
Definition: BaseMatrix.h:48
Class wrapping the HDF5 routines.
Definition: Hdf5File.h:490
BaseMatrix & operator=(const BaseMatrix &)=delete
Operator= is not allowed.
const std::string MatrixName
Datatype for matrix names.
Definition: MatrixNames.h:39
Structure with 4D dimension sizes (3 in space and 1 in time).
virtual const DimensionSizes & getDimensionSizes() const =0
Get dimension sizes of the matrix.
The header file containing the structure with 3D dimension sizes.
virtual void readData(Hdf5File &file, MatrixName &matrixName)=0
Read matrix from HDF5 file.
virtual ~BaseMatrix()
Destructor.
Definition: BaseMatrix.h:56
virtual void writeData(Hdf5File &file, MatrixName &matrixName, const size_t compressionLevel)=0
Write data into HDF5 file.
BaseMatrix()
Default constructor.
Definition: BaseMatrix.h:52