96 const size_t compressionLevel)
144 size_t x =
mData[6 * index ];
145 size_t y =
mData[6 * index + 1];
146 size_t z =
mData[6 * index + 2];
158 size_t x =
mData[6 * index + 3];
159 size_t y =
mData[6 * index + 4];
160 size_t z =
mData[6 * index + 5];
171 #pragma omp parallel for simd 172 for (
size_t i = 0; i <
mSize; i++)
184 #pragma omp parallel for simd 185 for (
size_t i = 0; i <
mSize; i++)
197 size_t elementSum = 0;
222 mSize = dimensionSizes.
nx * dimensionSizes.
ny * dimensionSizes.
nz;
void recomputeIndicesToMatlab()
Recompute indices C++ -> MATLAB.
size_t mRowSize
Size of 1D row in X dimension.
size_t mSize
Total number of elements.
ErrorMessage kErrFmtMatrixNotIndex
Matrix class error message.
virtual void readData(Hdf5File &file, MatrixName &matrixName)
Read matrix from HDF5 file.
hid_t getRootGroup() const
Get handle to the root group of the file.
virtual void writeData(Hdf5File &file, MatrixName &matrixName, const size_t compressionLevel)
Write data into HDF5 file.
size_t nz
Number of elements in the z direction.
size_t * mData
Raw matrix data.
static constexpr size_t kChunkSize1D1MB
Number of elements to get 1MB block of data.
void writeMatrixDomainType(const hid_t parentGroup, MatrixName &datasetName, const MatrixDomainType &matrixDomainType)
Write matrix data type into the dataset at a specified place in the file tree.
void closeDataset(const hid_t dataset)
Close dataset.
static constexpr size_t kChunkSize1D256kB
Number of elements to get 256KB block of data.
void writeMatrixDataType(const hid_t parentGroup, MatrixName &datasetName, const MatrixDataType &matrixDataType)
Write matrix data type into the dataset at a specified place in the file tree.
DimensionSizes getTopLeftCorner(const size_t &index) const
Get the top left corner of the index-th cuboid.
virtual void allocateMemory()
Aligned memory allocation (both on CPU and GPU).
virtual ~IndexMatrix()
Destructor.
The header file containing a class responsible for printing out info and error messages (stdout...
Class wrapping the HDF5 routines.
static std::string formatMessage(const std::string &format, Args ... args)
C++-11 replacement for sprintf that works with std::string instead of char*.
void writeHyperSlab(const hid_t dataset, const DimensionSizes &position, const DimensionSizes &size, const T *data)
Write a hyperslab into the dataset.
The header file containing the class for 64b integer matrices.
const std::string MatrixName
Datatype for matrix names.
Structure with 4D dimension sizes (3 in space and 1 in time).
MatrixDataType readMatrixDataType(const hid_t parentGroup, MatrixName &datasetName)
Read matrix data type from the dataset at a specified place in the file tree.
void initDimensions(const DimensionSizes &dimensionSizes)
Init dimension.
The matrix is stored in fixed point point 64b wide format.
static constexpr size_t kChunkSize1D4MB
Number of elements to get 4MB block of data.
size_t ny
Number of elements in the y direction.
DimensionSizes getBottomRightCorner(const size_t &index) const
Get the top bottom right of the index-th cuboid.
void recomputeIndicesToCPP()
Recompute indices MATALAB->C++.
size_t mCapacity
Total number of allocated elements (in terms of size_t).
size_t mSlabSize
Size of a XY slab.
void readCompleteDataset(const hid_t parentGroup, MatrixName &datasetName, const DimensionSizes &dimensionSizes, T *data)
Read data from the dataset at a specified place in the file tree.
ErrorMessage kErrFmtMatrixNotReal
Matrix class error message.
IndexMatrix()=delete
Default constructor not allowed.
size_t nx
Number of elements in the x direction.
DimensionSizes mDimensionSizes
Dimension sizes.
Abstract base class for index based matrices defining basic interface. Higher dimensional matrices st...
hid_t createDataset(const hid_t parentGroup, MatrixName &datasetName, const DimensionSizes &dimensionSizes, const DimensionSizes &chunkSizes, const MatrixDataType matrixDataType, const size_t compressionLevel)
Create a float HDF5 dataset at a specified place in the file tree (3D/4D).
MatrixDomainType readMatrixDomainType(const hid_t parentGroup, MatrixName &datasetName)
Read matrix dataset domain type at a specified place in the file tree.
The matrix is defined on real domain.
size_t getSizeOfAllCuboids() const
Get total number of elements in all cuboids to be able to allocate output file.
virtual void freeMemory()
Memory deallocation (both on CPU and GPU)