Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Armadillo? #482

Closed
berquist opened this issue Oct 20, 2021 · 4 comments
Closed

Support for Armadillo? #482

berquist opened this issue Oct 20, 2021 · 4 comments

Comments

@berquist
Copy link

Armadillo has been brought up once in #3. For my own usage I've written an interface that needs cleaning up but does work, though I haven't benchmarked it yet.

The annoying thing about Armadillo is dealing with the column-major layout. Their own HDF5 interface writes out as though the underlying memory is row-major, so the file isn't trivially usable from...any other code, really. This interface does the obvious right thing for row vectors, column vectors, and matrices in terms of shapes. Cubes are a little weird (from docs):

Cube data is stored as a set of slices (matrices) stored contiguously within memory. Within each slice, elements are stored with column-major ordering (ie. column by column)

Because iterating over the slice index is typical, I decided to put the slice index first.

Is this something the project would be interested in adding?

@tdegeus
Copy link
Collaborator

tdegeus commented Nov 24, 2021

I'm not interested in adding it, but would be happy to review. The H5Easy API is a good place to add this first. There are already many templates: Eigen, xtensor, ImageCV

@pramodk
Copy link
Contributor

pramodk commented Mar 2, 2022

@berquist: if you have working draft, please open a pull request and someone from our side would be happy to review and provide feedback. Thanks in advance!

(Edit: I will close this ticket. We can continue discussion when you have PR or feel free to reopen this if necessary).

@pramodk pramodk closed this as completed Mar 2, 2022
@berquist
Copy link
Author

#586 completely changed the interface in H5Converter_misc.hpp. I had written data_converters and inspectors for each class. Do I switch from data_converter to Reader and Writer, or is it something else?

@1uc
Copy link
Collaborator

1uc commented Jun 26, 2023

@berquist Most of the code has been concentrated in the inspector<T>. Hopefully the code for boost::multi_array is helpful, see

struct inspector<boost::multi_array<T, Dims>> {

I think you'd move most of you code into the inspector and leave the Reader and Writer alone. In order to improve the way we handle strings, we'll probably end up reworking the Reader and Writer, see #744 for a sketch of what we intend to do; and if it affects you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants