Includes all standard headers of the Boost.Histogram library.

Extra headers not automatically included are:

- boost/histogram/ostream.hpp

- boost/histogram/axis/ostream.hpp

- boost/histogram/accumulators/ostream.hpp

- boost/histogram/serialization.hpp

Includes all accumulator headers of the Boost.Histogram library.

Extra header not automatically included:

- boost/histogram/accumulators/ostream.hpp

Includes all algorithm headers of the Boost.Histogram library.

Includes all axis headers of the Boost.Histogram library.

Extra header not automatically included:

- boost/histogram/axis/ostream.hpp

Forward declarations, tag types and type aliases.

Another alias for an empty metadata type.
`null_type`
Integral type for axis indices.
int
Empty metadata type.
void `Archive &` `unsigned`
Real type for axis indices.
double
Default storage, optimized for unweighted histograms.
`unlimited_storage`<>
Vector-like storage for fast zero-overhead access to cells.
`storage_adaptor`< std::vector< T, A > >
Dense storage which tracks means of samples in each cell.
dense_storage< `accumulators::mean`<> >
Dense storage which tracks sums of weights and a variance estimate.
dense_storage< `accumulators::weighted_sum`<> >
Dense storage which tracks means of weighted samples in each cell.
dense_storage< `accumulators::weighted_mean`<> >

std::tuple of axis types OR std::vector of an axis type or `axis::variant`

class that implements the storage interface

Central class of the histogram library.

Histogram uses the call operator to insert data, like the Boost.Accumulators.

Use factory functions (see make_histogram.hpp andmake_profile.hpp) to conveniently create histograms rather than calling the ctors directly.

Use the indexed range generator to iterate over filled histograms, which is convenient and faster than hand-written loops for multi-dimensional histograms.

Axes
Storage
typename storage_type::value_type
typename storage_type::iterator
typename storage_type::const_iterator
unspecified
constexpr unsigned Number of axes (dimensions).
std::size_t Total number of bins (including underflow/overflow).
void Reset all bins to default initialized values.
decltype(auto) unsigned 0 `std::integral_constant< unsigned, N >{}` Get N-th axis using a compile-time number.

This version is more efficient than the one accepting a run-time number.

decltype(auto) `unsigned` Get N-th axis with run-time number.

Prefer the version that accepts a compile-time number, if you can use it.

auto `Unary &&` Apply unary functor/function to each axis.
iterator class... `const T0 &` `const Ts &...` Fill histogram with values, an optional weight, and/or a sample.

Returns iterator to located cell.

Arguments are passed in order to the axis objects. Passing an argument type that is not convertible to the value type accepted by the axis or passing the wrong number of arguments causes a throw of `std::invalid_argument`.

Optional weight

An optional weight can be passed as the first or last argument with the weight helper function. Compilation fails if the storage elements do not support weights.

Samples

If the storage elements accept samples, pass them with the sample helper function in addition to the axis arguments, which can be the first or last argument. The sample helper function can pass one or more arguments to the storage element. If samples and weights are used together, they can be passed in any order at the beginning or end of the argument list.

Axis with multiple arguments

If the histogram contains an axis which accepts a `std::tuple` of arguments, the arguments for that axis need to be passed as a`std::tuple`, for example,`std::make_tuple(1.2, 2.3)`. If the histogram contains only this axis and no other, the arguments can be passed directly.

iterator class... `const std::tuple< Ts... > &` Fill histogram with values, an optional weight, and/or a sample from a `std::tuple`.
void `const Iterable &

iterable as explained in the long description.

` Fill histogram with several values at once.

The argument must be an iterable with a size that matches the rank of the histogram. The element of an iterable may be 1) a value or 2) an iterable with contiguous storage over values or 3) a variant of 1) and 2). Sub-iterables must have the same length.

Values are passed to the corresponding histogram axis in order. If a single value is passed together with an iterable of values, the single value is treated like an iterable with matching length of copies of this value.

If the histogram has only one axis, an iterable of values may be passed directly.

void `const Iterable &

iterable of values.

` `const `weight_type`< T > &

single weight or an iterable of weights.

` Fill histogram with several values and weights at once.

void `const `weight_type`< T > &

single weight or an iterable of weights.

` `const Iterable &

iterable of values.

` Fill histogram with several values and weights at once.

void class... `const Iterable &

iterable of values.

` `const `sample_type`< std::tuple< Ts... >> &

single sample or an iterable of samples.

` Fill histogram with several values and samples at once.

void `const `sample_type`< T > &

single sample or an iterable of samples.

` `const Iterable &

iterable of values.

` Fill histogram with several values and samples at once.

void class... `const Iterable &` `const `weight_type`< T > &` `const `sample_type`< std::tuple< Ts... >> &`
void `const `sample_type`< T > &` `const `weight_type`< U > &` `const Iterable &`
void `const `weight_type`< T > &` `const `sample_type`< U > &` `const Iterable &`
void `const Iterable &` `const `sample_type`< T > &` `const `weight_type`< U > &`
decltype(auto) class... `axis::index_type

index of first axis.

` `Is...

indices of second, third, ... axes.

` Access cell value at integral indices.

You can pass indices as individual arguments, as a std::tuple of integers, or as an interable range of integers. Passing the wrong number of arguments causes a throw of std::invalid_argument. Passing an index which is out of bounds causes a throw of std::out_of_range.

reference to cell value.

decltype(auto) class... `axis::index_type` `Is...` Access cell value at integral indices (read-only).
decltype(auto) `const `multi_index_type` &` Access cell value at integral indices stored in iterable.
decltype(auto) `const `multi_index_type` &` Access cell value at integral indices stored in iterable (read-only).
decltype(auto) `axis::index_type` Access value at index (for rank = 1).
decltype(auto) `axis::index_type` Access value at index (for rank = 1, read-only).
decltype(auto) `const `multi_index_type` &` Access value at index tuple.
decltype(auto) `const `multi_index_type` &` Access value at index tuple (read-only).
bool `const `histogram`< A, S > &` Equality operator, tests equality for all axes and the storage.
bool `const `histogram`< A, S > &` Negation of the equality operator.
`histogram` & `const `histogram`< A, S > &` Add values of another histogram.

This operator is only available if the value_type supports operator+=.

Both histograms must be compatible to be addable. The histograms are compatible, if the axes are either all identical. If the axes only differ in the states of their discrete growing axis types, then they are also compatible. The discrete growing axes are merged in this case.

`histogram` & `const `histogram`< axes_type, S > &`
`histogram` & `const `histogram`< A, S > &` Subtract values of another histogram.

This operator is only available if the value_type supports operator-=.

`histogram` & `const `histogram`< A, S > &` Multiply by values of another histogram.

This operator is only available if the value_type supports operator*=.

`histogram` & `const `histogram`< A, S > &` Divide by values of another histogram.

This operator is only available if the value_type supports operator/=.

`histogram` & `const double` Multiply all values with a scalar.

This operator is only available if the value_type supports operator*=.

`histogram` & `const double` Divide all values by a scalar.

