| Home | Libraries | People | FAQ | More

## Reference

### Header <boost/histogram.hpp>

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

### Header <boost/histogram/accumulators.hpp>

Includes all accumulator headers of the Boost.Histogram library.

Extra header not automatically included:

- boost/histogram/accumulators/ostream.hpp

### Header <boost/histogram/algorithm.hpp>

Includes all algorithm headers of the Boost.Histogram library.

### Header <boost/histogram/axis.hpp>

Includes all axis headers of the Boost.Histogram library.

Extra header not automatically included:

- boost/histogram/axis/ostream.hpp

### Header <boost/histogram/fwd.hpp>

Forward declarations, tag types and type aliases.

    namespace boost {
      namespace histogram {
        typedef unlimited_storage<> default_storage;  // Default storage, optimized for unweighted histograms.
        template<typename T, typename A = std::allocator<T> >
        using dense_storage = storage_adaptor< std::vector< T, A > >;  // Vector-like storage for fast zero-overhead access to cells.
        typedef dense_storage< accumulators::mean<> > profile_storage;  // Dense storage which tracks means of samples in each cell.

        typedef dense_storage< accumulators::weighted_sum<> > weight_storage;  // Dense storage which tracks sums of weights and a variance estimate.
        typedef dense_storage< accumulators::weighted_mean<> > weighted_profile_storage;  // Dense storage which tracks means of weighted samples in each cell.
        namespace axis {
          typedef null_type empty_type;  // Another alias for an empty metadata type.
          typedef int index_type;  // Integral type for axis indices.

          struct null_type;

          typedef double real_index_type;  // Real type for axis indices.
        }
        namespace utility {
        }
      }
    }

### Header <boost/histogram/histogram.hpp>

    namespace boost {
      namespace histogram {
        template<typename Axes, typename Storage> class histogram;
        template<typename A1, typename S1, typename A2, typename S2>
          auto operator*(const histogram< A1, S1 > &, const histogram< A2, S2 > &);
        template<typename A, typename S>
          auto operator*(const histogram< A, S > &, double);
        template<typename A, typename S>
          auto operator*(double, const histogram< A, S > &);
        template<typename A1, typename S1, typename A2, typename S2>
          auto operator+(const histogram< A1, S1 > &, const histogram< A2, S2 > &);
        template<typename A1, typename S1, typename A2, typename S2>
          auto operator-(const histogram< A1, S1 > &, const histogram< A2, S2 > &);
        template<typename A1, typename S1, typename A2, typename S2>
          auto operator/(const histogram< A1, S1 > &, const histogram< A2, S2 > &);
        template<typename A, typename S>
          auto operator/(const histogram< A, S > &, double);
      }
    }

### Header <boost/histogram/indexed.hpp>

    namespace boost {
      namespace histogram {
        enum coverage;

        template<typename Histogram> class indexed_range;
        template<typename Histogram>
          auto indexed(Histogram &&, coverage = coverage::inner);
        template<typename Histogram, typename Iterable>
          auto indexed(Histogram &&, Iterable &&);
      }
    }

### Header <boost/histogram/literals.hpp>

    namespace boost {
      namespace histogram {
        namespace literals {

          // Suffix operator to generate literal compile-time numbers, 0_c, 12_c, etc.
          template<char... digits> auto operator""_c();
        }
      }
    }

### Header <boost/histogram/make_histogram.hpp>

Collection of factory functions to conveniently create histograms.

    namespace boost {
      namespace histogram {
        template<typename Axis, class... Axes>
          auto make_histogram(Axis &&, Axes &&...);
        template<typename Iterable> auto make_histogram(Iterable &&);
        template<typename Iterator> auto make_histogram(Iterator, Iterator);
        template<typename Storage, typename Axis, class... Axes>
          auto make_histogram_with(Storage &&, Axis &&, Axes &&...);
        template<typename Storage, typename Iterable>
          auto make_histogram_with(Storage &&, Iterable &&);
        template<typename Storage, typename Iterator>
          auto make_histogram_with(Storage &&, Iterator, Iterator);
        template<typename Axis, class... Axes>
          auto make_weighted_histogram(Axis &&, Axes &&...);
        template<typename Iterable> auto make_weighted_histogram(Iterable &&);
        template<typename Iterator>
          auto make_weighted_histogram(Iterator, Iterator);
      }
    }

