18 const std::string
FILE_NAME(
"select_partial_example.h5");
30 std::vector<std::vector<double>>
values = {
31 {1.0, 2.0, 4.0, 8.0, 16.0}, {32.0, 64.0, 128.0, 256.0, 512.0}};
37 dataset.
write(values);
40 std::vector<std::vector<double>> result;
41 dataset.
select({0, 2}, {2, 2}).read(result);
44 for (
auto i : result) {
46 std::cout <<
" " << j;
53 std::cerr << err.
what() << std::endl;
const std::string DATASET_NAME("dset")
static DataSpace From(const ScalarValue &scalar_value)
void write(const T &buffer)
static const int ReadWrite
Open flag: Read Write access.
static const int Truncate
Open flag: Truncate a file if already existing.
const std::string FILE_NAME("select_partial_example.h5")
const char * what() const override
get the current exception error message
Selection select(const std::vector< size_t > &offset, const std::vector< size_t > &count, const std::vector< size_t > &stride=std::vector< size_t >()) const
Basic HighFive Exception class.
DataSet createDataSet(const std::string &dataset_name, const DataSpace &space, const DataType &type, const DataSetCreateProps &createProps=DataSetCreateProps(), const DataSetAccessProps &accessProps=DataSetAccessProps())
createDataSet Create a new dataset in the current file of datatype type and of size space ...
static const int Create
Open flag: Create non existing file.