14 #include <boost/multi_array.hpp> 19 const std::string
FILE_NAME(
"boost_multiarray_example.h5");
30 boost::multi_array<double, 2> my_array(boost::extents[
size_x][
size_y]);
32 for (
size_t i = 0; i <
size_x; ++i) {
33 for (
size_t j = 0; j <
size_y; ++j) {
34 my_array[i][j] = double(j + i * size_y);
46 dataset.
write(my_array);
50 std::cerr << err.
what() << std::endl;
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("boost_multiarray_example.h5")
const char * what() const override
get the current exception error message
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.
const std::string DATASET_NAME("dset")