### Header <boost/histogram/make_profile.hpp>

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.

    namespace boost {
      namespace histogram {
        template<typename Axis, class... Axes>
          auto make_profile(Axis &&, Axes &&...);
        template<typename Iterable> auto make_profile(Iterable &&);
        template<typename Iterator> auto make_profile(Iterator, Iterator);
        template<typename Axis, class... Axes>
          auto make_weighted_profile(Axis &&, Axes &&...);
        template<typename Iterable> auto make_weighted_profile(Iterable &&);
        template<typename Iterator> auto make_weighted_profile(Iterator, Iterator);
      }
    }

### Header <boost/histogram/multi_index.hpp>

    namespace boost {
      namespace histogram {
        template<std::size_t Size> struct multi_index;

        template<> struct multi_index<static_cast< std::size_t >(-1)>;
      }
    }

### Header <boost/histogram/ostream.hpp>

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.

### Header <boost/histogram/sample.hpp>

    namespace boost {
      namespace histogram {
        template<typename T> struct sample_type;
        template<class... Ts> auto sample(Ts &&...);
      }
    }

### Header <boost/histogram/serialization.hpp>

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

### Header <boost/histogram/storage_adaptor.hpp>

    namespace boost {
      namespace histogram {
        template<typename T> class storage_adaptor;
      }
    }

### Header <boost/histogram/unlimited_storage.hpp>

    namespace boost {
      namespace histogram {
        template<typename Allocator> class unlimited_storage;
      }
    }

### Header <boost/histogram/unsafe_access.hpp>

    namespace boost {
      namespace histogram {
        struct unsafe_access;
      }
    }

### Header <boost/histogram/weight.hpp>

    namespace boost {
      namespace histogram {
        template<typename T> struct weight_type;
        template<typename T> auto weight(T &&);
      }
    }

### Header <boost/histogram/accumulators/collector.hpp>

    namespace boost {
      namespace histogram {
        namespace accumulators {
          template<typename ContainerType> class collector;
        }
      }
    }

### Header <boost/histogram/accumulators/count.hpp>

    namespace boost {
      namespace histogram {
        namespace accumulators {
          template<typename ValueType, bool ThreadSafe> class count;
        }
      }
    }

### Header <boost/histogram/accumulators/fraction.hpp>

    namespace boost {
      namespace histogram {
        namespace accumulators {
          template<typename ValueType> class fraction;
        }
      }
    }

### Header <boost/histogram/accumulators/is_thread_safe.hpp>

### Header <boost/histogram/accumulators/mean.hpp>

    namespace boost {
      namespace histogram {
        namespace accumulators {
          template<typename ValueType> class mean;
        }
      }
    }

### Header <boost/histogram/accumulators/ostream.hpp>

Simple streaming operators for the builtin accumulator types.

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

### Header <boost/histogram/accumulators/sum.hpp>

    namespace boost {
      namespace histogram {
        namespace accumulators {
          template<typename ValueType> class sum;
        }
      }
    }

### Header <boost/histogram/accumulators/weighted_mean.hpp>

    namespace boost {
      namespace histogram {
        namespace accumulators {
          template<typename ValueType> class weighted_mean;
        }
      }
    }

### Header <boost/histogram/accumulators/weighted_sum.hpp>

    namespace boost {
      namespace histogram {
        namespace accumulators {
          template<typename ValueType> class weighted_sum;
        }
      }
    }

### Header <boost/histogram/algorithm/empty.hpp>

    namespace boost {
      namespace histogram {
        namespace algorithm {
          template<typename A, typename S>
            auto empty(const histogram< A, S > &, coverage);
        }
      }
    }

### Header <boost/histogram/algorithm/project.hpp>

    namespace boost {
      namespace histogram {
        namespace algorithm {
          template<typename A, typename S, unsigned N, typename... Ns>
            auto project(const histogram< A, S > &,
                         std::integral_constant< unsigned, N >, Ns...);
          template<typename A, typename S, typename Iterable>
            auto project(const histogram< A, S > &, const Iterable &);
        }
      }
    }

