@@ -173,7 +173,7 @@ step_type<T> step(T t) {
173
173
@tparam Value input value type, must be floating point.
174
174
@tparam Transform builtin or user-defined transform type.
175
175
@tparam MetaData type to store meta data.
176
- @tparam Options see boost::histogram::axis::option (all values allowed) .
176
+ @tparam Options see boost::histogram::axis::option.
177
177
*/
178
178
template <class Value , class Transform , class MetaData , class Options >
179
179
class regular : public iterator_mixin <regular<Value, Transform, MetaData, Options>>,
@@ -213,14 +213,16 @@ class regular : public iterator_mixin<regular<Value, Transform, MetaData, Option
213
213
* @param start low edge of first bin.
214
214
* @param stop high edge of last bin.
215
215
* @param meta description of the axis (optional).
216
+ * @param options see boost::histogram::axis::option (optional).
216
217
*/
217
218
regular (transform_type trans, unsigned n, value_type start, value_type stop,
218
- metadata_type meta = {})
219
+ metadata_type meta = {}, options_type options = {} )
219
220
: transform_type(std::move(trans))
220
221
, metadata_base(std::move(meta))
221
222
, size_(static_cast <index_type>(n))
222
223
, min_(this ->forward (detail::get_scale(start)))
223
224
, delta_(this ->forward (detail::get_scale(stop)) - min_) {
225
+ (void )options;
224
226
if (size () == 0 ) BOOST_THROW_EXCEPTION (std::invalid_argument (" bins > 0 required" ));
225
227
if (!std::isfinite (min_) || !std::isfinite (delta_))
226
228
BOOST_THROW_EXCEPTION (
@@ -235,46 +237,51 @@ class regular : public iterator_mixin<regular<Value, Transform, MetaData, Option
235
237
* @param start low edge of first bin.
236
238
* @param stop high edge of last bin.
237
239
* @param meta description of the axis (optional).
240
+ * @param options see boost::histogram::axis::option (optional).
238
241
*/
239
- regular (unsigned n, value_type start, value_type stop, metadata_type meta = {})
240
- : regular({}, n, start, stop, std::move(meta)) {}
242
+ regular (unsigned n, value_type start, value_type stop, metadata_type meta = {},
243
+ options_type options = {})
244
+ : regular({}, n, start, stop, std::move(meta), options) {}
241
245
242
246
/* * Construct bins with the given step size over real transformed range
243
247
* [start, stop).
244
248
*
245
- * @param trans transform instance to use.
246
- * @param step width of a single bin.
247
- * @param start low edge of first bin.
248
- * @param stop upper limit of high edge of last bin (see below).
249
- * @param meta description of the axis (optional).
249
+ * @param trans transform instance to use.
250
+ * @param step width of a single bin.
251
+ * @param start low edge of first bin.
252
+ * @param stop upper limit of high edge of last bin (see below).
253
+ * @param meta description of the axis (optional).
254
+ * @param options see boost::histogram::axis::option (optional).
250
255
*
251
256
* The axis computes the number of bins as n = abs(stop - start) / step,
252
257
* rounded down. This means that stop is an upper limit to the actual value
253
258
* (start + n * step).
254
259
*/
255
260
template <class T >
256
261
regular (transform_type trans, step_type<T> step, value_type start, value_type stop,
257
- metadata_type meta = {})
262
+ metadata_type meta = {}, options_type options = {} )
258
263
: regular(trans, static_cast <index_type>(std::abs(stop - start) / step.value),
259
264
start,
260
265
start + static_cast<index_type>(std::abs(stop - start) / step.value) *
261
266
step.value,
262
- std::move(meta)) {}
267
+ std::move(meta), options ) {}
263
268
264
269
/* * Construct bins with the given step size over real range [start, stop).
265
270
*
266
- * @param step width of a single bin.
267
- * @param start low edge of first bin.
268
- * @param stop upper limit of high edge of last bin (see below).
269
- * @param meta description of the axis (optional).
271
+ * @param step width of a single bin.
272
+ * @param start low edge of first bin.
273
+ * @param stop upper limit of high edge of last bin (see below).
274
+ * @param meta description of the axis (optional).
275
+ * @param options see boost::histogram::axis::option (optional).
270
276
*
271
277
* The axis computes the number of bins as n = abs(stop - start) / step,
272
278
* rounded down. This means that stop is an upper limit to the actual value
273
279
* (start + n * step).
274
280
*/
275
281
template <class T >
276
- regular (step_type<T> step, value_type start, value_type stop, metadata_type meta = {})
277
- : regular({}, step, start, stop, std::move(meta)) {}
282
+ regular (step_type<T> step, value_type start, value_type stop, metadata_type meta = {},
283
+ options_type options = {})
284
+ : regular({}, step, start, stop, std::move(meta), options) {}
278
285
279
286
// / Constructor used by algorithm::reduce to shrink and rebin (not for users).
280
287
regular (const regular& src, index_type begin, index_type end, unsigned merge)
@@ -397,20 +404,28 @@ class regular : public iterator_mixin<regular<Value, Transform, MetaData, Option
397
404
398
405
template <class T >
399
406
regular (unsigned , T, T)
400
- ->regular<detail::convert_integer<T, double>, transform::id, null_type>;
407
+ -> regular<detail::convert_integer<T, double>, transform::id, null_type>;
401
408
402
409
template <class T , class M >
403
- regular (unsigned , T, T, M)
404
- ->regular<detail::convert_integer<T, double>, transform::id,
405
- detail::replace_cstring<std::decay_t<M>>>;
410
+ regular (unsigned , T, T, M) -> regular<detail::convert_integer<T, double>, transform::id,
411
+ detail::replace_cstring<std::decay_t<M>>>;
412
+
413
+ template <class T , class M , unsigned B>
414
+ regular (unsigned , T, T, M, const option::bitset<B>&)
415
+ -> regular<detail::convert_integer<T, double>, transform::id,
416
+ detail::replace_cstring<std::decay_t<M>>, option::bitset<B>>;
406
417
407
418
template <class Tr , class T , class = detail::requires_transform<Tr, T>>
408
- regular (Tr, unsigned , T, T)-> regular<detail::convert_integer<T, double>, Tr, null_type>;
419
+ regular (Tr, unsigned , T, T) -> regular<detail::convert_integer<T, double>, Tr, null_type>;
409
420
410
421
template <class Tr , class T , class M >
411
- regular (Tr, unsigned , T, T, M)
412
- ->regular<detail::convert_integer<T, double>, Tr,
413
- detail::replace_cstring<std::decay_t<M>>>;
422
+ regular (Tr, unsigned , T, T, M) -> regular<detail::convert_integer<T, double>, Tr,
423
+ detail::replace_cstring<std::decay_t<M>>>;
424
+
425
+ template <class Tr , class T , class M , unsigned B>
426
+ regular (Tr, unsigned , T, T, M, const option::bitset<B>&)
427
+ -> regular<detail::convert_integer<T, double>, Tr,
428
+ detail::replace_cstring<std::decay_t<M>>, option::bitset<B>>;
414
429
415
430
#endif
416
431
0 commit comments