mirror of
https://github.com/triqs/dft_tools
synced 2024-12-26 14:23:38 +01:00
edd1ff4529
A first general restructuration of the doc according to the pattern [tour|tutorial|reference]. In the reference part, objects are documented per topic. In each topic, [definition|c++|python|hdf5] (not yet implemented)
16 lines
397 B
C++
16 lines
397 B
C++
#include <triqs/arrays.hpp>
|
|
using triqs::arrays::array;
|
|
int main() {
|
|
|
|
array<double, 2> A(2, 2);
|
|
A() = 3; // declare and init
|
|
|
|
triqs::h5::file file("store_A.h5", H5F_ACC_TRUNC); // open the file
|
|
h5_write(file, "A", A); // write the array as 'A' into the file
|
|
|
|
array<double, 2> B; // read the file into B
|
|
h5_read(file, "A", B);
|
|
std::cout << "B = " << B << std::endl;
|
|
}
|
|
|