TRIQS/h5 1.3.0
C++ interface to HDF5
Loading...
Searching...
No Matches
array_interface.cpp File Reference
#include "./array_interface.hpp"
#include "./macros.hpp"
#include "./stl/string.hpp"
#include <hdf5.h>
#include <hdf5_hl.h>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <stdexcept>
#include <utility>
#include <vector>

Detailed Description

Implementation details for array_interface.hpp.

Definition in file array_interface.cpp.

Go to the source code of this file.

Functions

dataset_info h5::array_interface::get_dataset_info (dataset ds)
 Retrieve the shape and the h5::datatype from a dataset.
 
dataset_info h5::array_interface::get_dataset_info (group g, std::string const &name)
 Retrieve the shape and the h5::datatype from a dataset with a given name in the given group.
 
std::pair< v_t, v_th5::array_interface::get_parent_shape_and_h5_strides (long const *np_strides, int rank, long view_size)
 Given a view on an n-dimensional array (dataspace) by specifying its numpy/nda-style strides and its size (number of elements in the view), calculate the shape of a possible parent array and the corresponding HDF5 strides of the view.
 
void h5::array_interface::read (group g, std::string const &name, array_view v, hyperslab sl={})
 Read a given hyperslab from an HDF5 dataset into an array view.
 
void h5::array_interface::read_attribute (object obj, std::string const &name, array_view v)
 Read from an HDF5 attribute into an array view.
 
void h5::array_interface::write (group g, std::string const &name, array_view const &v, bool compress)
 Write an array view to an HDF5 dataset.
 
void h5::array_interface::write_attribute (object obj, std::string const &name, array_view v)
 Write an array view to an HDF5 attribute.
 
void h5::array_interface::write_slice (group g, std::string const &name, array_view const &v, hyperslab sl)
 Write an array view to a selected hyperslab of an existing HDF5 dataset.