This operator is only available if operator*= is available.

iterator Return value iterator to the beginning of the histogram.
iterator Return value iterator to the end in the histogram.
const_iterator Return value iterator to the beginning of the histogram (read-only).
const_iterator Return value iterator to the end in the histogram (read-only).
const_iterator Return value iterator to the beginning of the histogram (read-only).
const_iterator Return value iterator to the end in the histogram (read-only).
void `Archive &` `unsigned`
histogram
< A, S > &&
const `histogram`< A, S > &
`histogram` & ``histogram`< A, S > &&`
`histogram` & `const `histogram`< A, S > &`
A &&
Storage
Axes
class...
As &&...
auto `const `histogram`< A1, S1 > &` `const `histogram`< A2, S2 > &` Pairwise multiply cells of two histograms and return histogram with the product.

For notes on the returned histogram type, see operator+.

auto `const `histogram`< A, S > &` `double` Multiply all cells of the histogram by a number and return a new histogram.

If the original histogram has integer cells, the result has double cells.

auto `double` `const `histogram`< A, S > &` Multiply all cells of the histogram by a number and return a new histogram.

If the original histogram has integer cells, the result has double cells.

auto `const `histogram`< A1, S1 > &` `const `histogram`< A2, S2 > &` Pairwise add cells of two histograms and return histogram with the sum.

The returned histogram type is the most efficient and safest one constructible from the inputs, if they are not the same type. If one histogram has a tuple axis, the result has a tuple axis. The chosen storage is the one with the larger dynamic range.

auto `const `histogram`< A1, S1 > &` `const `histogram`< A2, S2 > &` Pairwise subtract cells of two histograms and return histogram with the difference.

For notes on the returned histogram type, see operator+.

auto `const `histogram`< A1, S1 > &` `const `histogram`< A2, S2 > &` Pairwise divide cells of two histograms and return histogram with the quotient.

For notes on the returned histogram type, see operator+.

auto `const `histogram`< A, S > &` `double` Divide all cells of the histogram by a number and return a new histogram.

If the original histogram has integer cells, the result has double cells.

iterate over inner bins, exclude underflow and overflow

iterate over all bins, including underflow and overflow

Coverage mode of the indexed range generator.

Defines options for the iteration strategy.

auto `Histogram &&

Reference to the histogram.

` `coveragecoverage::inner

Iterate over all or only inner bins (optional, default: inner).

` Generates an indexed range of forward iterators over the histogram cells.

Use this in a range-based for loop:

    for (auto&& x : indexed(hist)) { ... }

This generates an optimized loop which is nearly always faster than a hand-written loop over the histogram cells. The iterators dereference to an `indexed_range::accessor`, which has methods to query the current indices and bins and acts like a pointer to the cell value. The returned iterators are forward iterators. They can be stored in a container, but may not be used after the life-time of the histogram ends.

`indexed_range`

auto `Histogram &&

Reference to the histogram.

` `Iterable &&

Iterable over items with two axis::index_type values, which mark the begin and end index of each axis. The length of the iterable must be equal to the rank of the histogram. The begin index must be smaller than the end index. Index ranges wider than the actual range are reduced to the actual range including underflow and overflow indices.

` Generates and indexed range forward iterators over a rectangular region of histogram cells.

Use this in a range-based for loop. Example:

    auto hist = make_histogram(axis::integer<>(0, 4), axis::integer<>(2, 6));
    axis::index_type range[2] = {{1, 3}, {0, 2}};
    for (auto&& x : indexed(hist, range)) { ... }

This skips the first and last index of the first axis, and the last two indices of the second.

`indexed_range`

Input iterator range over histogram bins with multi-dimensional index.

The iterator returned by begin() can only be incremented. If several copies of the input iterators exist, the other copies become invalid if one of them is incremented.

Lightweight view to access value and index of current cell.

The methods provide access to the current cell indices and bins. It acts like a pointer to the cell value, and in a limited way also like a reference. To interoperate with the algorithms of the standard library, the accessor is implicitly convertible to a cell value. Assignments and comparisons are passed through to the cell. An accessor is coupled to its parent `indexed_range::iterator`. Moving the parent iterator forward also updates the linked accessor. Accessors are not copyable. They cannot be stored in containers, but`indexed_range::iterator` can be stored.

Array-like view into the current multi-dimensional index.
unspecified
const axis::index_type &
`const_iterator`
`const_iterator`
std::size_t
const_reference `unsigned`
const_reference `unsigned`
value_reference Returns the cell reference.
value_reference Returns the cell reference.
value_iterator Access fields and methods of the cell object.
axis::index_type `unsigned0

axis dimension.

` Access current index.

`index_view` Access indices as an iterable range.
decltype(auto) unsigned 0

axis dimension.

std::integral_constant< unsigned, N >
{}
Access current bin.

decltype(auto) `unsigned

axis dimension.

` Access current bin.

double Computes density in current cell.

The density is computed as the cell value divided by the product of bin widths. Axes without bin widths, like `axis::category`, are treated as having unit bin with.

bool `const `accessor` &`
bool `const `accessor` &`
bool `const `accessor` &`
bool `const `accessor` &`
bool `const `accessor` &`
bool `const `accessor` &`
bool `const U &`
bool `const U &`
bool `const U &`
bool `const U &`
bool `const U &`
bool `const U &`
value_type
`accessor` & `const `accessor` &`
`accessor` & `const T &`
iterator
&
const `accessor` &
unspecified
unspecified
unspecified
unspecified
`iterator`
`iterator`
histogram_type &
coverage
histogram_type &
Iterable &&
auto char... Suffix operator to generate literal compile-time numbers, 0_c, 12_c, etc.

Collection of factory functions to conveniently create histograms.

auto class... `Axis &&

First axis instance.

` `Axes &&...

Other axis instances.

` Make histogram from compile-time axis configuration and default storage.

auto `Iterable &&

Iterable range of axis objects.

` Make histogram from iterable range and default storage.

auto `Iterator

Iterator to range of axis objects.

` `Iterator

Iterator to range of axis objects.

` Make histogram from iterator interval and default storage.

auto class... `Storage &&

Storage or container with standard interface (any vector, array, or map).

` `Axis &&

First axis instance.

` `Axes &&...

Other axis instances.

` Make histogram from compile-time axis configuration and custom storage.

auto `Storage &&

Storage or container with standard interface (any vector, array, or map).

` `Iterable &&

Iterable range of axis objects.

` Make histogram from iterable range and custom storage.

auto `Storage &&

Storage or container with standard interface (any vector, array, or map).

` `Iterator

Iterator to range of axis objects.

` `Iterator

Iterator to range of axis objects.

` Make histogram from iterator interval and custom storage.

auto class... `Axis &&

First axis instance.

` `Axes &&...

Other axis instances.

` Make histogram from compile-time axis configuration and weight-counting storage.

auto `Iterable &&

Iterable range of axis objects.

` Make histogram from iterable range and weight-counting storage.

