HDF5 Eigen Wrapper¶
Many of the core HDF5 functionality is contained here. The more complicated details required to read and write Eigen objects happens here and should typically not be utilized directly
Functions
-
template<typename
Derived
>
voidload
(const H5::H5Location &h5group, const std::string &name, const Eigen::DenseBase<Derived> &mat)¶ This will read from an HDF5 file/group and save the data into an eigen matrix. One should have some idea about the eigen array before reading
- Author
Shankar Kulumani
- Version
26 April 2018
- Parameters
h5group
: H5 group or file to read fromname
: String name of the datasetmat
: Eigen variable to save data
-
template<typename
Derived
>
voidsave
(H5::H5Location &h5group, const std::string &name, const Eigen::EigenBase<Derived> &mat, const H5::DSetCreatPropList &plist = H5::DSetCreatPropList::DEFAULT)¶ This will write Eigen data to an HDF5 file or group
- Author
Shankar Kulumani
- Version
26 April 2018
- Parameters
h5group
: The H5 group or file to write toname
: string name of the datasetmat
: Eigen variable to save dataplist
: The dataset property list
-
template<typename
T
>
classDatatypeSpecialization
¶ - #include <hdf5_eigen.hpp>
Convert a C++ datatype to the equivalent in HDF5 land.
All Eigen functionality to read/write to HDF5
Updated/corrected from the work of Jim Garrison https://github.com/garrison/eigen3-hdf5
Each dataset must define the correct type in the
HDF5. This template class handles that by automatially determining the HDF5 type from a Eigen input.- Author
Shankar Kulumani
- Version
26 April 2018
Setup primiarly for Eigen types but needs to be extended.
- Author
Shankar Kulumani
- Version
26 April 2018
-
template<>
structDatatypeSpecialization
<float>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)¶
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<double>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<long double>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<short>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<unsigned short>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<int>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<unsigned int>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<long>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<unsigned long>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<long long>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<unsigned long long>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<const char *>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<>
structDatatypeSpecialization
<char *>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<std::size_t
N
>
structDatatypeSpecialization
<const char[N]>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
template<std::size_t
N
>
structDatatypeSpecialization
<char[N]>¶ - #include <hdf5_eigen.hpp>
Public Static Functions
-
static const H5::DataType *
get
(void)
-
static const H5::DataType *
-
namespace
internal
¶ Functions
-
template<typename
Derived
>
H5::DataSpacecreate_dataspace
(const Eigen::EigenBase<Derived> &mat)¶ Create the dataspace required for the HDF5 dataset
- Return
H5::DataSpace Defines the space required to store mat
- Author
Shankar Kulumani
- Version
26 April 2018
- Parameters
mat
: Eigen matrix to write to the file
-
template<typename
Derived
>
boolwrite_rowmat
(const Eigen::EigenBase<Derived> &mat, const H5::DataType *const datatype, H5::DataSet *dataset, const H5::DataSpace *dspace)¶
-
template<typename
Derived
>
boolwrite_colmat
(const Eigen::EigenBase<Derived> &mat, const H5::DataType *const datatype, H5::DataSet *dataset, const H5::DataSpace *dspace)¶
-
template<typename
Scalar
>
voidread_data
(const H5::DataSet &dataset, Scalar *data, const H5::DataType &datatype)¶
-
template<typename
Scalar
>
voidread_data
(const H5::Attribute &dataset, Scalar *data, const H5::DataType &datatype)¶
-
template<typename
Derived
>
boolread_colmat
(const Eigen::DenseBase<Derived> &mat, const H5::DataType *const datatype, const H5::Attribute &dataset)¶
-
template<typename