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

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ComplexMatrix.h
Go to the documentation of this file.
1 /**
2 * @file ComplexMatrix.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 with the class for complex matrices.
10 *
11 * @version kspaceFirstOrder3D 3.4
12 *
13 * @date 11 July 2011, 14:02 (created) \n
14 * 29 July 2016, 16:53 (revised)
15 *
16 * @section License
17 * This file is part of the C++ extension of the k-Wave Toolbox
18 * (http://www.k-wave.org).\n Copyright (C) 2016 Jiri Jaros and Bradley Treeby.
19 *
20 * This file is part of the k-Wave. k-Wave is free software: you can redistribute it and/or modify
21 * it under the terms of the GNU Lesser General Public License as published by the Free Software
22 * Foundation, either version 3 of the 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
25 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
26 * General Public License for 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/.
30 */
31
32 #ifndef COMPLEX_MATRIX_H
33 #define COMPLEX_MATRIX_H
34
35 #include <complex>
36
37 #include <MatrixClasses/BaseFloatMatrix.h>
38 #include <MatrixClasses/RealMatrix.h>
39
40 #include <Utils/DimensionSizes.h>
41
42 /**
43 * @typedef TFloatComplex
44 * @brief C++ complex values
45 * @details C++ complex values
46 */
47 typedef std::complex<float> TFloatComplex;
48
49 /**
50 * @class TComplexMatrix
51 * @brief The class for complex matrices.
52 * @details The class for complex matrices.
53 */
54 class TComplexMatrix : public TBaseFloatMatrix
55 {
56 public:
57 /// Constructor.
58 TComplexMatrix(const TDimensionSizes& dimensionSizes);
59 /// Destructor.
60 virtual ~TComplexMatrix();
61
62
63 /**
64 * @brief Operator [].
65 * @details Operator [].
66 * @param [in] index - 1D index into the array
67 * @return An element of the matrix
68 */
69 inline TFloatComplex& operator[](const size_t& index)
70 {
71 return reinterpret_cast<TFloatComplex*>(hostData)[index];
72 };
73
74 /**
75 * @brief Operator [], constant version.
76 * @details Operator [], constant version.
77 * @param [in] index - 1D index into the array
78 * @return element of the matrix
79 */
80 inline const TFloatComplex& operator[](const size_t& index) const
81 {
82 return reinterpret_cast<TFloatComplex*> (hostData)[index];
83 };
84
85 /// Load data from the HDF5_File.
86 virtual void ReadDataFromHDF5File(THDF5_File& file,
87 TMatrixName& matrixName);
88
89 /// Write data into the HDF5_File
90 virtual void WriteDataToHDF5File(THDF5_File& file,
91 TMatrixName& matrixName,
92 const size_t compressionLevel);
93
94
95 protected:
96 /// Default constructor not allowed for public.
97 TComplexMatrix() : TBaseFloatMatrix() {};
98 /// Copy constructor not allowed for public.
99 TComplexMatrix(const TComplexMatrix& src);
100 /// Operator not allowed for public.
101 TComplexMatrix& operator = (const TComplexMatrix& src);
102
103 /// Initialize dimension sizes and related structures.
104 virtual void InitDimensions(const TDimensionSizes& dimensionSizes);
105
106 private:
107
108 };// end of TComplexMatrix
109 //--------------------------------------------------------------------------------------------------
110
111 #endif /* COMPLEX_MATRIX_H */
112
TBaseFloatMatrix
Abstract base class for float based matrices defining basic interface. Higher dimensional matrices st...
Definition: BaseFloatMatrix.h:49
TBaseFloatMatrix::hostData
float * hostData
Raw CPU matrix data.
Definition: BaseFloatMatrix.h:138
TComplexMatrix::ReadDataFromHDF5File
virtual void ReadDataFromHDF5File(THDF5_File &file, TMatrixName &matrixName)
Load data from the HDF5_File.
Definition: ComplexMatrix.cpp:77
TComplexMatrix::operator[]
TFloatComplex & operator[](const size_t &index)
Operator [].
Definition: ComplexMatrix.h:69
TComplexMatrix::~TComplexMatrix
virtual ~TComplexMatrix()
Destructor.
Definition: ComplexMatrix.cpp:62
RealMatrix.h
The header file containing the class for real matrices.
TBaseFloatMatrix::dimensionSizes
struct TDimensionSizes dimensionSizes
Dimension sizes.
Definition: BaseFloatMatrix.h:130
TComplexMatrix::InitDimensions
virtual void InitDimensions(const TDimensionSizes &dimensionSizes)
Initialize dimension sizes and related structures.
Definition: ComplexMatrix.cpp:147
TComplexMatrix::WriteDataToHDF5File
virtual void WriteDataToHDF5File(THDF5_File &file, TMatrixName &matrixName, const size_t compressionLevel)
Write data into the HDF5_File.
Definition: ComplexMatrix.cpp:110
TMatrixName
const std::string TMatrixName
Datatype for matrix names.
Definition: MatrixNames.h:45
DimensionSizes.h
The header file containing the structure with 3D dimension sizes.
TComplexMatrix::operator=
TComplexMatrix & operator=(const TComplexMatrix &src)
Operator not allowed for public.
TComplexMatrix::operator[]
const TFloatComplex & operator[](const size_t &index) const
Operator [], constant version.
Definition: ComplexMatrix.h:80
TComplexMatrix::TComplexMatrix
TComplexMatrix()
Default constructor not allowed for public.
Definition: ComplexMatrix.h:97
TFloatComplex
std::complex< float > TFloatComplex
C++ complex values.
Definition: ComplexMatrix.h:47
BaseFloatMatrix.h
The header file containing the base class for single precisions floating point numbers (floats)...
TComplexMatrix
The class for complex matrices.
Definition: ComplexMatrix.h:54
THDF5_File
Class wrapping the HDF5 routines.
Definition: HDF5_File.h:500
TDimensionSizes
Structure with 4D dimension sizes (3 in space and 1 in time).
Definition: DimensionSizes.h:66