auto `Iterator

Iterator to range of axis objects.

` `Iterator

Iterator to range of axis objects.

` Make histogram from iterator interval and weight-counting storage.

Collection of factory functions to conveniently create profiles.

Profiles are histograms which accept an additional sample and compute the mean of the sample in each cell.

auto class... `Axis &&

First axis instance.

` `Axes &&...

Other axis instances.

` Make profle from compile-time axis configuration.

auto `Iterable &&

Iterable range of axis objects.

` Make profile from iterable range.

auto `Iterator

Iterator to range of axis objects.

` `Iterator

Iterator to range of axis objects.

` Make profile from iterator interval.

auto class... `Axis &&

First axis instance.

` `Axes &&...

Other axis instances.

` Make profle from compile-time axis configuration which accepts weights.

auto `Iterable &&

Iterable range of axis objects.

` Make profile from iterable range which accepts weights.

auto `Iterator

Iterator to range of axis objects.

` `Iterator

Iterator to range of axis objects.

` Make profile from iterator interval which accepts weights.

std::size_t
Holder for multiple axis indices.

Adapts external iterable, tuple, or explicit list of indices to the same representation.

axis::index_type
value_type *
const value_type *
`multi_index` `std::size_t`
constexpr std::size_t
iterator
iterator
const_iterator
const_iterator
class...
axis::index_type
Is...
class...
const std::tuple< axis::index_type, Is... > &
const Iterable &
priv_tag
std::size_t...
const T &
mp11::index_sequence< Is... >
static_cast< std::size_t >(-1)
axis::index_type
value_type *
const value_type *
`multi_index` `std::size_t`
iterator
iterator
const_iterator
const_iterator
std::size_t
class...
axis::index_type
Is...
class...
const std::tuple< axis::index_type, Is... > &
const Iterable &
priv_tag
std::size_t
std::size_t...
const T &
mp11::index_sequence< Ns... >

A simple streaming operator for the histogram type.

The text representation is rudimentary and not guaranteed to be stable between versions of Boost.Histogram. This header is not included by any other header and must be explicitly included to use the streaming operator.

To use your own, simply include your own implementation instead of this header.

auto class... `Ts &&...

arguments to be forwarded to the accumulator.

` Helper function to mark arguments as sample.

Sample holder and type envelope.

You should not construct these directly, use the sample() helper function.

T

Headers from Boost.Serialization needed to serialize STL types that are used internally by the Boost.Histogram classes.

Turns any vector-like, array-like, and map-like container into a storage type.
bool `const U &`
void `Archive &` `unsigned`
storage_adaptor
&&
const `storage_adaptor` &
`storage_adaptor` & ``storage_adaptor` &&`
`storage_adaptor` & `const `storage_adaptor` &`
class...
Ts &&...
`storage_adaptor` & `U &&`
Memory-efficient storage for integral counters which cannot overflow.

This storage provides a no-overflow-guarantee if the counters are incremented with integer weights. It maintains a contiguous array of elemental counters, one for each cell. If an operation is requested which would overflow a counter, the array is replaced with another of a wider integral type, then the operation is executed. The storage uses integers of 8, 16, 32, 64 bits, and then switches to a multiprecision integral type, similar to those in Boost.Multiprecision.

A scaling operation or adding a floating point number triggers a conversion of the elemental counters into doubles, which voids the no-overflow-guarantee.

unspecified
unspecified
Allocator
double
unspecified
unspecified
unspecified
constexpr bool
allocator_type
void `std::size_t`
std::size_t
`reference` `std::size_t`
`const_reference` `std::size_t`
bool `const `unlimited_storage` &`
bool `const Iterable &`
`unlimited_storage` & `const double`
iterator
iterator
const_iterator
const_iterator
void `Archive &` `unsigned`
const allocator_type &
{}
const `unlimited_storage` &
`unlimited_storage` & `const `unlimited_storage` &`
unlimited_storage
&&
`unlimited_storage` & ``unlimited_storage` &&`
const Iterable &
`unlimited_storage` & `const Iterable &`
Unsafe read/write access to private data that potentially breaks consistency.

This struct enables access to private data of some classes. It is intended for library developers who need this to implement algorithms efficiently, for example, serialization. Users should not use this. If you are a user who absolutely needs this to get a specific effect, please submit an issue on Github. Perhaps the public interface is insufficient and should be extended for your use case.

Unlike the normal interface, the `unsafe_access` interface may change between versions. If your code relies on`unsafe_access`, it may or may not break when you update Boost. This is another reason to not use it unless you are ok with these conditions.

auto & `Histogram &

histogram.

` Get axes.

const auto & `const Histogram &

histogram.

` Get axes.

decltype(auto) unsigned 0

axis index (optional, default: 0).

Histogram &

histogram.

std::integral_constant< unsigned, I >
{}
Get mutable axis reference with compile-time number.

decltype(auto) `Histogram &

histogram.

` `unsigned

axis index.

` Get mutable axis reference with run-time number.

auto & `Histogram &

histogram.

` Get storage.

const auto & `const Histogram &

histogram.

` Get storage.

auto & `Histogram &

histogram

` Get index offset.

const auto & `const Histogram &

histogram

` Get index offset.

constexpr auto & ``unlimited_storage`< Allocator > &

instance of `unlimited_storage`.

` Get buffer of `unlimited_storage`.

constexpr auto & ``storage_adaptor`< T > &

instance of `storage_adaptor`.

` Get implementation of `storage_adaptor`.

auto `T &&

argument to be forward to the histogram.

` Helper function to mark argument as weight.

Weight holder and type envelope.

You should not construct these directly, use the weight() helper function.

T Access underlying value.
weight_type< U > Allow implicit conversions of types when the underlying value type allows them.
bool

Set to true to make increments and adds thread-safe.

Wraps a C++ arithmetic type with optionally thread-safe increments and adds.

This adaptor optionally uses atomic operations to make concurrent increments and additions thread-safe for the stored arithmetic value, which can be integral or floating point. For small histograms, the performance will still be poor because of False Sharing, see https://en.wikipedia.org/wiki/False_sharing for details.

Warning: Assignment is not thread-safe in this implementation, so don't assign concurrently.

This wrapper class can be used as a base class by users to add arbitrary metadata to each bin of a histogram.

When weighted samples are accumulated and high precision is required, use ``accumulators::sum`` instead (at the cost of lower performance). If a local variance estimate for the weight distribution should be computed as well (generally needed for a detailed statistical analysis), use``accumulators::weighted_sum``.

ValueType
const value_type &
`count` & Increment count by one.
`count` & `const_reference` Increment count by value.
`count` & `const `count` &` Add another count.
`count` & `const_reference` Scale by value.
bool `const `count` &`
bool `const `count` &`
value_type Return count.
value_type
void `Archive &` `unsigned`
`count` & `const `count` &`
`count` `const `count` &`
`count` & `const `count` &`
`count` `const `count` &`
bool `const `count` &`
bool `const `count` &`
bool `const `count` &`
bool `const `count` &`
const_reference
Initialize count to value and allow implicit conversion.
bool
const `count`< T, B > &
Allow implicit conversion from other count.
constexpr bool
Calculates mean and variance of sample.

