All Projects → garrison → eigen3-hdf5

garrison / eigen3-hdf5

Licence: MIT license
Bare-bones hdf5 serialization of Eigen matrices and vectors

Programming Languages

C++
36643 projects - #6 most used programming language
lua
6591 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to eigen3-hdf5

h5pp
A C++17 interface for HDF5
Stars: ✭ 60 (+9.09%)
Mutual labels:  hdf5, eigen3
readgssi
python tool to read and plot Geophysical Survey Systems Incorporated (GSSI) radar data
Stars: ✭ 46 (-16.36%)
Mutual labels:  hdf5
DolphinDBPlugin
No description or website provided.
Stars: ✭ 33 (-40%)
Mutual labels:  hdf5
matio-cpp
A C++ wrapper of the matio library, with memory ownership handling, to read and write .mat files.
Stars: ✭ 24 (-56.36%)
Mutual labels:  hdf5
netcdf-java
The Unidata netcdf-java library
Stars: ✭ 84 (+52.73%)
Mutual labels:  hdf5
jhdf
A pure Java HDF5 library
Stars: ✭ 83 (+50.91%)
Mutual labels:  hdf5
npy2bdv
Fast writing of numpy 3d-arrays into HDF5 Fiji/BigDataViewer files.
Stars: ✭ 25 (-54.55%)
Mutual labels:  hdf5
jupyterlab-h5web
A JupyterLab extension to explore and visualize HDF5 file contents. Based on https://github.com/silx-kit/h5web.
Stars: ✭ 41 (-25.45%)
Mutual labels:  hdf5
EMsoft
Public EMsoft repository
Stars: ✭ 44 (-20%)
Mutual labels:  hdf5
h5fortran-mpi
HDF5-MPI parallel Fortran object-oriented interface
Stars: ✭ 15 (-72.73%)
Mutual labels:  hdf5
Visidata
A terminal spreadsheet multitool for discovering and arranging data
Stars: ✭ 4,606 (+8274.55%)
Mutual labels:  hdf5
PH5
Library of PH5 clients, apis, and utilities
Stars: ✭ 14 (-74.55%)
Mutual labels:  hdf5
XH5For
XDMF parallel partitioned mesh I/O on top of HDF5
Stars: ✭ 23 (-58.18%)
Mutual labels:  hdf5
serving-runtime
Exposes a serialized machine learning model through a HTTP API.
Stars: ✭ 15 (-72.73%)
Mutual labels:  hdf5
Bezier
Fast and lightweight class for Bezier curves of any order in C++
Stars: ✭ 59 (+7.27%)
Mutual labels:  eigen3
conduit
Simplified Data Exchange for HPC Simulations
Stars: ✭ 114 (+107.27%)
Mutual labels:  hdf5
flowtorch
flowTorch - a Python library for analysis and reduced-order modeling of fluid flows
Stars: ✭ 47 (-14.55%)
Mutual labels:  hdf5
vbz compression
VBZ compression plugin for nanopore signal data
Stars: ✭ 31 (-43.64%)
Mutual labels:  hdf5
rhdf5
Package providing an interface between HDF5 and R
Stars: ✭ 50 (-9.09%)
Mutual labels:  hdf5
robot dart
Generic wrapper around the DART simulator
Stars: ✭ 31 (-43.64%)
Mutual labels:  eigen3

eigen3-hdf5

Easy serialization of C++ Eigen matrices using HDF5.

The library is meant to be bare-bones (at least for now). It gets me 90% of what I want/need in a few hundred lines of code. It may also get you 90% (or even 100%) of what you need.

Requirements

  • Eigen3 (tested on 3.1 and 3.2 branches)
  • HDF5 C++ wrapper library >= 1.8.12 (yes, this is a very recent version)

Because eigen3-hdf5 is a template library, there is nothing to link against (besides the HDF5 libraries).

API

Supports saving and restoring Eigen matrices and vectors of float, double, long double, int, unsigned int, and std::complex<>.

#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);
    EigenHDF5::save(file, "MatrixDataSetName", mat);
}

void load_vector()
{
    Eigen::Vector4i vec;
    H5::H5File file("filename2.h5", H5F_ACC_RDONLY);
    EigenHDF5::load(file, "VectorDataSetName", vec);
}

See the unittests directory for more examples.

Unit tests

I am using premake4 and googletest because I am familiar with them.

The unit tests currently write to specific files in the current directory. This could change, eventually.

The GitHub Action can be approximated locally by installing act and running:

act -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04

License

MIT license.

Next steps

  • Support more fundamental data types

Thoughts/notes

  • Using the HDF5 C++ wrapper library supposedly means it won't work with parallel hdf5. If I were to do it again, I would write eigen3-hdf5 using the regular C HDF5 API, not the C++ wrapper. Patches are welcome. :)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].