[/ Copyright Hans Dembinski 2018 - 2019. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) ] [section:IntervalAxis IntervalAxis] A [*IntervalAxis] is one of two optional refinements of the [link histogram.concepts.Axis [*Axis]] concept, the other one is the [link histogram.concepts.DiscreteAxis DiscreteAxis]. It is for ordered values that form intervals with a well-defined lower and upper edge, and a center. Each bin represents an interval of values. [heading Associated Types] * [link histogram.concepts.Axis [*Axis]] * [link histogram.concepts.DiscreteAxis [*DiscreteAxis]] [heading Optional features] * `A` is a type meeting the requirements of [*IntervalAxis] * `a` is a value of type `A` * `V` is the type accepted for conversion into an index * `B` is the type that represents the bin interval * `v` is a value of type `V` * `i` is a value of type [headerref boost/histogram/fwd.hpp `boost::histogram::axis::index_type`] * `j` is a value of type [headerref boost/histogram/fwd.hpp `boost::histogram::axis::real_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 result of `a.value(a.index(v))` should agree to very high precision with `v` (the mapping may not be exact due to the finite precision of floating point computations). The return value may be a const reference, if the lifetime of the referred object is equal to the lifetime of the axis. `a.value(j)` is expected to return the lower edge of the bin, `a.value(j+1)` the upper edge, and `a.value(j + 0.5)` the center. ] ] [ [`a.bin(i)`] [`B`] [ Const member function which returns an instance that represents the current bin. Nothing about the type is required, but it is recommended that the type has the methods `B::lower()`, `B::upper()`, and `B::center()` similar to the types used by the builtin axis models. The return value may be a const reference, if the lifetime of the referred object is equal to the lifetime of the axis. ] ] [ [`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::regular] * [classref boost::histogram::axis::variable] * [classref boost::histogram::axis::integer], if first template parameter is a floating point type [endsect]