Discussion:
[eigen] HDF5 persistence for EIGEN3
Steven Varga
2018-02-25 16:43:40 UTC
Permalink
Greetings,

H5CPP is a general purpose template-only data-store mechanism for scientist
using LinearAlgebra packages such as EIGEN3, is backed by the HDF5Group.
In order to incorporate EIGEN3 I would like to know the best way to extract
the following:

1) read/write pointer to data stored in memory: ie. my_matrix.data()
2) dimensions of the object ie: rows = my_matrix.nrows(); cols =
my_matrix.ncols()
3) list of templates for DENSE types: Matrix<T>( ... params .. )
4) creating objects from external pointers without copying -- if supported

At this stage only DENSE storage is considered, leaving sparse and special
structures to be implemented in a different phase.

The MIT licensed project may be found here: http://h5cpp.ca and here:
https://github.com/steven-varga/h5cpp
thank you for your responses/suggestions in advance!
steve
Abhijit Kundu
2018-02-25 17:06:31 UTC
Permalink
Have a look at https://github.com/garrison/eigen3-hdf5 I used it before and
works great.

1) my_matrix.data()
2) rows = my_matrix.rows(); cols = my_matrix.cols()
3) Eigen supports practically any Scalar See
https://eigen.tuxfamily.org/dox/TopicCustomizing_CustomScalar.html
4) creating objects from external pointers without copying -- Yes see
https://eigen.tuxfamily.org/dox/group__TutorialMapClass.html
Post by Steven Varga
Greetings,
H5CPP is a general purpose template-only data-store mechanism for
scientist using LinearAlgebra packages such as EIGEN3, is backed by the
HDF5Group.
In order to incorporate EIGEN3 I would like to know the best way to
1) read/write pointer to data stored in memory: ie. my_matrix.data()
2) dimensions of the object ie: rows = my_matrix.nrows(); cols =
my_matrix.ncols()
3) list of templates for DENSE types: Matrix<T>( ... params .. )
4) creating objects from external pointers without copying -- if supported
At this stage only DENSE storage is considered, leaving sparse and special
structures to be implemented in a different phase.
https://github.com/steven-varga/h5cpp
thank you for your responses/suggestions in advance!
steve
Steven Varga
2018-02-26 16:05:46 UTC
Permalink
Abhijit,
Thank you so much!

with your help it was super quick to implement. Do you know if Eigen3
supports cubes ( 3d objects ) similarly to armadillo? I didn't see it in
the documentation.

best,
steven
Post by Abhijit Kundu
Have a look at https://github.com/garrison/eigen3-hdf5 I used it before
and works great.
1) my_matrix.data()
2) rows = my_matrix.rows(); cols = my_matrix.cols()
3) Eigen supports practically any Scalar See https://eigen.tuxfamily.
org/dox/TopicCustomizing_CustomScalar.html
4) creating objects from external pointers without copying -- Yes see
https://eigen.tuxfamily.org/dox/group__TutorialMapClass.html
Post by Steven Varga
Greetings,
H5CPP is a general purpose template-only data-store mechanism for
scientist using LinearAlgebra packages such as EIGEN3, is backed by the
HDF5Group.
In order to incorporate EIGEN3 I would like to know the best way to
1) read/write pointer to data stored in memory: ie. my_matrix.data()
2) dimensions of the object ie: rows = my_matrix.nrows(); cols =
my_matrix.ncols()
3) list of templates for DENSE types: Matrix<T>( ... params .. )
4) creating objects from external pointers without copying -- if supported
At this stage only DENSE storage is considered, leaving sparse and
special structures to be implemented in a different phase.
https://github.com/steven-varga/h5cpp
thank you for your responses/suggestions in advance!
steve
Norbert Wenzel
2018-02-26 22:06:26 UTC
Permalink
Post by Steven Varga
Do you know if Eigen3
supports cubes ( 3d objects ) similarly to armadillo? I didn't see it in
the documentation.
Not sure about Armadillo but is AlignedBox[0] what you're looking for?

Norbert

[0] http://eigen.tuxfamily.org/dox/classEigen_1_1AlignedBox.html
Steven Varga
2018-02-26 23:08:37 UTC
Permalink
Thanks for getting back!

AlignedBox seems to provide geometric functionality which is out of the
scope of this project. For now I closed the case supporting templated
Dynamic Eigen::Matrix<T, ... > and Eigen::Array<T,...>.

The MIT licensed project is available http://h5cpp.ca, H5CPP implements
easy to use templated READ | WRITE | CREATE operations for matrix algebra
systems to HDF5 data-format.

best,
steven



On Mon, Feb 26, 2018 at 5:06 PM, Norbert Wenzel <
Post by Norbert Wenzel
Post by Steven Varga
Do you know if Eigen3
supports cubes ( 3d objects ) similarly to armadillo? I didn't see it in
the documentation.
Not sure about Armadillo but is AlignedBox[0] what you're looking for?
Norbert
[0] http://eigen.tuxfamily.org/dox/classEigen_1_1AlignedBox.html
Abhijit Kundu
2018-02-27 05:35:41 UTC
Permalink
By Cubes, I guess you mean 3D Tensor. Eigen has generic tensor library (
https://eigen.tuxfamily.org/dox/unsupported/group__CXX11__Tensor__Module.html
)
So you want something like Eigen::Tensor3f

Also see the readme
https://bitbucket.org/eigen/eigen/src/default/unsupported/Eigen/CXX11/src/Tensor/README.md

Even though it is unsupported module, it is heavily used and actively
maintained.
Post by Steven Varga
Thanks for getting back!
AlignedBox seems to provide geometric functionality which is out of the
scope of this project. For now I closed the case supporting templated
Dynamic Eigen::Matrix<T, ... > and Eigen::Array<T,...>.
The MIT licensed project is available http://h5cpp.ca, H5CPP implements
easy to use templated READ | WRITE | CREATE operations for matrix algebra
systems to HDF5 data-format.
best,
steven
On Mon, Feb 26, 2018 at 5:06 PM, Norbert Wenzel <
Post by Norbert Wenzel
Post by Steven Varga
Do you know if Eigen3
supports cubes ( 3d objects ) similarly to armadillo? I didn't see it
in
Post by Steven Varga
the documentation.
Not sure about Armadillo but is AlignedBox[0] what you're looking for?
Norbert
[0] http://eigen.tuxfamily.org/dox/classEigen_1_1AlignedBox.html
Loading...