Uses Welfords's incremental algorithm to improve the numerical stability of mean and variance computation.

ValueType
const value_type &
void `const_reference` Insert sample x.
void `const `weight_type`< value_type > &` `const_reference` Insert sample x with weight w.
`mean` & `const `mean` &` Add another mean accumulator.
`mean` & `const_reference` Scale by value.

This acts as if all samples were scaled by the value.

bool `const `mean` &`
bool `const `mean` &`
const_reference Return how many samples were accumulated.

count() should be used to check whether value() and variance() are defined, see documentation of value() and variance(). count() can be used to compute the variance of the mean by dividing variance() by count().

const_reference Return mean value of accumulated samples.

The result is undefined, if `count() < 1`.

value_type Return variance of accumulated samples.

The result is undefined, if `count() < 2`.

void `Archive &` `unsigned`
const `mean`< T > &
Allow implicit conversion from mean<T>.
const_reference
const_reference
const_reference
Initialize to external count, mean, and variance.

Simple streaming operators for the builtin accumulator types.

The text representation is not guaranteed to be stable between versions of Boost.Histogram. This header is only included by boost/histogram/ostream.hpp. To use your own, include your own implementation instead of this header and do not includeboost/histogram/ostream.hpp.

Uses Neumaier algorithm to compute accurate sums of floats.

