Implementation of hierarchical file objects based on HDF5.
To work with files:
- create a file object
- create a dataset in that file (where actual data resides)
- write/read data to/from the dataset
File file("file.h5");
std::vector<size_t> dims{m,n};
File::Dataset<double> ds(file, "my dataset", dims);
ds.write(v.data());
ds.read(v.data());
ds << v;
ds >> v;
◆ group()
File::Group mpqc::File::group |
( |
const std::string & |
name = "/" | ) |
|
|
inline |
Creates or opens a file group.
- Parameters
-
[in] | name | group name. Default argument implies default group. |
- Warning
- NOT threadsafe
References mpqc::File::Group::create().
◆ operator<<() [1/2]
template<typename T , class A >
Write to dataset from a generic container A.
- Template Parameters
-
A | Container with member const T* A::data() |
- Parameters
-
ds | Dataset to write to |
a | Container to read from. |
- Warning
- The pointer returned by A::data() must be contigous
References mpqc::File::Dataset< T >::write().
◆ operator<<() [2/2]
template<typename T , class A >
Write to dataspace from a generic container A.
- Template Parameters
-
A | Container with member const T* A::data() |
- Parameters
-
ds | Dataspace to write to |
a | Container to read from. |
- Warning
- The pointer returned by A::data() must be contigous
◆ operator>>() [1/2]
template<typename T , class A >
Read from dataset into a generic container A.
- Template Parameters
-
A | Container with member T* A::data() |
- Parameters
-
ds | Dataset to read from |
a | Container to read to. |
- Warning
- The pointer returned by A::data() must be contigous
References mpqc::File::Dataset< T >::read().
◆ operator>>() [2/2]
template<typename T , class A >
Read from dataspace into a generic container A.
- Template Parameters
-
A | Container with member T* A::data() |
- Parameters
-
ds | Dataspace to read from |
a | Container to read to. |
- Warning
- The pointer returned by A::data() must be contigous