### Header <boost/histogram/algorithm/reduce.hpp>

    namespace boost {
      namespace histogram {
        namespace algorithm {
          typedef unspecified reduce_command;

          // Whether to behave like shrink orcrop regarding removed bins.
          enum slice_mode { shrink, crop };
          reduce_command crop(unsigned, double, double);
          reduce_command crop(double, double);
          reduce_command crop_and_rebin(unsigned, double, double, unsigned);
          reduce_command crop_and_rebin(double, double, unsigned);
          reduce_command rebin(unsigned, unsigned);
          reduce_command rebin(unsigned);
          template<typename Histogram, typename Iterable>
            Histogram reduce(const Histogram &, const Iterable &);
          template<typename Histogram, class... Ts>
            Histogram reduce(const Histogram &, const reduce_command &,
                             const Ts &...);
          reduce_command shrink(unsigned, double, double);
          reduce_command shrink(double, double);
          reduce_command shrink_and_rebin(unsigned, double, double, unsigned);
          reduce_command shrink_and_rebin(double, double, unsigned);
          reduce_command
          slice(unsigned, axis::index_type, axis::index_type,
                slice_mode = slice_mode::shrink);
          reduce_command
          slice(axis::index_type, axis::index_type,
                slice_mode = slice_mode::shrink);
          reduce_command
          slice_and_rebin(unsigned, axis::index_type, axis::index_type, unsigned,
                          slice_mode = slice_mode::shrink);
          reduce_command
          slice_and_rebin(axis::index_type, axis::index_type, unsigned,
                          slice_mode = slice_mode::shrink);
        }
      }
    }

### Header <boost/histogram/algorithm/sum.hpp>

    namespace boost {
      namespace histogram {
        namespace algorithm {
          template<typename A, typename S>
            auto sum(const histogram< A, S > &, const coverage = coverage::all);
        }
      }
    }

### Header <boost/histogram/axis/boolean.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          template<typename MetaData> class boolean;
        }
      }
    }

### Header <boost/histogram/axis/category.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          template<typename Value, typename MetaData, typename Options,
                   typename Allocator>
            class category;
        }
      }
    }

### Header <boost/histogram/axis/integer.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          template<typename Value, typename MetaData, typename Options> class integer;
        }
      }
    }

### Header <boost/histogram/axis/interval_view.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          template<typename Axis> class interval_view;
        }
      }
    }

### Header <boost/histogram/axis/iterator.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          template<typename Derived> class iterator_mixin;
        }
      }
    }

### Header <boost/histogram/axis/metadata_base.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          template<typename Metadata> class metadata_base;
        }
      }
    }

### Header <boost/histogram/axis/option.hpp>

Options for builtin axis types.

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

    namespace boost {
      namespace histogram {
        namespace axis {
          namespace option {
            template<unsigned Pos> struct bit;
            template<unsigned Bits> struct bitset;

            circular_t circular;        // Instance of circular_t.

            typedef bit< 2 > circular_t;  // Axis is circular. Mutually exclusive with growth andunderflow.

            growth_t growth;        // Instance of growth_t.

            typedef bit< 3 > growth_t;  // Axis can grow. Mutually exclusive with circular.

            none_t none;        // Instance of none_t.

            typedef bitset< 0 > none_t;  // All options off.

            overflow_t overflow;        // Instance of overflow_t.

            typedef bit< 1 > overflow_t;  // Axis has overflow bin.

            underflow_t underflow;        // Instance of underflow_t.

            typedef bit< 0 > underflow_t;  // Axis has an underflow bin. Mutually exclusive with circular.

            // Set intersection of the option arguments.
            template<unsigned B1, unsigned B2>
              auto operator&(bitset< B1 >, bitset< B2 >);

            // Set difference of the option arguments.
            template<unsigned B1, unsigned B2>
              auto operator-(bitset< B1 >, bitset< B2 >);

            // Set union of the axis option arguments.
            template<unsigned B1, unsigned B2>
              auto operator|(bitset< B1 >, bitset< B2 >);
          }
        }
      }
    }

### Header <boost/histogram/axis/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 includeboost/histogram/ostream.hpp.

### Header <boost/histogram/axis/polymorphic_bin.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          template<typename RealType> class polymorphic_bin;
        }
      }
    }

### Header <boost/histogram/axis/regular.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          template<typename Value = double, typename MetaData = use_default,
                   typename Options = use_default>
            class circular;
          template<typename Value, typename Transform, typename MetaData,
                   typename Options>
            class regular;

          // Helper function to mark argument as step size.
          template<typename T> step_type< T > step(T t);
          namespace transform {
            struct id;
            struct log;
            struct pow;
            struct sqrt;
          }
        }
      }
    }