The algorithm is an improved Kahan algorithm (https://en.wikipedia.org/wiki/Kahan_summation_algorithm). The algorithm uses memory for two numbers and is three to five times slower compared to using a single number to accumulate a sum, but the relative error of the sum is at the level of the machine precision, independent of the number of samples.

A. Neumaier, Zeitschrift fuer Angewandte Mathematik und Mechanik 54 (1974) 39-51.

ValueType
const value_type &
`sum` & Increment sum by one.
`sum` & `const_reference` Increment sum by value.
`sum` & `const `sum` &` Add another sum.
`sum` & `const_reference` Scale by value.
bool `const `sum` &`
bool `const `sum` &`
value_type Return value of the sum.
const_reference Return large part of the sum.
const_reference Return small part of the sum.
value_type
void `Archive &` `unsigned`
`sum` & `const `sum` &`
`sum` `const `sum` &`
`sum` & `const `sum` &`
`sum` `const `sum` &`
bool `const `sum` &`
bool `const `sum` &`
bool `const `sum` &`
bool `const `sum` &`
const_reference Return large part of the sum.
const_reference Return small part of the sum.
const_reference
Initialize sum to value and allow implicit conversion.
const `sum`< T > &
Allow implicit conversion from sum<T>
const_reference
const_reference
Initialize sum explicitly with large and small parts.
thread_safe< T >
true_type

type to adapt, must be an integral type.

std::atomic< T >
Thread-safe adaptor for builtin integral numbers.

This adaptor uses atomic operations to make concurrent increments and additions safe for the stored value.

On common computing platforms, the adapted integer has the same size and alignment as underlying type. The atomicity is implemented with a special CPU instruction. On exotic platforms the size of the adapted number may be larger and/or the type may have different alignment, which means it cannot be tightly packed into arrays.

T
std::atomic< T >
`thread_safe` & `const `thread_safe` &`
`thread_safe` & `value_type`
`thread_safe` &
void `Archive &` `unsigned`
const `thread_safe` &
`thread_safe` & `const `thread_safe` &`
value_type
`thread_safe` & `value_type`
Calculates mean and variance of weighted sample.

Uses West's incremental algorithm to improve numerical stability of mean and variance computation.

ValueType
const value_type &
void `const_reference` Insert sample x.
void `const `weight_type`< value_type > &` `const_reference` Insert sample x with weight w.
`weighted_mean` & `const `weighted_mean` &` Add another `weighted_mean`.
`weighted_mean` & `const_reference` Scale by value.

This acts as if all samples were scaled by the value.

bool `const `weighted_mean` &`
bool `const `weighted_mean` &`
const_reference Return sum of weights.
const_reference Return sum of weights squared (variance of weight distribution).
value_type Return effective counts.

This corresponds to the equivalent number of unweighted samples that would have the same variance as this sample. count() should be used to check whether value() and variance() are defined, see documentation of value() and variance(). count() can be used to compute the variance of the mean by dividing variance() by count().

const_reference Return mean value of accumulated weighted samples.

The result is undefined, if count() == 0.

value_type Return variance of accumulated weighted samples.

The result is undefined, if count() == 0 or count() == 1.

void `Archive &` `unsigned`
const `weighted_mean`< T > &
Allow implicit conversion from other weighted_means.
const_reference
const_reference
const_reference
const_reference
Initialize to external sum of weights, sum of weights squared, mean, and variance.
Holds sum of weights and its variance estimate.
ValueType
const value_type &
`weighted_sum` & Increment by one.
`weighted_sum` & `const `weight_type`< value_type > &` Increment by weight.
`weighted_sum` & `const `weighted_sum` &` Added another weighted sum.
`weighted_sum` & `const_reference` Scale by value.
bool `const `weighted_sum` &`
bool `const `weighted_sum` &`
const_reference Return value of the sum.
const_reference Return estimated variance of the sum.
const_reference
void `Archive &` `unsigned`
const_reference
Initialize sum to value and allow implicit conversion.
const `weighted_sum`< T > &
Allow implicit conversion from sum<T>
const_reference
const_reference
Initialize sum to value and variance.
auto `const `histogram`< A, S > &` `coverage` Check to see if all histogram cells are empty.

Use coverage to include or exclude the underflow/overflow bins.

This algorithm has O(N) complexity, where N is the number of cells.

Returns true if all cells are empty, and false otherwise.

auto unsigned typename... `const `histogram`< A, S > &` `std::integral_constant< unsigned, N >` `Ns...` Returns a lower-dimensional histogram, summing over removed axes.

Arguments are the source histogram and compile-time numbers, the remaining indices of the axes. Returns a new histogram which only contains the subset of axes. The source histogram is summed over the removed axes.

auto `const `histogram`< A, S > &` `const Iterable &` Returns a lower-dimensional histogram, summing over removed axes.

This version accepts a source histogram and an iterable range containing the remaining indices.

reduce_command `unsigned

which axis to operate on.

` `double

bin which contains lower is first to be kept.

` `double

bin which contains upper is last to be kept, except if upper is equal to the lower edge.

` Crop command to be used in `reduce`.

Command is applied to axis with given index.

Works like `shrink` (see shrink documentation for details), but counts in removed bins are always discarded, whether underflow and overflow bins are present or not.

reduce_command `double

bin which contains lower is first to be kept.

` `double

bin which contains upper is last to be kept, except if upper is equal to the lower edge.

` Crop command to be used in `reduce`.

Command is applied to corresponding axis in order of reduce arguments.

Works like `shrink` (see shrink documentation for details), but counts in removed bins are discarded, whether underflow and overflow bins are present or not. If the cropped range goes beyond the axis range, then the content of the underflow or overflow bin which overlaps with the range is kept.

If the counts in an existing underflow or overflow bin are discared by the crop, the corresponding memory cells are not physically removed. Only their contents are set to zero. This technical limitation may be lifted in the future, then crop may completely remove the cropped memory cells.

reduce_command `unsigned

which axis to operate on.

` `double

lowest bound that should be kept.

` `double

highest bound that should be kept. If upper is inside bin interval, the whole interval is removed.

` `unsigned

how many adjacent bins to merge into one.

` Crop and rebin command to be used in `reduce`.

Command is applied to axis with given index.

To `crop` and`rebin` in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to`reduce`.

reduce_command `double

lowest bound that should be kept.

` `double

highest bound that should be kept. If upper is inside bin interval, the whole interval is removed.

` `unsigned

how many adjacent bins to merge into one.

` Crop and rebin command to be used in `reduce`.

Command is applied to corresponding axis in order of reduce arguments.

To `crop` and`rebin` in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to`reduce`.

reduce_command `unsigned

which axis to operate on.

` `unsigned

how many adjacent bins to merge into one.

` Rebin command to be used in `reduce`.

Command is applied to axis with given index.

The command merges N adjacent bins into one. This makes the axis coarser and the bins wider. The original number of bins is divided by N. If there is a rest to this devision, the axis is implicitly shrunk at the upper end by that rest.

reduce_command `unsigned

how many adjacent bins to merge into one.

` Rebin command to be used in `reduce`.

Command is applied to corresponding axis in order of reduce arguments.

The command merges N adjacent bins into one. This makes the axis coarser and the bins wider. The original number of bins is divided by N. If there is a rest to this devision, the axis is implicitly shrunk at the upper end by that rest.

Histogram `const Histogram &

original histogram.

` `const Iterable &

iterable sequence of reduce commands: `shrink`,`slice`,`rebin`,`shrink_and_rebin`, or`slice_and_rebin`. The element type of the iterable should be`reduce_command`.

` Shrink, crop, slice, and/or rebin axes of a histogram.

Returns a new reduced histogram and leaves the original histogram untouched.

The commands `rebin` and`shrink` or`slice` for the same axis are automatically combined, this is not an error. Passing a`shrink` and a`slice` command for the same axis or two`rebin` commands triggers an`invalid_argument` exception. Trying to reducing a non-reducible axis triggers an`invalid_argument` exception. Histograms with non-reducible axes can still be reduced along the other axes that are reducible.

An overload allows one to pass reduce_command as positional arguments.

Histogram class... `const Histogram &

original histogram.

` `const reduce_command &

first reduce command; one of `shrink`,`slice`,`rebin`,`shrink_and_rebin`, or`slice_or_rebin`.

` `const Ts &...

more reduce commands.

` Shrink, slice, and/or rebin axes of a histogram.

Returns a new reduced histogram and leaves the original histogram untouched.

The commands `rebin` and`shrink` or`slice` for the same axis are automatically combined, this is not an error. Passing a`shrink` and a`slice` command for the same axis or two`rebin` commands triggers an invalid_argument exception. It is safe to reduce histograms with some axis that are not reducible along the other axes. Trying to reducing a non-reducible axis triggers an invalid_argument exception.

An overload allows one to pass an iterable of reduce_command.

Holder for a reduce command.

Use this type to store reduce commands in a container. The internals of this type are an implementation detail.

unspecified
reduce_command `unsigned

which axis to operate on.

` `double

bin which contains lower is first to be kept.

` `double

bin which contains upper is last to be kept, except if upper is equal to the lower edge.

` Shrink command to be used in `reduce`.

Command is applied to axis with given index.

Shrinking is based on an inclusive value interval. The bin which contains the first value starts the range of bins to keep. The bin which contains the second value is the last included in that range. When the second value is exactly equal to a lower bin edge, then the previous bin is the last in the range.

The counts in removed bins are added to the corresponding underflow and overflow bins, if they are present. If they are not present, the counts are discarded. Also see `crop`, which always discards the counts.

reduce_command `double

bin which contains lower is first to be kept.

` `double

bin which contains upper is last to be kept, except if upper is equal to the lower edge.

` Shrink command to be used in `reduce`.

Command is applied to corresponding axis in order of reduce arguments.

Shrinking is based on an inclusive value interval. The bin which contains the first value starts the range of bins to keep. The bin which contains the second value is the last included in that range. When the second value is exactly equal to a lower bin edge, then the previous bin is the last in the range.

The counts in removed bins are added to the corresponding underflow and overflow bins, if they are present. If they are not present, the counts are discarded. Also see `crop`, which always discards the counts.

reduce_command `unsigned

which axis to operate on.

` `double

lowest bound that should be kept.

` `double

highest bound that should be kept. If upper is inside bin interval, the whole interval is removed.

` `unsigned

how many adjacent bins to merge into one.

` Shrink and rebin command to be used in `reduce`.

Command is applied to corresponding axis in order of reduce arguments.

To shrink(unsigned, double, double) and rebin(unsigned, unsigned) in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to `reduce`.

reduce_command `double

lowest bound that should be kept.

` `double

highest bound that should be kept. If upper is inside bin interval, the whole interval is removed.

` `unsigned

how many adjacent bins to merge into one.

` Shrink and rebin command to be used in `reduce`.

Command is applied to corresponding axis in order of reduce arguments.

To `shrink` and`rebin` in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to`reduce`.

reduce_command `unsigned

which axis to operate on.

` `axis::index_type

first index that should be kept.

` `axis::index_type

one past the last index that should be kept.

` `slice_modeslice_mode::shrink

whether to behave like `shrink` or`crop` regarding removed bins.

` Slice command to be used in `reduce`.

Command is applied to axis with given index.

Slicing works like `shrink` or`crop`, but uses bin indices instead of values.

reduce_command `axis::index_type

first index that should be kept.

` `axis::index_type

one past the last index that should be kept.

` `slice_modeslice_mode::shrink

whether to behave like `shrink` or`crop` regarding removed bins.

` Slice command to be used in `reduce`.

Command is applied to corresponding axis in order of reduce arguments.

Slicing works like `shrink` or`crop`, but uses bin indices instead of values.

reduce_command `unsigned

which axis to operate on.

` `axis::index_type

first index that should be kept.

` `axis::index_type

one past the last index that should be kept.

` `unsigned

how many adjacent bins to merge into one.

` `slice_modeslice_mode::shrink

slice mode, see slice_mode.

` Slice and rebin command to be used in `reduce`.

Command is applied to axis with given index.

To `slice` and`rebin` in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to`reduce`.

reduce_command `axis::index_type

first index that should be kept.

` `axis::index_type

one past the last index that should be kept.

` `unsigned

how many adjacent bins to merge into one.

` `slice_modeslice_mode::shrink

slice mode, see slice_mode.

` Slice and rebin command to be used in `reduce`.

Command is applied to corresponding axis in order of reduce arguments.

To `slice` and`rebin` in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to`reduce`.

Whether to behave like `shrink` or`crop` regarding removed bins.
auto `const `histogram`< A, S > &

Const reference to the histogram.

` `const coveragecoverage::all

Iterate over all or only inner bins (optional, default: all).

` Compute the sum over all histogram cells (underflow/overflow included by default).

The implementation favors accuracy and protection against overflow over speed. If the value type of the histogram is an integral or floating point type, accumulators::sum<double> is used to compute the sum, else the original value type is used. Compilation fails, if the value type does not support operator+=. The return type is double if the value type of the histogram is integral or floating point, and the original value type otherwise.

If you need a different trade-off, you can write your own loop or use `std::accumulate`:

    // iterate over all bins
    auto sum_all = std::accumulate(hist.begin(), hist.end(), 0.0);

    // skip underflow/overflow bins
    double sum = 0;
    for (auto&& x : indexed(hist))
      sum += *x; // dereference accessor

    // or:
    // auto ind = boost::histogram::indexed(hist);
    // auto sum = std::accumulate(ind.begin(), ind.end(), 0.0);

accumulator type or double

type to store meta data.

boost::histogram::axis::iterator_mixin< boolean< MetaData > >
metadata_base_t< MetaData >
Discrete axis for boolean data.

Binning is a pass-though operation with zero cost, making this the fastest possible axis. The axis has no internal state apart from the optional metadata state. The axis has no under- and overflow bins. It cannot grow and cannot be reduced.

index_type `value_type` Return index for value argument.
value_type `index_type` Return value for index argument.
value_type `index_type` Return bin for index argument.
index_type Returns the number of bins, without over- or underflow.
bool `const `boolean`< M > &`
bool `const `boolean`< M > &`
void `Archive &` `unsigned`
metadata_type
{}

description of the axis.

Construct a boolean axis.

constexpr bool Whether the axis is inclusive (see `axis::traits::is_inclusive`).
constexpr unsigned Returns the options.

input value type, must be equal-comparable.

type to store meta data.

see boost::histogram::axis::option.

allocator to use for dynamic memory management.

boost::histogram::axis::iterator_mixin< category< Value, MetaData, Options, Allocator > >
metadata_base_t< MetaData >
Maps at a set of unique values to bin indices.

The axis maps a set of values to bins, following the order of arguments in the constructor. The optional overflow bin for this axis counts input values that are not part of the set. Binning has O(N) complexity, but with a very small factor. For small N (the typical use case) it beats other kinds of lookup.

The options `underflow` and`circular` are not allowed. The options`growth` and`overflow` are mutually exclusive.

index_type `const value_type &` Return index for value argument.
std::pair< index_type, index_type > `const value_type &` Returns index and shift (if axis has grown) for the passed argument.
auto `index_type` Return value for index argument.

Throws `std::out_of_range` if the index is out of bounds.

decltype(auto) `index_type` Return value for index argument; alias for value(...).
index_type Returns the number of bins, without over- or underflow.
bool `const `category`< V, M, O, A > &`
bool `const `category`< V, M, O, A > &`
allocator_type
void `Archive &` `unsigned`
allocator_type
It

begin of category range of unique values.

It

end of category range of unique values.

metadata_type
{}

description of the axis.

allocator_type
{}

allocator instance to use.

Construct from iterator range of unique values.

const C &

sequence of unique values.

metadata_type
{}

description of the axis.

allocator_type
{}

allocator instance to use.

Construct axis from iterable sequence of unique values.

std::initializer_list< U >

`std::initializer_list` of unique values.

metadata_type
{}

description of the axis.

allocator_type
{}

allocator instance to use.

Construct axis from an initializer list of unique values.

const `category` &
index_type
index_type
unsigned
Constructor used by algorithm::reduce to shrink and rebin (not for users).
constexpr unsigned Returns the options.
constexpr bool Whether the axis is inclusive (see `axis::traits::is_inclusive`).
constexpr bool Indicate that the axis is not ordered.

input value type. Must be integer or floating point.

type to store meta data.

see boost::histogram::axis::option (all values allowed).

boost::histogram::axis::iterator_mixin< integer< Value, MetaData, Options > >
metadata_base_t< MetaData >
Axis for an interval of integer values with unit steps.

Binning is a O(1) operation. This axis bins faster than a regular axis.

index_type `value_type` Return index for value argument.
auto `value_type` Returns index and shift (if axis has grown) for the passed argument.
value_type `local_index_type` Return value for index argument.
decltype(auto) `index_type` Return bin for index argument.
index_type Returns the number of bins, without over- or underflow.
bool `const `integer`< V, M, O > &`
bool `const `integer`< V, M, O > &`
void `Archive &` `unsigned`
value_type

first integer of covered range.

value_type

one past last integer of covered range.

metadata_type
{}

description of the axis.

Construct over semi-open integer interval [start, stop).

const `integer` &
index_type
index_type
unsigned
Constructor used by algorithm::reduce to shrink and rebin.
constexpr unsigned Returns the options.
constexpr bool Whether the axis is inclusive (see `axis::traits::is_inclusive`).
Lightweight bin view.

Represents the current bin interval.

decltype(auto) Return lower edge of bin.
decltype(auto) Return upper edge of bin.
decltype(auto) Return center of bin.
decltype(auto) Return width of bin.
bool `const BinType &`
bool `const BinType &`
const Axis &
index_type
Axis &&
index_type
Uses CRTP to inject iterator logic into Derived.
iterator< Derived >
std::reverse_iterator< const_iterator >
const_iterator Bin iterator to beginning of the axis (read-only).
const_iterator Bin iterator to the end of the axis (read-only).
const_reverse_iterator Reverse bin iterator to the last entry of the axis (read-only).
const_reverse_iterator Reverse bin iterator to the end (read-only).

Wrapped meta data type.

Meta data holder with space optimization for empty meta data types.

Allows write-access to metadata even if const.

const `metadata_base` &
`metadata_base` & `const `metadata_base` &`
metadata_base
&&
metadata_type &&
`metadata_base` & ``metadata_base` &&`
metadata_type & Returns reference to metadata.
metadata_type & Returns reference to mutable metadata from const axis.

Options for builtin axis types.

Options `circular` and`growth` are mutually exclusive. Options`circular` and`underflow` are mutually exclusive.

unsigned

position of the bit in the set.

Single option flag.

unsigned
std::integral_constant< unsigned, Bits >
Holder of axis options.
constexpr auto unsigned ``bitset`< B >` Returns true if all option flags in the argument are set and false otherwise.
constexpr circular_t Instance of `circular_t`.
Axis is circular. Mutually exclusive with `growth` and`underflow`.
`bit`< 2 >
constexpr growth_t Instance of `growth_t`.
Axis can grow. Mutually exclusive with `circular`.
`bit`< 3 >
constexpr none_t Instance of `none_t`.
All options off.
`bitset`< 0 >
constexpr auto unsigned unsigned ``bitset`< B1 >` ``bitset`< B2 >` Set intersection of the option arguments.
constexpr auto unsigned unsigned ``bitset`< B1 >` ``bitset`< B2 >` Set difference of the option arguments.
constexpr auto unsigned unsigned ``bitset`< B1 >` ``bitset`< B2 >` Set union of the axis option arguments.
constexpr overflow_t Instance of `overflow_t`.
Axis has overflow bin.
`bit`< 1 >
constexpr underflow_t Instance of `underflow_t`.
Axis has an underflow bin. Mutually exclusive with `circular`.
`bit`< 0 >

Simple streaming operators for the builtin axis types.

The text representation is not guaranteed to be stable between versions of Boost.Histogram. This header is only included by boost/histogram/ostream.hpp. To use your own, include your own implementation instead of this header and do not includeboost/histogram/ostream.hpp.

Holds the bin data of an `axis::variant`.

The interface is a superset of the `axis::interval_view` class. In addition, the object is implicitly convertible to the value type, returning the equivalent of a call to lower(). For discrete axes, lower() == upper(), and width() returns zero.

This is not a view like `axis::interval_view` for two reasons.

- Sequential calls to lower() and upper() would have to each loop through the variant types. This is likely to be slower than filling all the data in one loop.

- `polymorphic_bin` may be created from a temporary instance of`axis::variant`, like in the call histogram::axis(0). Storing a reference to the axis would result in a dangling reference. Rather than specialing the code to handle this, it seems easier to just use a value instead of a view.

const value_type & Implicitly convert to bin value (for axis with discrete values).
value_type Return lower edge of bin.
value_type Return upper edge of bin.
value_type Return center of bin.
value_type Return width of bin.
bool `const BinType &`
bool `const BinType &`
bool Return true if bin is discrete.
value_type
value_type
double
use_default
use_default
Regular axis with circular option already set.

input value type, must be floating point.

builtin or user-defined transform type.

type to store meta data.

see boost::histogram::axis::option (all values allowed).

boost::histogram::axis::iterator_mixin< regular< Value, Transform, MetaData, Options > >
metadata_base_t< MetaData >
Axis for equidistant intervals on the real line.

The most common binning strategy. Very fast. Binning is a O(1) operation.

const transform_type & Return instance of the transform type.
index_type `value_type` Return index for value argument.
std::pair< index_type, index_type > `value_type` Returns index and shift (if axis has grown) for the passed argument.
value_type `real_index_type` Return value for fractional index argument.
decltype(auto) `index_type` Return bin for index argument.
index_type Returns the number of bins, without over- or underflow.
bool `const `regular`< V, T, M, O > &`
bool `const `regular`< V, T, M, O > &`
void `Archive &` `unsigned`
transform_type

transform instance to use.

unsigned

number of bins.

value_type

low edge of first bin.

value_type

high edge of last bin.

metadata_type
{}

description of the axis (optional).

Construct n bins over real transformed range [start, stop).

unsigned

number of bins.

value_type

low edge of first bin.

value_type

high edge of last bin.

metadata_type
{}

description of the axis (optional).

Construct n bins over real range [start, stop).

transform_type

transform instance to use.

step_type< T >

width of a single bin.

value_type

low edge of first bin.

value_type

upper limit of high edge of last bin (see below).

metadata_type
{}

description of the axis (optional).

Construct bins with the given step size over real transformed range [start, stop).

The axis computes the number of bins as n = abs(stop - start) / step, rounded down. This means that stop is an upper limit to the actual value (start + n * step).

step_type< T >

width of a single bin.

value_type

low edge of first bin.

value_type

upper limit of high edge of last bin (see below).

metadata_type
{}

description of the axis (optional).

Construct bins with the given step size over real range [start, stop).

The axis computes the number of bins as n = abs(stop - start) / step, rounded down. This means that stop is an upper limit to the actual value (start + n * step).

const `regular` &
index_type
index_type
unsigned
Constructor used by algorithm::reduce to shrink and rebin (not for users).
constexpr unsigned Returns the options.
step_type< T > `T` Helper function to mark argument as step size.
Identity transform for equidistant bins.
T `T &&` Pass-through.
T `T &&` Pass-through.
void `Archive &` `unsigned`
Log transform for equidistant bins in log-space.
T `T` Returns log(x) of external value x.
T `T` Returns exp(x) for internal value x.
void `Archive &` `unsigned`
Pow transform for equidistant bins in pow-space.
double power index
auto `T` Returns pow(x, power) of external value x.
auto `T` Returns pow(x, 1/power) of external value x.
bool `const `pow` &`
void `Archive &` `unsigned`
double
Make transform with index p.
Sqrt transform for equidistant bins in sqrt-space.
T `T` Returns sqrt(x) of external value x.
T `T` Returns x^2 of internal value x.
void `Archive &` `unsigned`
constexpr bool `const Axis &

any axis instance

` Returns true if axis is continuous or false.

See `is_continuous` for details.

index_type `const Axis &

any axis instance

` Returns axis size plus any extra bins for under- and overflow.

axis type

Get axis options for axis type.

Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and returns the `boost::histogram::axis::option::bitset`.

If Axis::options() is valid and constexpr, `get_options` is the corresponding option type. Otherwise, it is boost::histogram::axis::option::growth_t, if the axis has a method`update`, else boost::histogram::axis::option::none_t.

constexpr bool `const Axis &

any axis instance

` Returns true if axis is inclusive or false.

See `is_inclusive` for details.

axis::index_type `const Axis &

any axis instance

` `const U &

argument to be passed to `index` method

` Returns axis index for value.

Throws std::invalid_argument if the value argument is not implicitly convertible.

Whether axis is continuous or discrete.

Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and returns a compile-time boolean.

If the boolean is true, the axis is continuous (covers a continuous range of values). Otherwise it is discrete (covers discrete values).

axis type

Meta-function to detect whether an axis is inclusive.

Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and represents compile-time boolean which is true or false, depending on whether the axis is inclusive or not.

An inclusive axis has a bin for every possible input value. In other words, all possible input values always end up in a valid cell and there is no need to keep track of input tuples that need to be discarded. A histogram which consists entirely of inclusive axes can be filled more efficiently, which can be a factor 2 faster.

An axis with underflow and overflow bins is always inclusive, but an axis may be inclusive under other conditions. The meta-function checks for the method `constexpr static bool inclusive()`, and uses the result. If this method is not present, it uses get_options<Axis> and checks whether the underflow and overflow bits are present.

axis type

Meta-function to detect whether an axis is ordered.

Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and returns a compile-time boolean. If the boolean is true, the axis is ordered.

The meta-function checks for the method `constexpr static bool ordered()`, and uses the result. If this method is not present, it returns true if the value type of the Axis is arithmetic and false otherwise.

An ordered axis has a value type that is ordered, which means that indices i < j < k implies either value(i) < value(j) < value(k) or value(i) > value(j) > value(k) for all i,j,k. For example, the integer axis is ordered, but the category axis is not. Axis which are not ordered must not have underflow bins, because they only have an "other" category, which is identified with the overflow bin if it is available.

axis type.

Meta-function to detect whether an axis is reducible.

Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and represents compile-time boolean which is true or false, depending on whether the axis can be reduced with boost::histogram::algorithm::reduce().

An axis can be made reducible by adding a special constructor, see Axis concept for details.

decltype(auto) `Axis &&

any axis instance

` Returns reference to metadata of an axis.

If the expression x.metadata() for an axis instance `x` (maybe const) is valid, return the result. Otherwise, return a reference to a static instance of`boost::histogram::axis::null_type`.

constexpr unsigned `const Axis &

any axis instance

` Returns axis options as unsigned integer.

See `get_options` for details.

constexpr bool `const Axis &

any axis instance

` Returns true if axis is ordered or false.

See `is_ordered` for details.

constexpr unsigned int `const Axis &

any axis instance

` Return axis rank (how many arguments it processes).

std::pair< index_type, index_type > `Axis &

any axis instance

` `const U &

argument to be passed to `update` or`index` method

` Returns pair of axis index and shift for the value argument.

Throws `std::invalid_argument` if the value argument is not implicitly convertible to the argument expected by the`index` method. If the result of boost::histogram::axis::traits::get_options<decltype(axis)> has the growth flag set, call`update` method with the argument and return the result. Otherwise, call`index` and return the pair of the result and a zero shift.

decltype(auto) `const Axis &

any axis instance

` `real_index_type

floating point axis index

` Returns axis value for index.

If the axis has no `value` method, throw std::runtime_error. If the method exists and accepts a floating point index, pass the index and return the result. If the method exists but accepts only integer indices, cast the floating point index to int, pass this index and return the result.

Result

requested return type

axis type

const Axis &

any axis instance

real_index_type

floating point axis index

Returns axis value for index if it is convertible to target type or throws.

Like boost::histogram::axis::traits::value, but converts the result into the requested return type. If the conversion is not possible, throws std::runtime_error.

axis type.

Value type for axis type.

Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and returns the value type.

The value type is deduced from the argument of the `Axis::index` method. Const references are decayed to the their value types, for example, the type deduced for`Axis::index(const int&)` is`int`.

The deduction always succeeds if the axis type models the Axis concept correctly. Errors come from violations of the concept, in particular, an index method that is templated or overloaded is not allowed.

decltype(auto) `const Axis &

any axis instance

` `index_type

bin index

` Returns bin width at axis index.

If the axis has no `value` method, throw std::runtime_error. If the method exists and accepts a floating point index, return the result of`axis.value(index + 1) - axis.value(index)`. If the method exists but accepts only integer indices, return 0.

Result `const Axis &

any axis instance

` `index_type

bin index

` Returns bin width at axis index.

Like boost::histogram::axis::traits::width, but converts the result into the requested return type. If the conversion is not possible, throw std::runtime_error.

input value type, must be floating point.

type to store meta data.

see boost::histogram::axis::option (all values allowed).

allocator to use for dynamic memory management.

boost::histogram::axis::iterator_mixin< variable< Value, MetaData, Options, Allocator > >
metadata_base_t< MetaData >
Axis for non-equidistant bins on the real line.

Binning is a O(log(N)) operation. If speed matters and the problem domain allows it, prefer a regular axis, possibly with a transform.

index_type `value_type` Return index for value argument.
std::pair< index_type, index_type > `value_type`
value_type `real_index_type` Return value for fractional index argument.
auto `index_type` Return bin for index argument.
index_type Returns the number of bins, without over- or underflow.
bool `const `variable`< V, M, O, A > &`
bool `const `variable`< V, M, O, A > &`
auto Return allocator instance.
void `Archive &` `unsigned`
allocator_type
It

begin of edge sequence.

It

end of edge sequence.

metadata_type
{}

description of the axis.

allocator_type
{}

allocator instance to use.

Construct from iterator range of bin edges.

const U &

iterable range of bin edges.

metadata_type
{}

description of the axis.

allocator_type
{}

allocator instance to use.

Construct variable axis from iterable range of bin edges.

std::initializer_list< U >

`std::initializer_list` of bin edges.

metadata_type
{}

description of the axis.

allocator_type
{}

allocator instance to use.

Construct variable axis from initializer list of bin edges.

const `variable` &
index_type
index_type
unsigned
Constructor used by algorithm::reduce to shrink and rebin (not for users).
constexpr unsigned Returns the options.
decltype(auto) class... ``variant`< Us... > &` Return reference to T, throws std::runtime_error if type does not match.
decltype(auto) class... ``variant`< Us... > &&` Return movable reference to T, throws unspecified exception if type does not match.
decltype(auto) class... `const `variant`< Us... > &` Return const reference to T, throws unspecified exception if type does not match.
auto class... ``variant`< Us... > *` Returns pointer to T in variant or null pointer if type does not match.
auto class... `const `variant`< Us... > *` Returns pointer to const T in variant or null pointer if type does not match.
bool class...class... `const `variant`< Us... > &` `const `variant`< Ts... > &` The negation of operator==.
bool class... `const `variant`< Us... > &` `const T &` The negation of operator==.
bool class... `const T &` `const `variant`< Us... > &` The negation of operator==.
bool class...class... `const `variant`< Us... > &` `const `variant`< Vs... > &` Compare two variants.

Return true if the variants point to the same concrete axis type and the types compare equal. Otherwise return false.

bool class... `const `variant`< Us... > &` `const T &` Compare variant with a concrete axis type.

Return true if the variant point to the same concrete axis type and the types compare equal. Otherwise return false.

class...
boost::histogram::axis::iterator_mixin< variant< Ts... > >
Polymorphic axis type.
index_type Return size of axis.
unsigned Return options of axis or option::none_t if axis has no options.
bool Returns true if the axis is inclusive or false.
bool Returns true if the axis is ordered or false.
bool Returns true if the axis is continuous or false.
metadata_type & Return reference to const metadata or instance of `null_type` if axis has no metadata.
metadata_type & Return reference to metadata or instance of `null_type` if axis has no metadata.
index_type `const U &` Return index for value argument.

Throws std::invalid_argument if axis has incompatible call signature.

double `real_index_type` Return value for index argument.

Only works for axes with value method that returns something convertible to double and will throw a runtime_error otherwise, see axis::traits::value().

auto `index_type` Return bin for index argument.

Only works for axes with value method that returns something convertible to double and will throw a runtime_error otherwise, see axis::traits::value().

void `Archive &` `unsigned`
const `variant` &
`variant` & `const `variant` &`
variant
&&
`variant` & ``variant` &&`
T &&
`variant` & `T &&`
class...
const `variant`< Us... > &
`variant` & class... `const `variant`< Us... > &`
decltype(auto) class... `Visitor &&` ``variant`< Us... > &` Apply visitor to variant (reference).
decltype(auto) class... `Visitor &&` ``variant`< Us... > &&` Apply visitor to variant (movable reference).
decltype(auto) class... `Visitor &&` `const `variant`< Us... > &` Apply visitor to variant (const reference).