2014-05-31 19:12:21 +02:00
|
|
|
#include <triqs/arrays.hpp>
|
|
|
|
using triqs::arrays::array;
|
|
|
|
using triqs::arrays::matrix;
|
|
|
|
int main() {
|
|
|
|
|
|
|
|
array<double, 2> A(2, 2);
|
|
|
|
A() = 3; // declare and init
|
|
|
|
|
2014-06-08 21:47:32 +02:00
|
|
|
triqs::h5::file file("store_A.h5", H5F_ACC_TRUNC); // open the file
|
2014-05-31 19:12:21 +02:00
|
|
|
h5_write(file, "A", A); // write the array as 'A' into the file
|
|
|
|
|
|
|
|
// array<double,2> B; // read the file into B
|
|
|
|
matrix<double> B; // read the file into B
|
|
|
|
h5_read(file, "A", B);
|
|
|
|
std::cout << "B = " << B << std::endl;
|
|
|
|
h5_write(file, "B", B);
|
|
|
|
}
|
|
|
|
|