mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-11 13:14:06 +00:00
- new thread-safe accumulators for arithmetic types - storages have a new flag `has_threading_support` to indicate support for parallel cell access - histogram automatically synchronises growing axes and storage if necessary
74 lines
2.3 KiB
Plaintext
74 lines
2.3 KiB
Plaintext
[section:DiscreteAxis DiscreteAxis]
|
|
|
|
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.
|
|
|
|
[heading Associated Types]
|
|
|
|
* [link histogram.concepts.Axis [*Axis]]
|
|
* [link histogram.concepts.IntervalAxis [*IntervalAxis]]
|
|
|
|
[heading Requirements]
|
|
|
|
* `A` is a type meeting the requirements of [*DiscreteAxis]
|
|
* `a` is a value of type `A`
|
|
* `V` is the type accepted for conversion into an index
|
|
* `v` is a value of type `V`
|
|
* `i` is a value of type [headerref boost/histogram/fwd.hpp `boost::histogram::index_type`]
|
|
* `AxisIter` is an /RandomAccessIterator/ over the bins of `A`
|
|
* `ReAxisIter` is a reverse /RandomAccessIterator/ over the bins of `A`
|
|
|
|
[table Valid expressions
|
|
[[Expression] [Returns] [Semantics, Pre/Post-conditions]]
|
|
[
|
|
[`a.value(i)`]
|
|
[`V`]
|
|
[
|
|
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.
|
|
]
|
|
]
|
|
[
|
|
[`a.bin(i)`]
|
|
[`V`]
|
|
[
|
|
Must have the same effect as `a.value(i)`.
|
|
]
|
|
]
|
|
[
|
|
[`s.begin()`]
|
|
[`AxisIter`]
|
|
[
|
|
Const member function which return an iterator to the bin with index `0`.
|
|
]
|
|
]
|
|
[
|
|
[`s.end()`]
|
|
[`AxisIter`]
|
|
[
|
|
Const member function which returns an iterator to the bin with index `s.size()`.
|
|
]
|
|
]
|
|
[
|
|
[`s.rbegin()`]
|
|
[`ReAxisIter`]
|
|
[
|
|
Const member function which return a reverse iterator to the bin with index `s.size()-1`.
|
|
]
|
|
]
|
|
[
|
|
[`s.rend()`]
|
|
[`ReAxisIter`]
|
|
[
|
|
Const member function which returns an iterator to the bin with index `-1`.
|
|
]
|
|
]
|
|
]
|
|
|
|
[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].]
|
|
|
|
[heading Models]
|
|
|
|
* [classref boost::histogram::axis::category]
|
|
* [classref boost::histogram::axis::integer], if first template parameter is [headerref boost/histogram/fwd.hpp `boost::histogram::index_type`]
|
|
|
|
[endsect]
|