### Header <boost/histogram/axis/traits.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          namespace traits {
            template<typename Axis> struct get_options;

            template<typename Axis> struct is_continuous;
            template<typename Axis> struct is_inclusive;
            template<typename Axis> struct is_ordered;
            template<typename Axis> struct is_reducible;

            template<typename Axis> struct value_type;
            template<typename Axis> bool continuous(const Axis &);
            template<typename Axis> index_type extent(const Axis &);
            template<typename Axis> bool inclusive(const Axis &);
            template<typename Axis, typename U>
              axis::index_type index(const Axis &, const U &);
            template<typename Axis> decltype(auto) metadata(Axis &&);
            template<typename Axis> unsigned options(const Axis &);
            template<typename Axis> bool ordered(const Axis &);
            template<typename Axis> unsigned int rank(const Axis &);
            template<typename Axis, typename U>
              std::pair< index_type, index_type > update(Axis &, const U &);
            template<typename Axis>
              decltype(auto) value(const Axis &, real_index_type);
            template<typename Result, typename Axis>
              Result value_as(const Axis &, real_index_type);
            template<typename Axis> decltype(auto) width(const Axis &, index_type);
            template<typename Result, typename Axis>
              Result width_as(const Axis &, index_type);
          }
        }
      }
    }

### Header <boost/histogram/axis/variable.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          template<typename Value, typename MetaData, typename Options,
                   typename Allocator>
            class variable;
        }
      }
    }

### Header <boost/histogram/axis/variant.hpp>

    namespace boost {
      namespace histogram {
        namespace axis {
          template<class... Ts> class variant;

          // Return reference to T, throws std::runtime_error if type does not match.
          template<typename T, class... Us>
            decltype(auto) get(variant< Us... > & v);

          // Return movable reference to T, throws unspecified exception if type does not match.
          template<typename T, class... Us>
            decltype(auto) get(variant< Us... > && v);

          // Return const reference to T, throws unspecified exception if type does not match.
          template<typename T, class... Us>
            decltype(auto) get(const variant< Us... > & v);

          // Returns pointer to T in variant or null pointer if type does not match.
          template<typename T, class... Us> auto get_if(variant< Us... > * v);

          // Returns pointer to const T in variant or null pointer if type does not match.
          template<typename T, class... Us>
            auto get_if(const variant< Us... > * v);

          // The negation of operator==.
          template<class... Us, class... Ts>
            bool operator!=(const variant< Us... > & u,
                            const variant< Ts... > & t);

          // The negation of operator==.
          template<class... Us, typename T>
            bool operator!=(const variant< Us... > & u, const T & t);

          // The negation of operator==.
          template<typename T, class... Us>
            bool operator!=(const T & t, const variant< Us... > & u);
          template<class... Us, class... Vs>
            bool operator==(const variant< Us... > &, const variant< Vs... > &);
          template<class... Us, typename T>
            bool operator==(const variant< Us... > &, const T &);

          // Apply visitor to variant (reference).
          template<typename Visitor, class... Us>
            decltype(auto) visit(Visitor && vis, variant< Us... > & var);

          // Apply visitor to variant (movable reference).
          template<typename Visitor, class... Us>
            decltype(auto) visit(Visitor && vis, variant< Us... > && var);

          // Apply visitor to variant (const reference).
          template<typename Visitor, class... Us>
            decltype(auto) visit(Visitor && vis, const variant< Us... > & var);
        }
      }
    }

### Header <boost/histogram/utility/binomial_proportion_interval.hpp>

    namespace boost {
      namespace histogram {
        namespace utility {
          template<typename ValueType> class binomial_proportion_interval;
          class confidence_level;
          class deviation;
        }
      }
    }

### Header <boost/histogram/utility/clopper_pearson_interval.hpp>

    namespace boost {
      namespace histogram {
        namespace utility {
          template<typename ValueType> class clopper_pearson_interval;
        }
      }
    }

### Header <boost/histogram/utility/jeffreys_interval.hpp>

    namespace boost {
      namespace histogram {
        namespace utility {
          template<typename ValueType> class jeffreys_interval;
        }
      }
    }

### Header <boost/histogram/utility/wald_interval.hpp>

    namespace boost {
      namespace histogram {
        namespace utility {
          template<typename ValueType> class wald_interval;
        }
      }
    }

### Header <boost/histogram/utility/wilson_interval.hpp>

    namespace boost {
      namespace histogram {
        namespace utility {
          template<typename ValueType> class wilson_interval;
        }
      }
    }