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
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 and make_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 unsignedNumber of axes (dimensions). std::size_tTotal number of bins (including underflow/overflow). voidReset all bins to default initialized values. decltype(auto)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)unsignedGet N-th axis with run-time number. Prefer the version that accepts a compile-time number, if you can use it. autoUnary &&Apply unary functor/function to each axis. iteratorconst 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 weightAn 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.SamplesIf 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 argumentsIf 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. iteratorconst std::tuple< Ts... > &Fill histogram with values, an optional weight, and/or a sample from a std::tuple. voidconst 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 over a contiguous sequence of values or 3) a variant of 1) and 2). Sub-iterables must have the same length.Warning: std::vector<bool> is not a contiguous sequence over boolean values because of the infamous vector specialization for booleans. It cannot be used as an argument, but any truely contiguous sequence of boolean values can (std::array<bool, N> or std::valarray<bool>, for example).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. voidconst Iterable &iterable of values. const weight_type< T > &single weight or an iterable of weights. Fill histogram with several values and weights at once. voidconst weight_type< T > &single weight or an iterable of weights. const Iterable &iterable of values. Fill histogram with several values and weights at once. voidconst 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. voidconst sample_type< T > &single sample or an iterable of samples. const Iterable &iterable of values. Fill histogram with several values and samples at once. voidconst Iterable &const weight_type< T > &const sample_type< std::tuple< Ts... >> & voidconst sample_type< T > &const weight_type< U > &const Iterable & voidconst weight_type< T > &const sample_type< U > &const Iterable & voidconst Iterable &const sample_type< T > &const weight_type< U > & decltype(auto)axis::index_typeindex 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)axis::index_typeIs...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_typeAccess value at index (for rank = 1). decltype(auto)axis::index_typeAccess 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). boolconst histogram< A, S > &Equality operator, tests equality for all axes and the storage. boolconst 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 doubleMultiply all values with a scalar. This operator is only available if the value_type supports operator*=. histogram &const doubleDivide all values by a scalar. This operator is only available if operator*= is available. iteratorReturn value iterator to the beginning of the histogram. iteratorReturn value iterator to the end in the histogram. const_iteratorReturn value iterator to the beginning of the histogram (read-only). const_iteratorReturn value iterator to the end in the histogram (read-only). const_iteratorReturn value iterator to the beginning of the histogram (read-only). const_iteratorReturn value iterator to the end in the histogram (read-only). voidArchive &unsigned histogram< A, S > && const histogram< A, S > & histogram &histogram< A, S > && histogram &const histogram< A, S > & A &&Storage Axes As &&... autoconst 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. autoconst 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+. autoconst 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+. autoconst 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+. autoconst histogram< A, S > &doubleMultiply 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. autodoubleconst 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. autoconst histogram< A, S > &doubleDivide 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.
Includes all accumulator headers of the Boost.Histogram library. Extra header not automatically included: boost/histogram/accumulators/ostream.hpp
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_referenceIncrement count by value. count &const count &Add another count. count &const_referenceScale by value. boolconst count & boolconst count & value_typeReturn count. value_type voidArchive &unsigned count &const count & countconst count & count &const count & countconst count & boolconst count & boolconst count & boolconst count & boolconst count & const_referenceInitialize count to value and allow implicit conversion. const count< T, B > &Allow implicit conversion from other count. constexpr bool
Accumulate boolean samples and compute the fraction of true samples. This accumulator should be used to calculate the efficiency or success fraction of a random process as a function of process parameters. It returns the fraction of successes, the variance of this fraction, and a two-sided confidence interval with 68.3 % confidence level for this fraction.There is no unique way to compute an interval for a success fraction. This class returns the Wilson score interval, because it is widely recommended in the literature for general use. More interval computers can be found in boost/histogram/utility, which can be used to compute intervals for other confidence levels. ValueType const value_type & typename std::conditional< std::is_floating_point< value_type >::value, value_type, double >::type typename utility::wilson_interval< real_type >::interval_type voidboolInsert boolean sample x. fraction &const fraction &Add another accumulator. const_referenceReturn number of boolean samples that were true. const_referenceReturn number of boolean samples that were false. value_typeReturn total number of boolean samples. real_typeReturn success fraction of boolean samples. real_typeReturn variance of the success fraction. interval_typeReturn standard interval with 68.3 % confidence level (Wilson score interval). boolconst fraction & boolconst fraction & voidArchive &unsigned const_referenceconst_referenceInitialize to external successes and failures. const fraction< T > &Allow implicit conversion from fraction with a different value type.
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 & voidconst_referenceInsert sample x. voidconst weight_type< value_type > &const_referenceInsert sample x with weight w. mean &const mean &Add another mean accumulator. mean &const_referenceScale by value. This acts as if all samples were scaled by the value. boolconst mean & boolconst mean & const_referenceReturn 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_referenceReturn mean value of accumulated samples. The result is undefined, if count() < 1. value_typeReturn variance of accumulated samples. The result is undefined, if count() < 2. voidArchive &unsigned const mean< T > &Allow implicit conversion from mean<T>. const_referenceconst_referenceconst_referenceInitialize to external count, mean, and variance.
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_referenceIncrement sum by value. sum &const sum &Add another sum. sum &const_referenceScale by value. boolconst sum & boolconst sum & value_typeReturn value of the sum. const_referenceReturn large part of the sum. const_referenceReturn small part of the sum. value_type voidArchive &unsigned sum &const sum & sumconst sum & sum &const sum & sumconst sum & boolconst sum & boolconst sum & boolconst sum & boolconst sum & const_referenceInitialize sum to value and allow implicit conversion. const sum< T > &Allow implicit conversion from sum<T> const_referenceconst_referenceInitialize sum explicitly with large and small parts.
autoconst histogram< A, S > &Const reference to the histogram. const coveragecoverage::allIterate 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
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 & voidconst_referenceInsert sample x. voidconst weight_type< value_type > &const_referenceInsert sample x with weight w. weighted_mean &const weighted_mean &Add another weighted_mean. weighted_mean &const_referenceScale by value. This acts as if all samples were scaled by the value. boolconst weighted_mean & boolconst weighted_mean & const_referenceReturn sum of weights. const_referenceReturn sum of weights squared (variance of weight distribution). value_typeReturn 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_referenceReturn mean value of accumulated weighted samples. The result is undefined, if count() == 0. value_typeReturn variance of accumulated weighted samples. The result is undefined, if count() == 0 or count() == 1. voidArchive &unsigned const weighted_mean< T > &Allow implicit conversion from other weighted_means. const_referenceconst_referenceconst_referenceconst_referenceInitialize 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 weighted_sum &Divide by another weighted sum. weighted_sum &const_referenceScale by value. boolconst weighted_sum & boolconst weighted_sum & const_referenceReturn value of the sum. const_referenceReturn estimated variance of the sum. const_reference voidArchive &unsigned const_referenceInitialize sum to value and allow implicit conversion. const weighted_sum< T > &Allow implicit conversion from sum<T> const_referenceconst_referenceInitialize sum to value and variance.
Includes all algorithm headers of the Boost.Histogram library.
autoconst histogram< A, S > &coverageCheck 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.
autoconst 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. autoconst 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.
Whether to behave like shrink or crop regarding removed bins. 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_commandunsignedwhich axis to operate on. doublebin which contains lower is first to be kept. doublebin 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_commanddoublebin which contains lower is first to be kept. doublebin 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_commandunsignedwhich axis to operate on. doublebin which contains lower is first to be kept. doublebin 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_commanddoublebin which contains lower is first to be kept. doublebin 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_commandunsignedwhich axis to operate on. axis::index_typefirst index that should be kept. axis::index_typeone past the last index that should be kept. slice_modeslice_mode::shrinkwhether 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_commandaxis::index_typefirst index that should be kept. axis::index_typeone past the last index that should be kept. slice_modeslice_mode::shrinkwhether 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_commandunsignedwhich axis to operate on. unsignedhow 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_commandunsignedhow 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. reduce_commandunsignedwhich axis to operate on. doublelowest bound that should be kept. doublehighest bound that should be kept. If upper is inside bin interval, the whole interval is removed. unsignedhow 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_commanddoublelowest bound that should be kept. doublehighest bound that should be kept. If upper is inside bin interval, the whole interval is removed. unsignedhow 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_commandunsignedwhich axis to operate on. doublelowest bound that should be kept. doublehighest bound that should be kept. If upper is inside bin interval, the whole interval is removed. unsignedhow 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_commanddoublelowest bound that should be kept. doublehighest bound that should be kept. If upper is inside bin interval, the whole interval is removed. unsignedhow 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_commandunsignedwhich axis to operate on. axis::index_typefirst index that should be kept. axis::index_typeone past the last index that should be kept. unsignedhow many adjacent bins to merge into one. slice_modeslice_mode::shrinkslice 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_commandaxis::index_typefirst index that should be kept. axis::index_typeone past the last index that should be kept. unsignedhow many adjacent bins to merge into one. slice_modeslice_mode::shrinkslice 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. Histogramconst 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. Histogramconst 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.
Includes all axis headers of the Boost.Histogram library. Extra header not automatically included: boost/histogram/axis/ostream.hpp
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_typevalue_typeReturn index for value argument. value_typeindex_typeReturn value for index argument. value_typeindex_typeReturn bin for index argument. index_typeReturns the number of bins, without over- or underflow. boolconst boolean< M > & boolconst boolean< M > & voidArchive &unsigned metadata_type{}description of the axis. Construct a boolean axis. constexpr boolWhether the axis is inclusive (see axis::traits::is_inclusive). constexpr unsignedReturns the options.
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_typeconst 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. autoindex_typeReturn value for index argument. Throws std::out_of_range if the index is out of bounds. decltype(auto)index_typeReturn value for index argument; alias for value(...). index_typeReturns the number of bins, without over- or underflow. boolconst category< V, M, O, A > & boolconst category< V, M, O, A > & allocator_type voidArchive &unsigned allocator_type Itbegin of category range of unique values. Itend of category range of unique values. metadata_type{}description of the axis (optional). options_type{}see boost::histogram::axis::option (optional). allocator_type{}allocator instance to use (optional). Construct from iterator range of unique values. ItItmetadata_typeallocator_type const C &sequence of unique values. metadata_type{}description of the axis. options_type{}see boost::histogram::axis::option (optional). allocator_type{}allocator instance to use. Construct axis from iterable sequence of unique values. const C &metadata_typeallocator_type std::initializer_list< U >std::initializer_list of unique values. metadata_type{}description of the axis. options_type{}see boost::histogram::axis::option (optional). allocator_type{}allocator instance to use. Construct axis from an initializer list of unique values. std::initializer_list< U >metadata_typeallocator_type const category &index_typeindex_typeunsignedConstructor used by algorithm::reduce to shrink and rebin (not for users). constexpr unsignedReturns the options. constexpr boolWhether the axis is inclusive (see axis::traits::is_inclusive). constexpr boolIndicate that the axis is not ordered.
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_typevalue_typeReturn index for value argument. autovalue_typeReturns index and shift (if axis has grown) for the passed argument. value_typelocal_index_typeReturn value for index argument. decltype(auto)index_typeReturn bin for index argument. index_typeReturns the number of bins, without over- or underflow. boolconst integer< V, M, O > & boolconst integer< V, M, O > & voidArchive &unsigned value_typefirst integer of covered range. value_typeone past last integer of covered range. metadata_type{}description of the axis (optional). options_type{}see boost::histogram::axis::option (optional). Construct over semi-open integer interval [start, stop). const integer &index_typeindex_typeunsignedConstructor used by algorithm::reduce to shrink and rebin. constexpr unsignedReturns the options. constexpr boolWhether the axis is inclusive (see axis::traits::is_inclusive). index_typestd::false_typeBdouble index_typestd::true_typestd::false_typedouble index_typestd::true_typestd::true_typedouble
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. boolconst BinType & boolconst BinType & const Axis &index_type Axis &&index_type
typename iterator::iterator_adaptor_::reference referenceReturn current bin object. const Axis &index_typeMake iterator from axis and index. Uses CRTP to inject iterator logic into Derived. iterator< Derived > std::reverse_iterator< const_iterator > const_iteratorBin iterator to beginning of the axis (read-only). const_iteratorBin iterator to the end of the axis (read-only). const_reverse_iteratorReverse bin iterator to the last entry of the axis (read-only). const_reverse_iteratorReverse bin iterator to the end (read-only).
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. Single option flag. std::integral_constant< unsigned, Bits >Holder of axis options. constexpr autobitset< B >Returns true if all option flags in the argument are set and false otherwise. All options off. bitset< 0 > Axis has an underflow bin. Mutually exclusive with circular. bit< 0 > Axis has overflow bin. bit< 1 > Axis is circular. Mutually exclusive with growth and underflow. bit< 2 > Axis can grow. Mutually exclusive with circular. bit< 3 > constexpr none_tInstance of none_t. constexpr underflow_tInstance of underflow_t. constexpr overflow_tInstance of overflow_t. constexpr circular_tInstance of circular_t. constexpr growth_tInstance of growth_t. constexpr autobitset< B1 >bitset< B2 >Set union of the axis option arguments. constexpr autobitset< B1 >bitset< B2 >Set intersection of the option arguments. constexpr autobitset< B1 >bitset< B2 >Set difference of the option arguments.
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_typeReturn lower edge of bin. value_typeReturn upper edge of bin. value_typeReturn center of bin. value_typeReturn width of bin. boolconst BinType & boolconst BinType & boolReturn true if bin is discrete. value_typevalue_type boolconst polymorphic_bin &int autoconst BinType &decltype(rhs.lower(), 0) boolconst BinType &float
Regular axis with circular option already set. 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.If the axis has an overflow bin (the default), a value on the upper edge of the last bin is put in the overflow bin. The axis range represents a semi-open interval.If the overflow bin is deactivated, then a value on the upper edge of the last bin is still counted towards the last bin. The axis range represents a closed interval. This is the desired behavior for random numbers drawn from a bounded interval, which is usually closed. const transform_type &Return instance of the transform type. index_typevalue_typeReturn index for value argument. std::pair< index_type, index_type >value_typeReturns index and shift (if axis has grown) for the passed argument. value_typereal_index_typeReturn value for fractional index argument. decltype(auto)index_typeReturn bin for index argument. index_typeReturns the number of bins, without over- or underflow. boolconst regular< V, T, M, O > & boolconst regular< V, T, M, O > & voidArchive &unsigned transform_typetransform instance to use. unsignednumber of bins. value_typelow edge of first bin. value_typehigh edge of last bin. metadata_type{}description of the axis (optional). options_type{}see boost::histogram::axis::option (optional). Construct n bins over real transformed range [start, stop). unsignednumber of bins. value_typelow edge of first bin. value_typehigh edge of last bin. metadata_type{}description of the axis (optional). options_type{}see boost::histogram::axis::option (optional). Construct n bins over real range [start, stop). transform_typetransform instance to use. step_type< T >width of a single bin. value_typelow edge of first bin. value_typeupper limit of high edge of last bin (see below). metadata_type{}description of the axis (optional). options_type{}see boost::histogram::axis::option (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_typelow edge of first bin. value_typeupper limit of high edge of last bin (see below). metadata_type{}description of the axis (optional). options_type{}see boost::histogram::axis::option (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_typeindex_typeunsignedConstructor used by algorithm::reduce to shrink and rebin (not for users). constexpr unsignedReturns the options. Identity transform for equidistant bins. TT &&Pass-through. TT &&Pass-through. voidArchive &unsigned Log transform for equidistant bins in log-space. TTReturns log(x) of external value x. TTReturns exp(x) for internal value x. voidArchive &unsigned Pow transform for equidistant bins in pow-space. doublepower index autoTReturns pow(x, power) of external value x. autoTReturns pow(x, 1/power) of external value x. boolconst pow & voidArchive &unsigned doubleMake transform with index p. Sqrt transform for equidistant bins in sqrt-space. TTReturns sqrt(x) of external value x. TTReturns x^2 of internal value x. voidArchive &unsigned step_type< T >THelper function to mark argument as step size.
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. 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). 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. 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. 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. 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. constexpr unsignedconst Axis &any axis instance Returns axis options as unsigned integer. See get_options for details. unsignedconst variant< Ts... > & constexpr boolconst Axis &any axis instance Returns true if axis is inclusive or false. See is_inclusive for details. boolconst variant< Ts... > & constexpr boolconst Axis &any axis instance Returns true if axis is ordered or false. See is_ordered for details. boolconst variant< Ts... > & constexpr boolconst Axis &any axis instance Returns true if axis is continuous or false. See is_continuous for details. boolconst variant< Ts... > & index_typeconst Axis &any axis instance Returns axis size plus any extra bins for under- and overflow. 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. decltype(auto)const Axis &any axis instance real_index_typefloating 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. Resultconst Axis &any axis instance real_index_typefloating 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::index_typeconst 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. axis::index_typeconst variant< Ts... > &const U & constexpr unsigned intconst Axis &any axis instance Return axis rank (how many arguments it processes). unsigned intconst axis::variant< Ts... > & 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. std::pair< index_type, index_type >variant< Ts... > &const U & decltype(auto)const Axis &any axis instance index_typebin 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. Resultconst Axis &any axis instance index_typebin 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.
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.If the axis has an overflow bin (the default), a value on the upper edge of the last bin is put in the overflow bin. The axis range represents a semi-open interval.If the overflow bin is deactivated, then a value on the upper edge of the last bin is still counted towards the last bin. The axis range represents a closed interval. This is the desired behavior for random numbers drawn from a bounded interval, which is usually closed. index_typevalue_typeReturn index for value argument. std::pair< index_type, index_type >value_type value_typereal_index_typeReturn value for fractional index argument. autoindex_typeReturn bin for index argument. index_typeReturns the number of bins, without over- or underflow. boolconst variable< V, M, O, A > & boolconst variable< V, M, O, A > & autoReturn allocator instance. voidArchive &unsigned allocator_type Itbegin of edge sequence. Itend of edge sequence. metadata_type{}description of the axis (optional). options_type{}see boost::histogram::axis::option (optional). allocator_type{}allocator instance to use (optional). Construct from iterator range of bin edges. ItItmetadata_typeallocator_type const U &iterable range of bin edges. metadata_type{}description of the axis (optional). options_type{}see boost::histogram::axis::option (optional). allocator_type{}allocator instance to use (optional). Construct variable axis from iterable range of bin edges. const U &metadata_typeallocator_type std::initializer_list< U >std::initializer_list of bin edges. metadata_type{}description of the axis (optional). options_type{}see boost::histogram::axis::option (optional). allocator_type{}allocator instance to use (optional). Construct variable axis from initializer list of bin edges. std::initializer_list< U >metadata_typeallocator_type const variable &index_typeindex_typeunsignedConstructor used by algorithm::reduce to shrink and rebin (not for users). constexpr unsignedReturns the options.
boost::histogram::axis::iterator_mixin< variant< Ts... > >Polymorphic axis type. index_typeReturn size of axis. unsignedReturn options of axis or option::none_t if axis has no options. boolReturns true if the axis is inclusive or false. boolReturns true if the axis is ordered or false. boolReturns 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_typeconst U &Return index for value argument. Throws std::invalid_argument if axis has incompatible call signature. doublereal_index_typeReturn 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(). autoindex_typeReturn 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(). voidArchive &unsigned const variant & variant &const variant & variant && variant &variant && T && variant &T && const variant< Us... > & variant &const variant< Us... > & decltype(auto)Visitor &&variant< Us... > &Apply visitor to variant (reference). decltype(auto)Visitor &&variant< Us... > &&Apply visitor to variant (movable reference). decltype(auto)Visitor &&const variant< Us... > &Apply visitor to variant (const reference). autovariant< Us... > *Returns pointer to T in variant or null pointer if type does not match. autoconst variant< Us... > *Returns pointer to const T in variant or null pointer if type does not match. decltype(auto)variant< Us... > &Return reference to T, throws std::runtime_error if type does not match. decltype(auto)variant< Us... > &&Return movable reference to T, throws unspecified exception if type does not match. decltype(auto)const variant< Us... > &Return const reference to T, throws unspecified exception if type does not match. decltype(auto)Visitor &&T && decltype(auto)U && autoU * autoconst U * boolconst 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. boolconst 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. boolconst T &const variant< Us... > & boolconst variant< Us... > &const variant< Ts... > &The negation of operator==. boolconst variant< Us... > &const T &The negation of operator==. boolconst T &const variant< Us... > &The negation of operator==.
Forward declarations, tag types and type aliases. Empty metadata type. voidArchive &unsigned Integral type for axis indices. int Real type for axis indices. double Another alias for an empty metadata type. null_type boost::histogram::utility::binomial_proportion_interval< ValueType >Clopper-Pearson interval. This is the classic frequentist interval obtained with the Neyman construction. It is therefore often called the 'exact' interval. It is guaranteed to have at least the requested confidence level for all values of the fraction.The interval is wider than others that produce coverage closer to the expected confidence level over a random ensemble of factions. The Clopper-Pearson interval essentially always overcovers for such a random ensemble, which is undesirable in practice. The Clopper-Pearson interval is recommended when it is important to be conservative, but the Wilson interval should be preferred in most applications.C. Clopper, E.S. Pearson (1934), Biometrika 26 (4): 404-413. doi:10.1093/biomet/26.4.404. interval_typevalue_typeNumber of successful trials. value_typeNumber of failed trials. Compute interval for given number of successes and failures. confidence_leveldeviation{1}Confidence level for the interval. The default value produces a confidence level of 68 % equivalent to one standard deviation. Both deviation and confidence_level objects can be used to initialize the interval. Construct Clopper-Pearson interval computer. boost::histogram::utility::binomial_proportion_interval< ValueType >Jeffreys interval. This is the Bayesian credible interval with a Jeffreys prior. Although it has a Bayesian derivation, it has good coverage. The interval boundaries are close to the Wilson interval. A special property of this interval is that it is equal-tailed; the probability of the true value to be above or below the interval is approximately equal.To avoid coverage probability tending to zero when the fraction approaches 0 or 1, this implementation uses a modification described in section 4.1.2 of the paper by L.D. Brown, T.T. Cai, A. DasGupta, Statistical Science 16 (2001) 101-133, doi:10.1214/ss/1009213286. interval_typevalue_typeNumber of successful trials. value_typeNumber of failed trials. Compute interval for given number of successes and failures. confidence_leveldeviation{1}Confidence level for the interval. The default value produces a confidence level of 68 % equivalent to one standard deviation. Both deviation and confidence_level objects can be used to initialize the interval. Construct Jeffreys interval computer. boost::histogram::utility::binomial_proportion_interval< ValueType >Wald interval or normal approximation interval. The Wald interval is a symmetric interval. It is simple to compute, but has poor statistical properties and is universally rejected by statisticians. It should always be replaced by another iternal, for example, the Wilson interval.The Wald interval can be derived easily using the plug-in estimate of the variance for the binomial distribution, which is likely a reason for its omnipresence. Without further insight into statistical theory, it is not obvious that this derivation is flawed and that better alternatives exist.The Wald interval undercovers on average. It is unsuitable when the sample size is small or when the fraction is close to 0 or 1. e. Its limits are not naturally bounded by 0 or 1. It produces empty intervals if the number of successes or failures is zero.For a critique of the Wald interval, see (a selection):L.D. Brown, T.T. Cai, A. DasGupta, Statistical Science 16 (2001) 101-133. R. D. Cousins, K. E. Hymes, J. Tucker, Nucl. Instrum. Meth. A 612 (2010) 388-398. interval_typevalue_typeNumber of successful trials. value_typeNumber of failed trials. Compute interval for given number of successes and failures. deviationdeviation{1.0}Number of standard deviations for the interval. The default value 1 corresponds to a confidence level of 68 %. Both deviation and confidence_level objects can be used to initialize the interval. Construct Wald interval computer. boost::histogram::utility::binomial_proportion_interval< ValueType >Wilson interval. The Wilson score interval is simple to compute, has good coverage. Intervals are automatically bounded between 0 and 1 and never empty. The interval is asymmetric.Wilson, E. B. (1927). "Probable inference, the law of succession, and statistical inference". Journal of the American Statistical Association. 22 (158): 209-212. doi:10.1080/01621459.1927.10502953. JSTOR 2276774.The coverage probability for a random ensemble of fractions is close to the nominal value. Unlike the Clopper-Pearson interval, the Wilson score interval is not conservative. For some values of the fractions, the interval undercovers and overcovers for neighboring values. This is a shared property of all alternatives to the Clopper-Pearson interval.The Wilson score intervals is widely recommended for general use in the literature. For a review of the literature, see R. D. Cousins, K. E. Hymes, J. Tucker, Nucl. Instrum. Meth. A 612 (2010) 388-398. interval_typevalue_typeNumber of successful trials. value_typeNumber of failed trials. Compute interval for given number of successes and failures. deviationdeviation{1.0}Number of standard deviations for the interval. The default value 1 corresponds to a confidence level of 68 %. Both deviation and confidence_level objects can be used to initialize the interval. Construct Wilson interval computer. Vector-like storage for fast zero-overhead access to cells. storage_adaptor< std::vector< T, A > > Default storage, optimized for unweighted histograms. unlimited_storage<> Dense storage which tracks sums of weights and a variance estimate. dense_storage< accumulators::weighted_sum<> > Dense storage which tracks means of samples in each cell. dense_storage< accumulators::mean<> > Dense storage which tracks means of weighted samples in each cell. dense_storage< accumulators::weighted_mean<> >
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. implementation detail const_reference index_pointer const axis::index_type & const_iterator const_iterator std::size_t const_referenceunsigned const_referenceunsigned index_pointerindex_pointerimplementation detail value_referenceReturns the cell reference. value_referenceReturns the cell reference. value_iteratorAccess fields and methods of the cell object. axis::index_typeunsigned0axis dimension. Access current index. index_viewAccess indices as an iterable range. decltype(auto)std::integral_constant< unsigned, N >{}Access current bin. decltype(auto)unsignedaxis dimension. Access current bin. doubleComputes 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. boolconst accessor & boolconst accessor & boolconst accessor & boolconst accessor & boolconst accessor & boolconst accessor & boolconst U & boolconst U & boolconst U & boolconst U & boolconst U & boolconst U & value_type accessor &const accessor & accessor &const T & iterator & const accessor & implementation detail axis::index_type axis::index_type axis::index_type std::size_t std::size_t std::array< index_data, buffer_size >std::array< index_data, buffer_size > index_data * const index_data * histogram_type * unsigned pointer const_pointer pointer const_pointer histogram_type * reference reference * typename indexed_range::value_type accessor pointer_proxy std::ptrdiff_t std::forward_iterator_tag reference pointer iterator & iteratorint boolconst iterator & boolconst iterator & boolconst value_iterator & boolconst value_iterator & std::size_t value_iteratorhistogram_type & implementation detail std::conditional_t< std::is_const< histogram_type >::value, typename histogram_type::const_iterator, typename histogram_type::iterator > implementation detail typename std::iterator_traits< value_iterator >::reference implementation detail typename std::iterator_traits< value_iterator >::value_type iterator iterator histogram_type &coverage histogram_type &Iterable && autohistogram_type &coverage 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. autoHistogram &&Reference to the histogram. coveragecoverage::innerIterate 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 autoHistogram &&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
autoSuffix operator to generate literal compile-time numbers, 0_c, 12_c, etc.
Collection of factory functions to conveniently create histograms. autoStorage &&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. autoAxis &&First axis instance. Axes &&...Other axis instances. Make histogram from compile-time axis configuration and default storage. autoAxis &&First axis instance. Axes &&...Other axis instances. Make histogram from compile-time axis configuration and weight-counting storage. autoStorage &&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. autoIterable &&Iterable range of axis objects. Make histogram from iterable range and default storage. autoIterable &&Iterable range of axis objects. Make histogram from iterable range and weight-counting storage. autoStorage &&Storage or container with standard interface (any vector, array, or map). IteratorIterator to range of axis objects. IteratorIterator to range of axis objects. Make histogram from iterator interval and custom storage. autoIteratorIterator to range of axis objects. IteratorIterator to range of axis objects. Make histogram from iterator interval and default storage. autoIteratorIterator to range of axis objects. IteratorIterator 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. autoAxis &&First axis instance. Axes &&...Other axis instances. Make profle from compile-time axis configuration. autoAxis &&First axis instance. Axes &&...Other axis instances. Make profle from compile-time axis configuration which accepts weights. autoIterable &&Iterable range of axis objects. Make profile from iterable range. autoIterable &&Iterable range of axis objects. Make profile from iterable range which accepts weights. autoIteratorIterator to range of axis objects. IteratorIterator to range of axis objects. Make profile from iterator interval. autoIteratorIterator to range of axis objects. IteratorIterator to range of axis objects. Make profile from iterator interval which accepts weights.
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_indexstd::size_t constexpr std::size_t iterator iterator const_iterator const_iterator axis::index_typeIs... const std::tuple< axis::index_type, Is... > & const Iterable & priv_tag const T &mp11::index_sequence< Is... > static_cast< std::size_t >(-1)axis::index_type value_type * const value_type * multi_indexstd::size_t iterator iterator const_iterator const_iterator std::size_t axis::index_typeIs... const std::tuple< axis::index_type, Is... > & const Iterable & priv_tagstd::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.
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 include boost/histogram/ostream.hpp.
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 include boost/histogram/ostream.hpp.
Sample holder and type envelope. You should not construct these directly, use the sample() helper function. T autoTs &&...arguments to be forwarded to the accumulator. Helper function to mark arguments as sample.
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. boolconst U & voidArchive &unsigned storage_adaptor && const storage_adaptor & storage_adaptor &storage_adaptor && storage_adaptor &const storage_adaptor & 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. voiddouble *buffer_type &std::size_tconst U & voidlarge_int *buffer_type &std::size_tconst large_int & voidT *buffer_type &std::size_tconst U & voidstd::false_typeT *buffer_type &std::size_tconst U & voidstd::false_typeT *buffer_type &std::size_tconst large_int & voidstd::true_typeT *buffer_type &std::size_tconst U & voidstd::false_typeT *buffer_type &std::size_tconst U & voidstd::true_typeT *buffer_type &std::size_tconst U & voidstd::true_typelarge_int *buffer_type &std::size_tconst U & mp11::mp_list< U8, U16, U32, U64, large_int, double > allocator_type std::size_t unsigned void * constexpr unsigned decltype(auto)F &&Ts &&... void voidstd::size_t voidstd::size_tU const allocator_type &{} buffer_type && buffer_type &buffer_type && const buffer_type & buffer_type &const buffer_type & implementation detail double boolconst const_reference & boolconst const_reference & unspecifiedconst U & unspecifiedconst U & unspecifiedconst U & buffer_type &std::size_t const const_reference & const_reference &const const_reference & const_reference &const_reference && boolconst const_reference & boolconst U & voidT *buffer_type &std::size_t voidlarge_int *buffer_type &std::size_t voiddouble *buffer_type &std::size_t Reference const iterator_impl< V, R > & buffer_type *std::size_t voidT *buffer_type &const double voiddouble *buffer_type &const double voidT *buffer_type &std::size_tconst double voiddouble *buffer_type &std::size_tconst double boost::histogram::unlimited_storage< Allocator >::const_referenceimplementation detail boolconst reference & boolconst reference & unspecifiedconst U & unspecifiedconst U & unspecifiedconst U & reference &const const_reference & unspecifiedconst U & reference &const double reference &const double reference &const double reference & buffer_type &std::size_t const reference & reference &const reference & reference &const const_reference & unspecifiedconst U & Allocator double unspecified iterator_impl< const value_type, const_reference > iterator_impl< value_type, reference > constexpr bool allocator_type voidstd::size_t std::size_t referencestd::size_t const_referencestd::size_t boolconst unlimited_storage & boolconst Iterable & unlimited_storage &const double iterator iterator const_iterator const_iterator voidArchive &unsigned const allocator_type &{} const unlimited_storage & unlimited_storage &const unlimited_storage & unlimited_storage && unlimited_storage &unlimited_storage && const Iterable & unlimited_storage &const Iterable & std::size_tconst T *const allocator_type &{}implementation detail; used by unit tests, not part of generic storage interface
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)Histogram &histogram. std::integral_constant< unsigned, I >{}Get mutable axis reference with compile-time number. decltype(auto)Histogram &histogram. unsignedaxis 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.
Common base class for interval calculators. ValueType std::pair< value_type, value_type > interval_typevalue_typeNumber of successful trials. value_typeNumber of failed trials. Compute interval for given number of successes and failures. interval_typeconst accumulators::fraction< T > &Fraction accumulator. Compute interval for a fraction accumulator. Confidence level for intervals. Intervals become wider as the deviation value increases. Texplicit conversion to numerical confidence level deviationimplicit conversion to units of standard deviation doubleconstructor from confidence level (a probability) Confidence level in units of deviations for intervals. Intervals become wider as the deviation value increases. The standard deviation corresponds to a value of 1 and corresponds to 68.3 % confidence level. The conversion between confidence level and deviations is based on a two-sided interval on the normal distribution. Texplicit conversion to units of standard deviations confidence_levelimplicit conversion to confidence level doubleconstructor from units of standard deviations
Weight holder and type envelope. You should not construct these directly, use the weight() helper function. TAccess underlying value. weight_type< U >Allow implicit conversions of types when the underlying value type allows them. autoT &&argument to be forward to the histogram. Helper function to mark argument as weight.