Sorry…minor correction…
"Miller, Mark C." wrote:
template <class T> static void WriteVecToHDF5(hid_t fid, char const *name,
std::vector<T> const &vec, int d2size)
{
hsize_t siz2d[2] = {(hsize_t) vec.size() / d2size, d2size};
hid_t spid = H5Screate_simple(d2size>1?2:1, siz2d, 0);
hid_t dsid = H5Dcreate(fid, name, HDF5Type<T>().Type(), spid, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dsid, HDF5Type<T>().Type(), H5S_ALL, H5S_ALL, H5P_DEFAULT,
&vec[0]);
H5Dclose(dsid);
H5Sclose(spid);
}
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5