608 B
608 B
Конвертер Eigen3 <-> HDF5
Пример
#include <eigen3-hdf5.hpp>
void save_matrix()
{
Eigen::Matrix3d mat;
mat << 1, 2, 3, 4, 5, 6, 7, 8, 9;
H5::H5File file("filename1.h5", H5F_ACC_TRUNC);
Eigen3HDF5::save(file, "MatrixDataSetName", mat);
}
void load_vector()
{
Eigen::Vector4i vec;
H5::H5File file("filename2.h5", H5F_ACC_RDONLY);
Eigen3HDF5::load(file, "VectorDataSetName", vec);
}