hdf5/MatrixIO.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef LVR2_IO_HDF5_MATRIXIO_HPP
4 #define LVR2_IO_HDF5_MATRIXIO_HPP
5 
6 #include <Eigen/Dense>
7 #include <highfive/H5DataSet.hpp>
9 #include <highfive/H5File.hpp>
10 
11 namespace lvr2 {
12 
13 namespace hdf5features {
14 
15 template<typename Derived>
16 class MatrixIO {
17 public:
18 
19  template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
20  void save(std::string groupName,
21  std::string datasetName,
22  const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& mat
23  );
24 
25  template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
26  void save(HighFive::Group& group,
27  std::string datasetName,
28  const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& mat
29  );
30 
31  template<typename MatrixT>
32  boost::optional<MatrixT> load(HighFive::Group& group,
33  std::string datasetName);
34 
35  template<typename MatrixT>
36  boost::optional<MatrixT> load(std::string groupName,
37  std::string datasetName);
38 
39  template<typename MatrixT>
40  boost::optional<MatrixT> loadMatrix(std::string groupName,
41  std::string datasetName);
42 
43 protected:
44  Derived* m_file_access = static_cast<Derived*>(this);
45 
46 };
47 
48 } // namespace hdf5features
49 
50 } // namespace lvr2
51 
52 #include "MatrixIO.tcc"
53 
54 #endif // LVR2_IO_HDF5_MATRIXIO_HPP
H5File.hpp
H5DataSet.hpp
H5DataSpace.hpp
lvr2::hdf5features::MatrixIO::load
boost::optional< MatrixT > load(HighFive::Group &group, std::string datasetName)
HighFive::Group
Definition: H5Group.hpp:20
lvr2::hdf5features::MatrixIO::loadMatrix
boost::optional< MatrixT > loadMatrix(std::string groupName, std::string datasetName)
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::hdf5features::MatrixIO::m_file_access
Derived * m_file_access
Definition: hdf5/MatrixIO.hpp:44
lvr2::hdf5features::MatrixIO::save
void save(std::string groupName, std::string datasetName, const Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &mat)
lvr2::hdf5features::MatrixIO
Definition: hdf5/MatrixIO.hpp:16


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:24