YODA::H5DataSetReader Class Reference Helper class to extract information from YODA_H5::DataSets. More...
Detailed DescriptionHelper class to extract information from YODA_H5::DataSets. Constructor & Destructor Documentation◆ H5DataSetReader() [1/2]
◆ H5DataSetReader() [2/2]
Member Function Documentation◆ next()
template<typename T = size_t>
Load next item and increment cursor. Definition at line 86 of file H5Utils.h. 86 {
87 T item;
88 _ds->select({_thisrow++}, {1}).read(item);
89 return item;
90 }
References read(). ◆ read() [1/2]
template<typename T >
Method to read and return the entire 1D dataset. Definition at line 94 of file H5Utils.h. 94 {
95 if (_nrows == 0) return vector<T>{};
96 vector<T> data; data.reserve(_nrows);
97 _ds->select({0}, {_nrows}).read(data);
98 return data;
99 }
References read(). Referenced by next(), read(), read(), and readSlice(). ◆ read() [2/2]
template<typename T >
◆ readAt()
template<typename T >
◆ readAttribute()
template<typename T = size_t>
◆ readSlice()
template<typename T >
Method to read a subset of the 1D dataset. Definition at line 113 of file H5Utils.h. 113 {
114 if (len == 0) return {};
115 vector<T> data; data.reserve(len);
116 while (len) {
117 vector<vector<T>> tmp;
118 size_t ncols = std::min(len, _ncols - _thiscol);
119 size_t nrows = 1+(ncols-1)/_ncols; // C-style ceil
120 _ds->select({_thisrow,_thiscol}, {nrows,ncols}).read(tmp);
121 for (size_t i=0; i < tmp.size(); ++i) {
122 data.insert(data.end(), std::make_move_iterator(std::begin(tmp[i])),
123 std::make_move_iterator(std::end(tmp[i])));
124 }
125 if ((_thiscol + ncols) == _ncols) ++_thisrow;
126 _thiscol = (_thiscol + ncols) % _ncols;
127 len -= ncols;
128 }
129 return data;
130 }
References read(). ◆ skip()
The documentation for this class was generated from the following file:
Generated on Fri Mar 7 2025 09:06:40 for YODA - Yet more Objects for Data Analysis by |