| 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
MatrixRecord.cpp
Go to the documentation of this file.
1 /**
2 * @file MatrixRecord.cpp
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 implementation file containing metadata about matrices stored in the matrix
10 * container.
11 *
12 * @version kspaceFirstOrder3D 3.4
13 *
14 * @date 02 December 2014, 15:44 (created) \n
15 * 10 August 2016, 16:43 (revised)
16 *
17 * @section License
18 * This file is part of the C++ extension of the k-Wave Toolbox
19 * (http://www.k-wave.org).\n Copyright (C) 2016 Jiri Jaros and Bradley Treeby.
20 *
21 * This file is part of the k-Wave. k-Wave is free software: you can redistribute it and/or modify
22 * it under the terms of the GNU Lesser General Public License as published by the Free Software
23 * Foundation, either version 3 of the License, or (at your option) any later version.
24 *
25 * k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
26 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
27 * General Public License for more details.
28 *
29 * You should have received a copy of the GNU Lesser General Public License along with k-Wave.
30 * If not, see http://www.gnu.org/licenses/.
31 */
32
33 //------------------------------------------------------------------------------------------------//
34 //------------------------------------------ Constants -------------------------------------------//
35 //------------------------------------------------------------------------------------------------//
36
37
38 //------------------------------------------------------------------------------------------------//
39 //--------------------------------------- Public methods -----------------------------------------//
40 //------------------------------------------------------------------------------------------------//
41
42 #include <Containers/MatrixRecord.h>
43
44 /**
45 * Default constructor.
46 */
47 TMatrixRecord::TMatrixRecord() :
48 matrixPtr(nullptr),
49 matrixType(REAL),
50 dimensionSizes(),
51 loadData(false),
52 checkpoint(false),
53 matrixName()
54 {
55
56 }// end of constructor
57 //--------------------------------------------------------------------------------------------------
58
59 /**
60 * Copy constructor of TMatrixRecord.
61 * @param [in] src - Source
62 */
63 TMatrixRecord::TMatrixRecord(const TMatrixRecord& src) :
64 matrixPtr(src.matrixPtr),
65 matrixType(src.matrixType),
66 dimensionSizes(src.dimensionSizes),
67 loadData(src.loadData),
68 checkpoint(src.checkpoint),
69 matrixName(src.matrixName)
70 {
71
72 }// end of TMatrixRecord
73 //--------------------------------------------------------------------------------------------------
74
75
76 /**
77 * operator = of TMatrixRecord.
78 * @param [in] src - Source object
79 * @return A filled object
80 */
81 TMatrixRecord& TMatrixRecord::operator= (const TMatrixRecord& src)
82 {
83 if (this != &src)
84 {
85 matrixPtr = src.matrixPtr;
86 matrixType = src.matrixType;
87 dimensionSizes = src.dimensionSizes;
88 loadData = src.loadData;
89 checkpoint = src.checkpoint;
90 matrixName = src.matrixName;
91 }
92
93 return *this;
94 }// end of operator =
95 //--------------------------------------------------------------------------------------------------
96
97 /**
98 * Set all values for the record.
99 * @param [in] matrixType - Matrix data type
100 * @param [in] dimensionSizes - Dimension sizes
101 * @param [in] loadData - Load data from file?
102 * @param [in] checkpoint - Checkpoint this matrix?
103 * @param [in] matrixName - HDF5 matrix name
104 */
105 void TMatrixRecord::Set(const TMatrixType matrixType,
106 const TDimensionSizes dimensionSizes,
107 const bool loadData,
108 const bool checkpoint,
109 TMatrixName& matrixName)
110 {
111 this->matrixPtr = nullptr;
112 this->matrixType = matrixType;
113 this->dimensionSizes = dimensionSizes;
114 this->loadData = loadData;
115 this->checkpoint = checkpoint;
116 this->matrixName = matrixName;
117 }// end of SetAllValues
118 //--------------------------------------------------------------------------------------------------
119
120 //------------------------------------------------------------------------------------------------//
121 //-------------------------------------- Protected methods ---------------------------------------//
122 //------------------------------------------------------------------------------------------------//
123
124 //------------------------------------------------------------------------------------------------//
125 //--------------------------------------- Private methods ----------------------------------------//
126 //------------------------------------------------------------------------------------------------//
TMatrixRecord::matrixName
std::string matrixName
Matrix name in the HDF5 file.
Definition: MatrixRecord.h:88
TMatrixRecord::checkpoint
bool checkpoint
Is the matrix necessary to be preserver when checkpoint is enabled?
Definition: MatrixRecord.h:86
MatrixRecord.h
The header file containing metadata about matrices stored in the matrix container.
TMatrixRecord::Set
void Set(const TMatrixType matrixType, const TDimensionSizes dimensionSizes, const bool loadData, const bool checkpoint, TMatrixName &matrixName)
Set all values of the record.
Definition: MatrixRecord.cpp:105
TMatrixName
const std::string TMatrixName
Datatype for matrix names.
Definition: MatrixNames.h:45
TMatrixRecord::loadData
bool loadData
Is the matrix content loaded from the HDF5 file?
Definition: MatrixRecord.h:84
TMatrixRecord::TMatrixType
TMatrixType
All possible types of the matrix.
Definition: MatrixRecord.h:55
TMatrixRecord::operator=
TMatrixRecord & operator=(const TMatrixRecord &src)
operator =.
Definition: MatrixRecord.cpp:81
TMatrixRecord::dimensionSizes
TDimensionSizes dimensionSizes
Matrix dimension sizes.
Definition: MatrixRecord.h:82
TMatrixRecord
A structure storing details about the matrix.
Definition: MatrixRecord.h:49
TMatrixRecord::matrixType
TMatrixType matrixType
Matrix data type.
Definition: MatrixRecord.h:80
TMatrixRecord::matrixPtr
TBaseMatrix * matrixPtr
Pointer to the matrix object.
Definition: MatrixRecord.h:78
TMatrixRecord::TMatrixRecord
TMatrixRecord()
Default constructor.
Definition: MatrixRecord.cpp:47
TDimensionSizes
Structure with 4D dimension sizes (3 in space and 1 in time).
Definition: DimensionSizes.h:66