TRIQS/nda 2.0.0
Multi-dimensional array library for C++
Loading...
Searching...
No Matches
doc_h5_overview.cpp
1#include <nda/h5.hpp>
2#include <nda/nda.hpp>
3#include <h5/h5.hpp>
4
5int main() {
6 // create a 4x2 array with random values
7 auto A = nda::rand(4, 2);
8
9 // write the array to an HDF5 file
10 h5::file file("A.h5", 'w');
11 h5::write(file, "A", A);
12}
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
Provides HDF5 support for the nda library.
Includes all relevant headers for the core nda library.