2 Copyright Hans Dembinski 2018 - 2019.
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at
5 https://www.boost.org/LICENSE_1_0.txt)
8 [section:DiscreteAxis DiscreteAxis]
10 A [*DiscreteAxis] is one of two optional refinements of the [link histogram.concepts.Axis [*Axis]] concept, the other one is the [link histogram.concepts.IntervalAxis IntervalAxis]. This concept is for values that do not form intervals, and for axes with intervals that contain exactly one value.
12 [heading Associated Types]
14 * [link histogram.concepts.Axis [*Axis]]
15 * [link histogram.concepts.IntervalAxis [*IntervalAxis]]
17 [heading Requirements]
19 * `A` is a type meeting the requirements of [*DiscreteAxis]
20 * `a` is a value of type `A`
21 * `V` is the type accepted for conversion into an index
22 * `v` is a value of type `V`
23 * `i` is a value of type [headerref boost/histogram/fwd.hpp `boost::histogram::axis::index_type`]
24 * `AxisIter` is an /RandomAccessIterator/ over the bins of `A`
25 * `ReAxisIter` is a reverse /RandomAccessIterator/ over the bins of `A`
27 [table Valid expressions
28 [[Expression] [Returns] [Semantics, Pre/Post-conditions]]
33 Const member function which maps an index to a value. The mapping must be injective: each index must be uniquely mapped to one value. The effect must be exactly the inverse of `a.index(v)`. The return value may be a const reference, if the lifetime of the referred object is equal to the lifetime of the axis.
40 Must have the same effect as `a.value(i)`.
47 Const member function which return an iterator to the bin with index `0`.
54 Const member function which returns an iterator to the bin with index `s.size()`.
61 Const member function which return a reverse iterator to the bin with index `s.size()-1`.
68 Const member function which returns an iterator to the bin with index `-1`.
73 [tip The complete iterator interface can be added to a user-defined axis which implements `a.bin(i)` by inheriting from the [classref boost::histogram::axis::iterator_mixin iterator_mixin].]
77 * [classref boost::histogram::axis::category]
78 * [classref boost::histogram::axis::integer], if first template parameter is [headerref boost/histogram/fwd.hpp `boost::histogram::index_type`]