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 boost/histogram/display.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 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. unspecifiedconst Arg0 &const Args &...Fill histogram with values, an optional weight, and/or a sample. 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 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 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. 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. Indices...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_typeIndices...Access cell value at integral indices (read-only). decltype(auto)const std::tuple< Indices... > &Access cell value at integral indices stored in std::tuple. decltype(auto)const std::tuple< Indices... > &Access cell value at integral indices stored in std::tuple (read-only). decltype(auto)const Iterable &Access cell value at integral indices stored in iterable. decltype(auto)const Iterable &Access cell value at integral indices stored in iterable (read-only). decltype(auto)const Indices &Access value at index (number for rank = 1, else std::tuple or iterable). decltype(auto)const Indices &Access value at index (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. unspecifiedconst histogram< A, S > &Add values of another histogram. unspecifiedconst histogram< A, S > &Subtract values of another histogram. unspecifiedconst histogram< A, S > &Multiply by values of another histogram. unspecifiedconst histogram< A, S > &Divide by values of another histogram. unspecifiedconst doubleMultiply all values with a scalar. unspecifiedconst doubleMultiply all values with a scalar. unspecifiedconst doubleDivide all values by a scalar. 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
Calculates mean and variance of sample. Uses Welfords's incremental algorithm to improve the numerical stability of mean and variance computation. voidconst RealType & voidconst weight_type< RealType > &const RealType & mean &const mean< T > & mean &const RealType & boolconst mean< T > & boolconst mean< T > & const RealType & const RealType & RealType voidArchive &unsigned const RealType &const RealType &const RealType &
Uses Neumaier algorithm to compute accurate sums. The algorithm uses memory for two floats and is three to five times slower compared to a simple floating point number used 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. sum &Increment sum by one. sum &const RealType &Increment sum by value. sum &const RealType &Scale by value. boolconst sum< T > & boolconst T & const RealType &Return large part of the sum. const RealType &Return small part of the sum. RealType voidArchive &unsigned const RealType &Initialize sum to value. sum &const RealType &Set sum to value.
autoconst histogram< A, S > &Compute the sum over all histogram cells, including underflow/overflow bins. If the value type of the histogram is an integral or floating point type, boost::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+=.Return type is double if the value type of the histogram is integral or floating point, and the original value type otherwise.
std::atomic< T >Thread-safe adaptor for builtin integral and floating point numbers. This adaptor uses std::atomic 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 & voidArchive &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. voidconst RealType & voidconst weight_type< RealType > &const RealType & weighted_mean &const weighted_mean< T > & weighted_mean &const RealType & boolconst weighted_mean< T > & boolconst T & const RealType & const RealType & const RealType & RealType voidArchive &unsigned const RealType &const RealType &const RealType &const RealType &
Holds sum of weights and its variance estimate. weighted_sum &Increment by one. weighted_sum &const T &Increment by value. weighted_sum &const weighted_sum< T > &Added another weighted sum. weighted_sum &const RealType &Scale by value. boolconst RealType & boolconst weighted_sum< T > & boolconst T & const RealType &Return value of the sum. const RealType &Return estimated variance of the sum. T voidArchive &unsigned const RealType & const RealType &const RealType &
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.
unspecified reduce_optionunsignedwhich 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 option to be used in reduce(). To shrink and rebin in one command. Equivalent to passing both the shrink() and the rebin() option for the same axis to reduce. reduce_optionunsignedwhich 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 and rebin option to be used in reduce(). To slice and rebin in one command. Equivalent to passing both the slice() and the rebin() option for the same axis to reduce. reduce_optionunsignedwhich 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 option to be used in reduce(). The shrink is inclusive. 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. reduce_optionunsignedwhich axis to operate on. axis::index_typefirst index that should be kept. axis::index_typeone past the last index that should be kept. Slice option to be used in reduce(). reduce_optionunsignedwhich axis to operate on. unsignedhow many adjacent bins to merge into one. Rebin option to be used in reduce(). reduce_optiondoublelowest 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 option to be used in reduce() (convenience overload for single axis). reduce_optionaxis::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 and rebin option to be used in reduce() (convenience for 1D histograms). reduce_optiondoublelowest bound that should be kept. doublehighest bound that should be kept. If upper is inside bin interval, the whole interval is removed. Shrink option to be used in reduce() (convenience for 1D histograms). reduce_optionaxis::index_typefirst index that should be kept. axis::index_typeone past the last index that should be kept. Slice option to be used in reduce() (convenience for 1D histograms). reduce_optionunsignedhow many adjacent bins to merge into one. Rebin option to be used in reduce() (convenience for 1D histograms). decltype(auto)const Histogram &original histogram. const Iterable &iterable sequence of reduce options, generated by shrink_and_rebin(), slice_and_rebin(), shrink(), slice(), and rebin(). Shrink, slice, and/or rebin axes of a histogram. Returns the reduced copy of the histogram.Shrinking only works with axes that accept double values. Some axis types do not support the reduce operation, for example, the builtin category axis, which is not ordered. Custom axis types must implement a special constructor (see concepts) to be reducible. decltype(auto)const Histogram &original histogram. const reduce_option &reduce option generated by shrink_and_rebin(), shrink(), and rebin(). const Ts &...more reduce options. Shrink, slice, and/or rebin axes of a histogram. Returns the reduced copy of the histogram.Shrinking only works with axes that accept double values. Some axis types do not support the reduce operation, for example, the builtin category axis, which is not ordered. Custom axis types must implement a special constructor (see concepts) to be reducible.
Includes all axis headers of the Boost.Histogram library. Extra header not automatically included: boost/histogram/axis/ostream.hpp
boost::histogram::axis::iterator_mixin< category< Value, MetaData, Options, Allocator > >boost::histogram::axis::metadata_base< 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. autoconst 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. index_typeReturns the number of bins, without over- or underflow. boolconst category< V, M, O, A > & boolconst category< V, M, O, A > & auto voidArchive &unsigned allocator_type Itbegin of category range of unique values. Itend 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. constexpr unsignedReturns the options. constexpr boolWhether the axis is inclusive (see axis::traits::is_inclusive).
boost::histogram::axis::iterator_mixin< integer< Value, MetaData, Options > >boost::histogram::axis::metadata_base< 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. 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_typeint index_typestd::true_typeT
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 &int Axis &&int
decltype(auto)Return current bin object. const Axis &intMake 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).
empty_value< DetailMetadata >Meta data holder with space optimization for empty meta data types. const metadata_base & metadata_base &const metadata_base & metadata_base && metadata_type && metadata_base &metadata_base && metadata_type &Returns reference to metadata. const metadata_type &Returns reference to const metadata. boolconst metadata_base & boolconst metadata_base &
Options for builtin axis types. Options circular and growth are mutually exclusive. Options circular and underflow are mutually exclusive. boost::histogram::axis::option::bitset<(1<< Pos)>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 boolstd::true_typeconst polymorphic_bin & boolstd::true_typeconst BinType & boolstd::false_typeconst BinType &
Regular axis with circular option already set. boost::histogram::axis::iterator_mixin< regular< Value, Transform, MetaData, Options > >boost::histogram::axis::metadata_base< 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_typevalue_typeReturn index for value argument. autovalue_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). 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). 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).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).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.
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. Otherwise it is discrete. 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(). 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. A histogram which consists only of inclusive axes can be filled more efficiently, since 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.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 static_options<Axis> and checks whether the underflow and overflow bits are present. Get static 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, static_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. Get 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. constexpr unsignedconst Axis &any axis instance Returns axis options as unsigned integer. If axis.options() is a valid expression, return the result. Otherwise, return static_options<Axis>::value. unsignedconst variant< Ts... > & constexpr boolconst Axis &any axis instance Returns true if axis is inclusive or false. See static_is_inclusive 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 unsignedconst Axis &any axis instance Return axis rank (how many arguments it processes). unsignedconst 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::static_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 > >boost::histogram::axis::metadata_base< 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_typevalue_typeReturn index for value argument. autovalue_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. 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_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. const 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(). boolconst variant< Us... > &Compare two variants. Return true if the variants point to the same concrete axis type and the types compare equal. Otherwise return false. boolconst 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 &The negation of operator==. 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 *
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 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. begin() may only be called once, calling it a second time returns the end() iterator. 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 & deprecated const_reference 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 axis::index_type std::array< index_data, buffer_size >std::array< index_data, buffer_size > histogram_type * constexpr auto constexpr auto 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 & histogram_type * std::conditional_t< std::is_const< histogram_type >::value, typename histogram_type::const_iterator, typename histogram_type::iterator > typename std::iterator_traits< value_iterator >::reference typename std::iterator_traits< value_iterator >::value_type deprecated iterator iterator iterator histogram_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
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.
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 you 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 you 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 you use your own, include your own implementation instead of this header and do not include boost/histogram/ostream.hpp.
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.
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.