Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Reference

Header <boost/histogram.hpp>
Header <boost/histogram/accumulators.hpp>
Header <boost/histogram/algorithm.hpp>
Header <boost/histogram/axis.hpp>
Header <boost/histogram/fwd.hpp>
Header <boost/histogram/histogram.hpp>
Header <boost/histogram/indexed.hpp>
Header <boost/histogram/literals.hpp>
Header <boost/histogram/make_histogram.hpp>
Header <boost/histogram/make_profile.hpp>
Header <boost/histogram/multi_index.hpp>
Header <boost/histogram/ostream.hpp>
Header <boost/histogram/sample.hpp>
Header <boost/histogram/serialization.hpp>
Header <boost/histogram/storage_adaptor.hpp>
Header <boost/histogram/unlimited_storage.hpp>
Header <boost/histogram/unsafe_access.hpp>
Header <boost/histogram/weight.hpp>
Header <boost/histogram/accumulators/count.hpp>
Header <boost/histogram/accumulators/is_thread_safe.hpp>
Header <boost/histogram/accumulators/mean.hpp>
Header <boost/histogram/accumulators/ostream.hpp>
Header <boost/histogram/accumulators/sum.hpp>
Header <boost/histogram/accumulators/thread_safe.hpp>
Header <boost/histogram/accumulators/weighted_mean.hpp>
Header <boost/histogram/accumulators/weighted_sum.hpp>
Header <boost/histogram/algorithm/empty.hpp>
Header <boost/histogram/algorithm/project.hpp>
Header <boost/histogram/algorithm/reduce.hpp>
Header <boost/histogram/algorithm/sum.hpp>
Header <boost/histogram/axis/boolean.hpp>
Header <boost/histogram/axis/category.hpp>
Header <boost/histogram/axis/integer.hpp>
Header <boost/histogram/axis/interval_view.hpp>
Header <boost/histogram/axis/iterator.hpp>
Header <boost/histogram/axis/metadata_base.hpp>
Header <boost/histogram/axis/option.hpp>
Header <boost/histogram/axis/ostream.hpp>
Header <boost/histogram/axis/polymorphic_bin.hpp>
Header <boost/histogram/axis/regular.hpp>
Header <boost/histogram/axis/traits.hpp>
Header <boost/histogram/axis/variable.hpp>
Header <boost/histogram/axis/variant.hpp>

Includes all standard headers of the Boost.Histogram library.

Extra headers not automatically included are:

Includes all accumulator headers of the Boost.Histogram library.

Extra header not automatically included:

Includes all algorithm headers of the Boost.Histogram library.

Includes all axis headers of the Boost.Histogram library.

Extra header not automatically included:

Forward declarations, tag types and type aliases.

namespace boost {
  namespace histogram {
    typedef unlimited_storage<> default_storage;  // Default storage, optimized for unweighted histograms. 
    typedef storage_adaptor< std::vector< T, A > > dense_storage;  // 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 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);
  }
}
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 &&);
  }
}
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();
    }
  }
}

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);
  }
}

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);
  }
}
namespace boost {
  namespace histogram {
    template<std::size_t Size> struct multi_index;

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

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.

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

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

namespace boost {
  namespace histogram {
    template<typename T> class storage_adaptor;
  }
}
namespace boost {
  namespace histogram {
    template<typename Allocator> class unlimited_storage;
  }
}
namespace boost {
  namespace histogram {
    struct unsafe_access;
  }
}
namespace boost {
  namespace histogram {
    template<typename T> struct weight_type;
    template<typename T> auto weight(T &&);
  }
}
namespace boost {
  namespace histogram {
    namespace accumulators {
      template<typename ValueType, bool ThreadSafe> class count;
    }
  }
}
namespace boost {
  namespace histogram {
    namespace accumulators {
      template<typename ValueType> class mean;
    }
  }
}

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.

namespace boost {
  namespace histogram {
    namespace accumulators {
      template<typename ValueType> class sum;
    }
  }
}
namespace boost {
  namespace histogram {
    namespace accumulators {
      template<typename T> struct is_thread_safe<thread_safe< T >>;

      template<typename T> class thread_safe;
    }
  }
}
namespace boost {
  namespace histogram {
    namespace accumulators {
      template<typename ValueType> class weighted_mean;
    }
  }
}
namespace boost {
  namespace histogram {
    namespace accumulators {
      template<typename ValueType> class weighted_sum;
    }
  }
}
namespace boost {
  namespace histogram {
    namespace algorithm {
      template<typename A, typename S> 
        auto empty(const histogram< A, S > &, coverage);
    }
  }
}
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 &);
    }
  }
}
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);
    }
  }
}
namespace boost {
  namespace histogram {
    namespace algorithm {
      template<typename A, typename S> 
        auto sum(const histogram< A, S > &, const coverage = coverage::all);
    }
  }
}
namespace boost {
  namespace histogram {
    namespace axis {
      template<typename MetaData> class boolean;
    }
  }
}
namespace boost {
  namespace histogram {
    namespace axis {
      template<typename Value, typename MetaData, typename Options, 
               typename Allocator> 
        class category;
    }
  }
}
namespace boost {
  namespace histogram {
    namespace axis {
      template<typename Value, typename MetaData, typename Options> class integer;
    }
  }
}
namespace boost {
  namespace histogram {
    namespace axis {
      template<typename Axis> class interval_view;
    }
  }
}
namespace boost {
  namespace histogram {
    namespace axis {
      template<typename Derived> class iterator_mixin;
    }
  }
}
namespace boost {
  namespace histogram {
    namespace axis {
      template<typename Metadata> class metadata_base;
    }
  }
}

Options for builtin axis types.

Options circular andgrowth are mutually exclusive. Optionscircular andunderflow are mutually exclusive.

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

        constexpr circular_t circular;        // Instance of circular_t.

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

        constexpr growth_t growth;        // Instance of growth_t.

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

        constexpr none_t none;        // Instance of none_t.

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

        constexpr overflow_t overflow;        // Instance of overflow_t.

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

        constexpr 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> 
          constexpr auto operator&(bitset< B1 >, bitset< B2 >);

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

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

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.

namespace boost {
  namespace histogram {
    namespace axis {
      template<typename RealType> class polymorphic_bin;
    }
  }
}
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;
      }
    }
  }
}
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> constexpr bool continuous(const Axis &);
        template<typename Axis> index_type extent(const Axis &);
        template<typename Axis> constexpr 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> constexpr unsigned options(const Axis &);
        template<typename Axis> constexpr bool ordered(const Axis &);
        template<typename Axis> constexpr 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);
      }
    }
  }
}
namespace boost {
  namespace histogram {
    namespace axis {
      template<typename Value, typename MetaData, typename Options, 
               typename Allocator> 
        class variable;
    }
  }
}
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);
    }
  }
}

PrevUpHomeNext