From ab917747655025cbe5237d48400112a1683e5b5b Mon Sep 17 00:00:00 2001 From: Hans Dembinski Date: Fri, 15 Jul 2016 09:37:58 -0400 Subject: [PATCH] putting generated docu into repository --- build/Jamfile.v2 | 6 - doc/html/BOOST_HISTOGRAM_AXIS_LIMIT.html | 49 ++ doc/html/BOOST_HISTOGRAM_BASE_APPEND.html | 49 ++ doc/html/BOOST_HISTOGRAM_BASE_CTOR.html | 49 ++ doc/html/BOOST_HISTOGRAM_CTOR.html | 49 ++ doc/html/BOOST_HISTOGRAM_FILL.html | 49 ++ doc/html/BOOST_HISTOGRAM_VALUE.html | 49 ++ doc/html/BOOST_HISTOGRAM_VARIANCE.html | 49 ++ doc/html/BOOST_HISTOGRAM_WFILL.html | 49 ++ doc/html/boost/histogram/axis_base.html | 100 ++++ doc/html/boost/histogram/basic_histogram.html | 140 +++++ doc/html/boost/histogram/category_axis.html | 145 +++++ doc/html/boost/histogram/histogram.html | 203 +++++++ doc/html/boost/histogram/integer_axis.html | 94 ++++ doc/html/boost/histogram/polar_axis.html | 123 ++++ doc/html/boost/histogram/real_axis.html | 71 +++ doc/html/boost/histogram/regular_axis.html | 133 +++++ doc/html/boost/histogram/variable_axis.html | 134 +++++ doc/html/boost/histogram/visitor/bins.html | 62 +++ doc/html/boost/histogram/visitor/cmp.html | 66 +++ doc/html/boost/histogram/visitor/index.html | 74 +++ doc/html/boost/histogram/visitor/shape.html | 62 +++ doc/html/boost/histogram/visitor/uoflow.html | 62 +++ doc/html/boost_histogram/changelog.html | 40 ++ doc/html/boost_histogram/introduction.html | 92 +++ doc/html/boost_histogram/motivation.html | 64 +++ doc/html/boost_histogram/notes.html | 526 ++++++++++++++++++ doc/html/boost_histogram/rationale.html | 189 +++++++ doc/html/boost_histogram/references.html | 56 ++ doc/html/boost_histogram/tutorial.html | 191 +++++++ doc/html/histogram/reference.html | 150 +++++ doc/html/index.html | 115 ++++ doc/html/standalone_HTML.manifest | 31 ++ 33 files changed, 3315 insertions(+), 6 deletions(-) create mode 100644 doc/html/BOOST_HISTOGRAM_AXIS_LIMIT.html create mode 100644 doc/html/BOOST_HISTOGRAM_BASE_APPEND.html create mode 100644 doc/html/BOOST_HISTOGRAM_BASE_CTOR.html create mode 100644 doc/html/BOOST_HISTOGRAM_CTOR.html create mode 100644 doc/html/BOOST_HISTOGRAM_FILL.html create mode 100644 doc/html/BOOST_HISTOGRAM_VALUE.html create mode 100644 doc/html/BOOST_HISTOGRAM_VARIANCE.html create mode 100644 doc/html/BOOST_HISTOGRAM_WFILL.html create mode 100644 doc/html/boost/histogram/axis_base.html create mode 100644 doc/html/boost/histogram/basic_histogram.html create mode 100644 doc/html/boost/histogram/category_axis.html create mode 100644 doc/html/boost/histogram/histogram.html create mode 100644 doc/html/boost/histogram/integer_axis.html create mode 100644 doc/html/boost/histogram/polar_axis.html create mode 100644 doc/html/boost/histogram/real_axis.html create mode 100644 doc/html/boost/histogram/regular_axis.html create mode 100644 doc/html/boost/histogram/variable_axis.html create mode 100644 doc/html/boost/histogram/visitor/bins.html create mode 100644 doc/html/boost/histogram/visitor/cmp.html create mode 100644 doc/html/boost/histogram/visitor/index.html create mode 100644 doc/html/boost/histogram/visitor/shape.html create mode 100644 doc/html/boost/histogram/visitor/uoflow.html create mode 100644 doc/html/boost_histogram/changelog.html create mode 100644 doc/html/boost_histogram/introduction.html create mode 100644 doc/html/boost_histogram/motivation.html create mode 100644 doc/html/boost_histogram/notes.html create mode 100644 doc/html/boost_histogram/rationale.html create mode 100644 doc/html/boost_histogram/references.html create mode 100644 doc/html/boost_histogram/tutorial.html create mode 100644 doc/html/histogram/reference.html create mode 100644 doc/html/index.html create mode 100644 doc/html/standalone_HTML.manifest diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index aa81903aa..9780fdecd 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -2,13 +2,8 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) -# See http://www.boost.org/libs/iostreams for documentation. - project /boost/histogram : source-location ../src ; -# For each library with either link to existing binary, or build -# a library from th - lib boost_histogram : axis.cpp basic_histogram.cpp histogram.cpp nstore.cpp zero_suppression.cpp ; import python ; @@ -24,4 +19,3 @@ python-extension histogram : : release shared ; boost-install boost_histogram histogram ; - diff --git a/doc/html/BOOST_HISTOGRAM_AXIS_LIMIT.html b/doc/html/BOOST_HISTOGRAM_AXIS_LIMIT.html new file mode 100644 index 000000000..cec754c3f --- /dev/null +++ b/doc/html/BOOST_HISTOGRAM_AXIS_LIMIT.html @@ -0,0 +1,49 @@ + + + +Macro BOOST_HISTOGRAM_AXIS_LIMIT + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_HISTOGRAM_AXIS_LIMIT

+

BOOST_HISTOGRAM_AXIS_LIMIT

+
+

Synopsis

+
// In header: <boost/histogram/basic_histogram.hpp>
+
+BOOST_HISTOGRAM_AXIS_LIMIT
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/BOOST_HISTOGRAM_BASE_APPEND.html b/doc/html/BOOST_HISTOGRAM_BASE_APPEND.html new file mode 100644 index 000000000..17fda64f9 --- /dev/null +++ b/doc/html/BOOST_HISTOGRAM_BASE_APPEND.html @@ -0,0 +1,49 @@ + + + +Macro BOOST_HISTOGRAM_BASE_APPEND + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_HISTOGRAM_BASE_APPEND

+

BOOST_HISTOGRAM_BASE_APPEND

+
+

Synopsis

+
// In header: <boost/histogram/basic_histogram.hpp>
+
+BOOST_HISTOGRAM_BASE_APPEND(z, n, unused)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/BOOST_HISTOGRAM_BASE_CTOR.html b/doc/html/BOOST_HISTOGRAM_BASE_CTOR.html new file mode 100644 index 000000000..e9b396e33 --- /dev/null +++ b/doc/html/BOOST_HISTOGRAM_BASE_CTOR.html @@ -0,0 +1,49 @@ + + + +Macro BOOST_HISTOGRAM_BASE_CTOR + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_HISTOGRAM_BASE_CTOR

+

BOOST_HISTOGRAM_BASE_CTOR

+
+

Synopsis

+
// In header: <boost/histogram/basic_histogram.hpp>
+
+BOOST_HISTOGRAM_BASE_CTOR(z, n, unused)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/BOOST_HISTOGRAM_CTOR.html b/doc/html/BOOST_HISTOGRAM_CTOR.html new file mode 100644 index 000000000..3a611b971 --- /dev/null +++ b/doc/html/BOOST_HISTOGRAM_CTOR.html @@ -0,0 +1,49 @@ + + + +Macro BOOST_HISTOGRAM_CTOR + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_HISTOGRAM_CTOR

+

BOOST_HISTOGRAM_CTOR

+
+

Synopsis

+
// In header: <boost/histogram/histogram.hpp>
+
+BOOST_HISTOGRAM_CTOR(z, n, unused)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/BOOST_HISTOGRAM_FILL.html b/doc/html/BOOST_HISTOGRAM_FILL.html new file mode 100644 index 000000000..056de96df --- /dev/null +++ b/doc/html/BOOST_HISTOGRAM_FILL.html @@ -0,0 +1,49 @@ + + + +Macro BOOST_HISTOGRAM_FILL + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_HISTOGRAM_FILL

+

BOOST_HISTOGRAM_FILL

+
+

Synopsis

+
// In header: <boost/histogram/histogram.hpp>
+
+BOOST_HISTOGRAM_FILL(z, n, unused)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/BOOST_HISTOGRAM_VALUE.html b/doc/html/BOOST_HISTOGRAM_VALUE.html new file mode 100644 index 000000000..2c9ea24a8 --- /dev/null +++ b/doc/html/BOOST_HISTOGRAM_VALUE.html @@ -0,0 +1,49 @@ + + + +Macro BOOST_HISTOGRAM_VALUE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_HISTOGRAM_VALUE

+

BOOST_HISTOGRAM_VALUE

+
+

Synopsis

+
// In header: <boost/histogram/histogram.hpp>
+
+BOOST_HISTOGRAM_VALUE(z, n, unused)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/BOOST_HISTOGRAM_VARIANCE.html b/doc/html/BOOST_HISTOGRAM_VARIANCE.html new file mode 100644 index 000000000..34a2f84fe --- /dev/null +++ b/doc/html/BOOST_HISTOGRAM_VARIANCE.html @@ -0,0 +1,49 @@ + + + +Macro BOOST_HISTOGRAM_VARIANCE + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_HISTOGRAM_VARIANCE

+

BOOST_HISTOGRAM_VARIANCE

+
+

Synopsis

+
// In header: <boost/histogram/histogram.hpp>
+
+BOOST_HISTOGRAM_VARIANCE(z, n, unused)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/BOOST_HISTOGRAM_WFILL.html b/doc/html/BOOST_HISTOGRAM_WFILL.html new file mode 100644 index 000000000..4eaf9f2e7 --- /dev/null +++ b/doc/html/BOOST_HISTOGRAM_WFILL.html @@ -0,0 +1,49 @@ + + + +Macro BOOST_HISTOGRAM_WFILL + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Macro BOOST_HISTOGRAM_WFILL

+

BOOST_HISTOGRAM_WFILL

+
+

Synopsis

+
// In header: <boost/histogram/histogram.hpp>
+
+BOOST_HISTOGRAM_WFILL(z, n, unused)
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/axis_base.html b/doc/html/boost/histogram/axis_base.html new file mode 100644 index 000000000..fc4fe752e --- /dev/null +++ b/doc/html/boost/histogram/axis_base.html @@ -0,0 +1,100 @@ + + + +Class axis_base + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class axis_base

+

boost::histogram::axis_base — common base class for most axes

+
+

Synopsis

+
// In header: <boost/histogram/axis.hpp>
+
+
+class axis_base {
+public:
+  // construct/copy/destruct
+  axis_base(int, const std::string &, bool);
+  axis_base();
+  axis_base(const axis_base &);
+  axis_base & operator=(const axis_base &);
+
+  // public member functions
+  int bins() const;
+  bool uoflow() const;
+  const std::string & label() const;
+  void label(const std::string &);
+
+  // protected member functions
+  bool operator==(const axis_base &) const;
+};
+
+

Description

+
+

+axis_base + public + construct/copy/destruct

+
    +
  1. axis_base(int, const std::string &, bool);
  2. +
  3. axis_base();
  4. +
  5. axis_base(const axis_base &);
  6. +
  7. axis_base & operator=(const axis_base &);
  8. +
+
+
+

+axis_base public member functions

+
    +
  1. +
    int bins() const;
    Returns the number of bins.
  2. +
  3. +
    bool uoflow() const;
    Returns whether overflow and underflow bins will be added in the histogram.
  4. +
  5. +
    const std::string & label() const;
    Change the label of an axis (not implemented for category_axis).
  6. +
  7. +
    void label(const std::string & label);
    Returns the axis label, which is a name or description (not implemented for category_axis).
  8. +
+
+
+

+axis_base protected member functions

+
  1. bool operator==(const axis_base &) const;
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/basic_histogram.html b/doc/html/boost/histogram/basic_histogram.html new file mode 100644 index 000000000..0e18ae5de --- /dev/null +++ b/doc/html/boost/histogram/basic_histogram.html @@ -0,0 +1,140 @@ + + + +Class basic_histogram + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class basic_histogram

+

boost::histogram::basic_histogram — This class holds collection of axis instances and computes the internal index.

+
+

Synopsis

+
// In header: <boost/histogram/basic_histogram.hpp>
+
+
+class basic_histogram {
+public:
+  // types
+  typedef container::vector< axis_type > axes_type;
+  typedef uintptr_t                      size_type;
+
+  // construct/copy/destruct
+  basic_histogram(const basic_histogram &);
+  basic_histogram(BOOST_RV_REF(basic_histogram));
+  explicit basic_histogram(const axes_type &);
+  basic_histogram & operator=(BOOST_COPY_ASSIGN_REF(basic_histogram));
+  basic_histogram & operator=(BOOST_RV_REF(basic_histogram));
+  ~basic_histogram();
+
+  // public member functions
+  unsigned dim() const;
+  int bins(unsigned) const;
+  unsigned shape(unsigned) const;
+  template<typename T> 
+    enable_if< is_same< T, axis_type >, T & >::type axis(unsigned);
+  template<typename T> 
+    disable_if< is_same< T, axis_type >, T & >::type axis(unsigned);
+  template<typename T> 
+    enable_if< is_same< T, axis_type >, const T & >::type axis(unsigned) const;
+  template<typename T> 
+    disable_if< is_same< T, axis_type >, const T & >::type 
+    axis(unsigned) const;
+  template<typename T> T & axis(unsigned);
+  template<typename T> const T & axis(unsigned) const;
+  bool operator==(const basic_histogram &) const;
+  template<typename Iterator> 
+    size_type pos(const Iterator &, const Iterator &) const;
+  template<typename Iterator> 
+    size_type linearize(const Iterator &, const Iterator &) const;
+  size_type field_count() const;
+};
+
+

Description

+
+

+basic_histogram + public + construct/copy/destruct

+
    +
  1. basic_histogram(const basic_histogram & o);
  2. +
  3. basic_histogram(BOOST_RV_REF(basic_histogram) o);
  4. +
  5. explicit basic_histogram(const axes_type & axes);
  6. +
  7. basic_histogram & operator=(BOOST_COPY_ASSIGN_REF(basic_histogram) o);
  8. +
  9. basic_histogram & operator=(BOOST_RV_REF(basic_histogram) o);
  10. +
  11. ~basic_histogram();
  12. +
+
+
+

+basic_histogram public member functions

+
    +
  1. +
    unsigned dim() const;
    Returns the number of dimensions of the histogram, how many axis it has.
  2. +
  3. +
    int bins(unsigned i) const;
    Returns the number of bins for axis i.
  4. +
  5. +
    unsigned shape(unsigned i) const;
    +

    Returns the actual number of fields used by the axis. If the axis has no underflow and overflow bins, this is equal to bins. Otherwise, the number is larger by 2.

    +
  6. +
  7. template<typename T> 
    +  enable_if< is_same< T, axis_type >, T & >::type axis(unsigned i);
  8. +
  9. template<typename T> 
    +  disable_if< is_same< T, axis_type >, T & >::type axis(unsigned i);
  10. +
  11. template<typename T> 
    +  enable_if< is_same< T, axis_type >, const T & >::type axis(unsigned i) const;
  12. +
  13. template<typename T> 
    +  disable_if< is_same< T, axis_type >, const T & >::type 
    +  axis(unsigned i) const;
  14. +
  15. +
    template<typename T> T & axis(unsigned i);
    +

    Returns the axis object at index i, casted to type T. A runtime exception is thrown if the type cast is invalid.

    +
  16. +
  17. +
    template<typename T> const T & axis(unsigned i) const;
    +

    The const-version of the previous member function.

    +
  18. +
  19. bool operator==(const basic_histogram &) const;
  20. +
  21. template<typename Iterator> 
    +  size_type pos(const Iterator & begin, const Iterator & end) const;
  22. +
  23. template<typename Iterator> 
    +  size_type linearize(const Iterator & begin, const Iterator & end) const;
  24. +
  25. +
    size_type field_count() const;
    Returns the number of fields needed for storage.
  26. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/category_axis.html b/doc/html/boost/histogram/category_axis.html new file mode 100644 index 000000000..5a496fab8 --- /dev/null +++ b/doc/html/boost/histogram/category_axis.html @@ -0,0 +1,145 @@ + + + +Class category_axis + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class category_axis

+

boost::histogram::category_axis — An axis for enumerated categories. The axis stores the category labels, and expects that they are addressed using an integer from 0 to n-1. There are no underflow/overflow bins for this axis. Binning is a O(1) operation.

+
+

Synopsis

+
// In header: <boost/histogram/axis.hpp>
+
+
+class category_axis {
+public:
+  // types
+  typedef std::string value_type;
+
+  // construct/copy/destruct
+  explicit category_axis(const std::string &);
+  explicit category_axis(const std::vector< std::string > &);
+  category_axis();
+  category_axis(const category_axis &);
+  category_axis & operator=(const category_axis &);
+
+  // public member functions
+  int bins() const;
+  int index(double) const;
+  const std::string & operator[](int) const;
+  bool uoflow() const;
+  bool operator==(const category_axis &) const;
+};
+
+

Description

+
+

+category_axis + public + construct/copy/destruct

+
    +
  1. +
    explicit category_axis(const std::string & categories);
    +

    Construct from a single string

    +

    +

    +
    ++++ + + + + +

    Parameters:

    ++++ + + + + +

    categories

    a string of categories separated by the character ;

    +
  2. +
  3. +
    explicit category_axis(const std::vector< std::string > & categories);
    +

    Construct from a single string

    +

    +

    +
    ++++ + + + + +

    Parameters:

    ++++ + + + + +

    categories

    an ordered sequence of categories that this axis discriminates

    +
  4. +
  5. category_axis();
  6. +
  7. category_axis(const category_axis &);
  8. +
  9. category_axis & operator=(const category_axis &);
  10. +
+
+
+

+category_axis public member functions

+
    +
  1. int bins() const;
  2. +
  3. +
    int index(double x) const;
    Returns the bin index for the passed argument.
  4. +
  5. +
    const std::string & operator[](int idx) const;
    Returns the category for the bin index.
  6. +
  7. bool uoflow() const;
  8. +
  9. bool operator==(const category_axis &) const;
  10. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/histogram.html b/doc/html/boost/histogram/histogram.html new file mode 100644 index 000000000..7c13d5bcb --- /dev/null +++ b/doc/html/boost/histogram/histogram.html @@ -0,0 +1,203 @@ + + + +Class histogram + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class histogram

+

boost::histogram::histogram

+
+

Synopsis

+
// In header: <boost/histogram/histogram.hpp>
+
+
+class histogram : public boost::histogram::basic_histogram {
+public:
+  // construct/copy/destruct
+  histogram();
+  explicit histogram(const axes_type &);
+  explicit histogram(const axis_type &, ...);
+  histogram(const histogram &);
+  histogram(BOOST_RV_REF(histogram));
+  histogram & operator=(BOOST_COPY_ASSIGN_REF(histogram));
+  histogram & operator=(BOOST_RV_REF(histogram));
+
+  // public member functions
+  template<typename Iterator> 
+    boost::disable_if< boost::is_arithmetic< Iterator >, void >::type 
+    fill(Iterator, Iterator);
+  void fill(double, ...);
+  template<typename Iterator> 
+    boost::disable_if< boost::is_arithmetic< Iterator >, void >::type 
+    wfill(Iterator, Iterator, double);
+  void fill(double, ...);
+  template<typename Iterator> 
+    boost::disable_if< boost::is_arithmetic< Iterator >, double >::type 
+    value(Iterator, Iterator) const;
+  void value(double, ...);
+  template<typename Iterator> 
+    boost::disable_if< boost::is_arithmetic< Iterator >, double >::type 
+    variance(Iterator, Iterator) const;
+  void variance(double, ...);
+  unsigned depth() const;
+  double sum() const;
+  bool operator==(const histogram &) const;
+  histogram & operator+=(const histogram &);
+  const void * buffer() const;
+};
+
+

Description

+

The class implements an n-dimensional histogram, managing counts in bins.

+

It inherits from basic_histogram, which manages the stored axis instances and the conversion of an n-dimensional tuple or index into an internal linear offset that is used to address the bin count. How the bin count is stored is an encapsulated implementation detail.

+
+

+histogram + public + construct/copy/destruct

+
    +
  1. histogram();
  2. +
  3. explicit histogram(const axes_type & axes);
  4. +
  5. +
    explicit histogram(const axis_type & a0, ...);
    +

    Constructors for a variable number of axis types, each defining the binning scheme for its dimension. Up to BOOST_HISTOGRAM_AXIS_LIMIT axis types can be passed to the constructor, yielding the same number of dimensions.

    +
  6. +
  7. histogram(const histogram & o);
  8. +
  9. histogram(BOOST_RV_REF(histogram) o);
  10. +
  11. histogram & operator=(BOOST_COPY_ASSIGN_REF(histogram) o);
  12. +
  13. histogram & operator=(BOOST_RV_REF(histogram) o);
  14. +
+
+
+

+histogram public member functions

+
    +
  1. +
    template<typename Iterator> 
    +  boost::disable_if< boost::is_arithmetic< Iterator >, void >::type 
    +  fill(Iterator begin, Iterator end);
    +

    Fills the histogram with a range. It checks at run-time that the size agrees with the dimensions of the histogram.

    +

    Allocation of internal memory is delayed until the first call to this function.

    +

    +

    +
    ++++ + + + + +

    Throws:

    std::range_error If the range doesn't fit the dimension of the histogram.
    +
  2. +
  3. void fill(double x0, ...);
  4. +
  5. +
    template<typename Iterator> 
    +  boost::disable_if< boost::is_arithmetic< Iterator >, void >::type 
    +  wfill(Iterator begin, Iterator end, double w);
    +

    Fills the histogram from a iterator range, using a weight. It checks at run-time that the length agrees with the dimensions of the histogram.

    +

    Allocation of internal memory is delayed until the first call to this function. If the histogram was filled with :cpp:func:fill_c before, the internal memory is converted to the wide format used for storing weighted counts.

    +

    If the data is not weighted (all weights are 1.0), using fill is much more space-efficient. In the most extreme case, storing of weighted counts consumes 16x more memory.

    +

    +This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    +

    Overload taking a variadic sequence.

    +
    ++++ + + + + +

    Throws:

    std::range_error If the range doesn't fit the dimension of the histogram.
    +
  6. +
  7. void fill(double x0, ...);
  8. +
  9. +
    template<typename Iterator> 
    +  boost::disable_if< boost::is_arithmetic< Iterator >, double >::type 
    +  value(Iterator begin, Iterator end) const;
    +

    Returns the count of the bin addressed by the supplied index. Just like in Python, negative indices like -1 are allowed and count from the end. So if an axis has k bins, -1 points to k-1.

    +

    +

    +
    ++++ + + + + +

    Throws:

    std::range_error if the length does not match the dimension
    +
  10. +
  11. void value(double x0, ...);
  12. +
  13. +
    template<typename Iterator> 
    +  boost::disable_if< boost::is_arithmetic< Iterator >, double >::type 
    +  variance(Iterator begin, Iterator end) const;
    +

    Returns the variance estimate for the count of the bin addressed by the supplied index. Negative indices are allowed just like in case of histogram::value

    +

    Note that it does not return the standard deviation :math:\sigma, commonly called "error", but the variance .

    +

    In case of unweighted counts, the variance estimate returned is , if the count is . This is a common estimate for the variance based on the theory of the Poisson distribution. In case of weighted counts, the variance estimate returned is , if the individual weights are . This estimate can be derived from the estimate above using uncertainty propagation. The extra storage needed for keeping track of the this sum is the reason why a histogram with weighted counts consumes more memory.

    +

    +

    +
    ++++ + + + + +

    Throws:

    std::range_error if the length does not match the dimension
    +
  14. +
  15. void variance(double x0, ...);
  16. +
  17. +
    unsigned depth() const;
    Returns the current size of a count in the internal memory buffer in number of bytes.
  18. +
  19. +
    double sum() const;
    Returns the sum of bin counts, including overflow and underflow bins. This could be implemented as a free function.
  20. +
  21. +
    bool operator==(const histogram & o) const;
    Returns true if the two histograms have the dimension, same axis types, and same data content. Two otherwise identical histograms are not considered equal, if they do not have the same depth, even if counts and variances are the same. This case only occurs if one histogram is filled using :cpp:func:fill and the other with :cpp:func:wfill, using weights of 1.
  22. +
  23. +
    histogram & operator+=(const histogram & o);
    Adds the counts of the histogram on the right hand side to this histogram, if the two histograms have the same signature. Otherwise, a :cpp:type:std::logic_error is thrown. Returns itself.
  24. +
  25. const void * buffer() const;
  26. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/integer_axis.html b/doc/html/boost/histogram/integer_axis.html new file mode 100644 index 000000000..3aa16ccfc --- /dev/null +++ b/doc/html/boost/histogram/integer_axis.html @@ -0,0 +1,94 @@ + + + +Class integer_axis + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class integer_axis

+

boost::histogram::integer_axis

+
+

Synopsis

+
// In header: <boost/histogram/axis.hpp>
+
+
+class integer_axis : public boost::histogram::axis_base {
+public:
+  // types
+  typedef int value_type;
+
+  // construct/copy/destruct
+  integer_axis(int, int, const std::string & = std::string(), bool = true);
+  integer_axis();
+  integer_axis(const integer_axis &);
+  integer_axis & operator=(const integer_axis &);
+
+  // public member functions
+  int index(double) const;
+  int operator[](int) const;
+  bool operator==(const integer_axis &) const;
+};
+
+

Description

+

An axis for a contiguous range of integers. There are no underflow/overflow bins for this axis. Binning is a O(1) operation.

+
+

+integer_axis + public + construct/copy/destruct

+
    +
  1. +
    integer_axis(int min, int max, const std::string & label = std::string(), 
    +             bool uoflow = true);
    Constructor.
  2. +
  3. integer_axis();
  4. +
  5. integer_axis(const integer_axis &);
  6. +
  7. integer_axis & operator=(const integer_axis &);
  8. +
+
+
+

+integer_axis public member functions

+
    +
  1. +
    int index(double x) const;
    Returns the bin index for the passed argument.
  2. +
  3. +
    int operator[](int idx) const;
    Returns the integer that is mapped to the bin index.
  4. +
  5. bool operator==(const integer_axis &) const;
  6. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/polar_axis.html b/doc/html/boost/histogram/polar_axis.html new file mode 100644 index 000000000..6bad57d10 --- /dev/null +++ b/doc/html/boost/histogram/polar_axis.html @@ -0,0 +1,123 @@ + + + +Class polar_axis + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class polar_axis

+

boost::histogram::polar_axis — An axis for real-valued angles. There are no overflow/underflow bins for this axis, since the axis is circular and wraps around after :math:2 \pi. Binning is a O(1) operation.

+
+

Synopsis

+
// In header: <boost/histogram/axis.hpp>
+
+
+class polar_axis : public boost::histogram::axis_base,
+                   public boost::histogram::real_axis< polar_axis >
+{
+public:
+  // construct/copy/destruct
+  explicit polar_axis(int, double = 0.0, const std::string & = std::string());
+  polar_axis();
+  polar_axis(const polar_axis &);
+  polar_axis & operator=(const polar_axis &);
+
+  // public member functions
+  int index(double) const;
+  double operator[](int) const;
+  bool operator==(const polar_axis &) const;
+};
+
+

Description

+
+

+polar_axis + public + construct/copy/destruct

+
    +
  1. +
    explicit polar_axis(int n, double start = 0.0, 
    +                    const std::string & label = std::string());
    +

    Constructor +

    +
    ++++ + + + + +

    Parameters:

    ++++ + + + + + + + + + + + + + + +

    label

    description of the axis

    n

    number of bins

    start

    starting phase of the angle

    +
  2. +
  3. polar_axis();
  4. +
  5. polar_axis(const polar_axis &);
  6. +
  7. polar_axis & operator=(const polar_axis &);
  8. +
+
+
+

+polar_axis public member functions

+
    +
  1. +
    int index(double x) const;
    Returns the bin index for the passed argument.
  2. +
  3. double operator[](int idx) const;
  4. +
  5. bool operator==(const polar_axis &) const;
  6. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/real_axis.html b/doc/html/boost/histogram/real_axis.html new file mode 100644 index 000000000..5fa2ea022 --- /dev/null +++ b/doc/html/boost/histogram/real_axis.html @@ -0,0 +1,71 @@ + + + +Class template real_axis + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class template real_axis

+

boost::histogram::real_axis

+
+

Synopsis

+
// In header: <boost/histogram/axis.hpp>
+
+template<typename Derived> 
+class real_axis {
+public:
+  // types
+  typedef double value_type;
+
+  // public member functions
+  double left(int) const;
+  double right(int) const;
+  double center(int) const;
+};
+
+

Description

+
+

+real_axis public member functions

+
    +
  1. double left(int idx) const;
  2. +
  3. double right(int idx) const;
  4. +
  5. double center(int idx) const;
  6. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/regular_axis.html b/doc/html/boost/histogram/regular_axis.html new file mode 100644 index 000000000..f04e46b85 --- /dev/null +++ b/doc/html/boost/histogram/regular_axis.html @@ -0,0 +1,133 @@ + + + +Class regular_axis + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class regular_axis

+

boost::histogram::regular_axis — An axis for real-valued data and bins of equal width. Binning is a O(1) operation.

+
+

Synopsis

+
// In header: <boost/histogram/axis.hpp>
+
+
+class regular_axis : public boost::histogram::axis_base,
+                     public boost::histogram::real_axis< regular_axis >
+{
+public:
+  // construct/copy/destruct
+  regular_axis(int, double, double, const std::string & = std::string(), 
+               bool = true);
+  regular_axis();
+  regular_axis(const regular_axis &);
+  regular_axis & operator=(const regular_axis &);
+
+  // public member functions
+  int index(double) const;
+  double operator[](int) const;
+  bool operator==(const regular_axis &) const;
+};
+
+

Description

+
+

+regular_axis + public + construct/copy/destruct

+
    +
  1. +
    regular_axis(int n, double min, double max, 
    +             const std::string & label = std::string(), bool uoflow = true);
    +

    Constructor

    +

    +

    +
    ++++ + + + + +

    Parameters:

    ++++ + + + + + + + + + + + + + + + + + + + + + + +

    label

    description of the axis

    max

    high edge of last bin

    min

    low edge of first bin

    n

    number of bins

    uoflow

    add underflow and overflow bins to the histogram for this axis or not

    +
  2. +
  3. regular_axis();
  4. +
  5. regular_axis(const regular_axis &);
  6. +
  7. regular_axis & operator=(const regular_axis &);
  8. +
+
+
+

+regular_axis public member functions

+
    +
  1. +
    int index(double x) const;
    Returns the bin index for the passed argument.
  2. +
  3. double operator[](int idx) const;
  4. +
  5. bool operator==(const regular_axis &) const;
  6. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/variable_axis.html b/doc/html/boost/histogram/variable_axis.html new file mode 100644 index 000000000..8b83524dd --- /dev/null +++ b/doc/html/boost/histogram/variable_axis.html @@ -0,0 +1,134 @@ + + + +Class variable_axis + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Class variable_axis

+

boost::histogram::variable_axis — An axis for real-valued data and bins of varying width. Binning is a O(log(N)) operation. If speed matters and the problem domain allows it, prefer a regular_axis.

+
+

Synopsis

+
// In header: <boost/histogram/axis.hpp>
+
+
+class variable_axis : public boost::histogram::axis_base,
+                      public boost::histogram::real_axis< variable_axis >
+{
+public:
+  // construct/copy/destruct
+  template<typename Container> 
+    explicit variable_axis(const Container &, 
+                           const std::string & = std::string(), bool = true);
+  template<typename Iterator> 
+    variable_axis(const Iterator &, const Iterator &, 
+                  const std::string & = std::string(), bool = true);
+  variable_axis();
+  variable_axis(const variable_axis &);
+  variable_axis & operator=(const variable_axis &);
+
+  // public member functions
+  int index(double) const;
+  double operator[](int) const;
+  bool operator==(const variable_axis &) const;
+};
+
+

Description

+
+

+variable_axis + public + construct/copy/destruct

+
    +
  1. +
    template<typename Container> 
    +  explicit variable_axis(const Container & x, 
    +                         const std::string & label = std::string(), 
    +                         bool uoflow = true);
    +

    Constructor

    +

    +

    +
    ++++ + + + + +

    Parameters:

    ++++ + + + + + + + + + + + + + + +

    label

    description of the axis

    uoflow

    add underflow and overflow bins to the histogram for this axis or not

    x

    An axis for real-valued data and bins of varying width. Binning is a O(log(N)) operation. If speed matters and the problem domain allows it, prefer a regular_axis.

    +
  2. +
  3. template<typename Iterator> 
    +  variable_axis(const Iterator & begin, const Iterator & end, 
    +                const std::string & label = std::string(), 
    +                bool uoflow = true);
  4. +
  5. variable_axis();
  6. +
  7. variable_axis(const variable_axis &);
  8. +
  9. variable_axis & operator=(const variable_axis &);
  10. +
+
+
+

+variable_axis public member functions

+
    +
  1. int index(double x) const;
  2. +
  3. double operator[](int idx) const;
  4. +
  5. bool operator==(const variable_axis &) const;
  6. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/visitor/bins.html b/doc/html/boost/histogram/visitor/bins.html new file mode 100644 index 000000000..067d9b93e --- /dev/null +++ b/doc/html/boost/histogram/visitor/bins.html @@ -0,0 +1,62 @@ + + + +Struct bins + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Struct bins

+

boost::histogram::visitor::bins

+
+

Synopsis

+
// In header: <boost/histogram/visitors.hpp>
+
+
+struct bins : public static_visitor< unsigned > {
+
+  // public member functions
+  template<typename A> unsigned operator()(const A &) const;
+};
+
+

Description

+
+

+bins public member functions

+
  1. template<typename A> unsigned operator()(const A & a) const;
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/visitor/cmp.html b/doc/html/boost/histogram/visitor/cmp.html new file mode 100644 index 000000000..c36aac90e --- /dev/null +++ b/doc/html/boost/histogram/visitor/cmp.html @@ -0,0 +1,66 @@ + + + +Struct cmp + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Struct cmp

+

boost::histogram::visitor::cmp

+
+

Synopsis

+
// In header: <boost/histogram/visitors.hpp>
+
+
+struct cmp : public static_visitor< bool > {
+
+  // public member functions
+  template<typename T> bool operator()(const T &, const T &) const;
+  template<typename T, typename U> bool operator()(const T &, const U &) const;
+};
+
+

Description

+
+

+cmp public member functions

+
    +
  1. template<typename T> bool operator()(const T & a, const T & b) const;
  2. +
  3. template<typename T, typename U> bool operator()(const T &, const U &) const;
  4. +
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/visitor/index.html b/doc/html/boost/histogram/visitor/index.html new file mode 100644 index 000000000..74a515789 --- /dev/null +++ b/doc/html/boost/histogram/visitor/index.html @@ -0,0 +1,74 @@ + + + +Struct index + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Struct index

+

boost::histogram::visitor::index

+
+

Synopsis

+
// In header: <boost/histogram/visitors.hpp>
+
+
+struct index : public static_visitor< int > {
+  // construct/copy/destruct
+  index(double);
+
+  // public member functions
+  template<typename A> int operator()(const A &) const;
+
+  // public data members
+  double x;
+};
+
+

Description

+
+

+index + public + construct/copy/destruct

+
  1. index(double d);
+
+
+

+index public member functions

+
  1. template<typename A> int operator()(const A & a) const;
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/visitor/shape.html b/doc/html/boost/histogram/visitor/shape.html new file mode 100644 index 000000000..a84489424 --- /dev/null +++ b/doc/html/boost/histogram/visitor/shape.html @@ -0,0 +1,62 @@ + + + +Struct shape + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Struct shape

+

boost::histogram::visitor::shape

+
+

Synopsis

+
// In header: <boost/histogram/visitors.hpp>
+
+
+struct shape : public static_visitor< unsigned > {
+
+  // public member functions
+  template<typename A> unsigned operator()(const A &) const;
+};
+
+

Description

+
+

+shape public member functions

+
  1. template<typename A> unsigned operator()(const A & a) const;
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost/histogram/visitor/uoflow.html b/doc/html/boost/histogram/visitor/uoflow.html new file mode 100644 index 000000000..fb99d3770 --- /dev/null +++ b/doc/html/boost/histogram/visitor/uoflow.html @@ -0,0 +1,62 @@ + + + +Struct uoflow + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+
+

Struct uoflow

+

boost::histogram::visitor::uoflow

+
+

Synopsis

+
// In header: <boost/histogram/visitors.hpp>
+
+
+struct uoflow : public static_visitor< bool > {
+
+  // public member functions
+  template<typename A> bool operator()(const A &) const;
+};
+
+

Description

+
+

+uoflow public member functions

+
  1. template<typename A> bool operator()(const A & a) const;
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_histogram/changelog.html b/doc/html/boost_histogram/changelog.html new file mode 100644 index 000000000..5a359b9c5 --- /dev/null +++ b/doc/html/boost_histogram/changelog.html @@ -0,0 +1,40 @@ + + + +Changelog + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHome +
+ + + + +
+
+
+PrevUpHome +
+ + diff --git a/doc/html/boost_histogram/introduction.html b/doc/html/boost_histogram/introduction.html new file mode 100644 index 000000000..473595f5d --- /dev/null +++ b/doc/html/boost_histogram/introduction.html @@ -0,0 +1,92 @@ + + + +Introduction + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Histograms are a basic tool in every statistical analysis. They compactly represent + a data set of one or several random variables with acceptable loss of information. + It is often more convenient to work with a histogram of a data distribution, + instead of the original distribution which may consume a lot of memory or disc + space. Interesting quantities like the mean, variance, or mode may be extracted + from the histogram instead of the original data set. +

+

+ This library implements a single histogram class with a simple interface, which + can be used with 1, 2, 3 or N-dimensional data sets (the internal limit is + set to 16 dimensions). It supports normal counting and weighted counting, and + its provides a data-driven variance estimate for the sum of the counts in either + case. The histogram was written so that it just works, + to be efficient and safe to use in its application domain, completely hiding + the implementation details on how it does its counting (you, + the user, have more important things to worry about). +

+

+ The histogram is implemented in C++ and has Python-bindings. It passes the + language barrier without copying its internal (possibly large) data buffer. + The language transparency allows users who do data analysis in Python to create + an empty histogram instance in Python, pass it over to a complex C++ code for + filling, then analyse the results:: +

+

+

+
import histogram as hg
+import complex_cpp_module
+
+h = hg.histogram(hg.regular_axis(100, 0, 1))
+
+complex_cpp_module.run_filling(h)
+
+# h is now filled with data,
+# continue with statistical analysis of h
+
+

+

+

+ Histograms can be added if they have the same signature. This is convenient + if histograms are filled in parallel on a cluster and then merged (added). +

+

+ The histogram can be serialized to disk for persistent storage from C++ and + pickled in Python. It comes with Numpy support, too. The histogram can be fast-filled + with Numpy arrays for maximum performance, and viewed as a Numpy array without + copying its memory buffer. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_histogram/motivation.html b/doc/html/boost_histogram/motivation.html new file mode 100644 index 000000000..1e6c028cc --- /dev/null +++ b/doc/html/boost_histogram/motivation.html @@ -0,0 +1,64 @@ + + + +Motivation + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ There is a lack of a widely-used, free histogram class. While it is easy to + write an 1-dimensional histogram, writing an n-dimensional histogram poses + more of a challenge. If you add serialization and Python/Numpy support onto + the wish-list, the air becomes thin. +

+

+ The main competitor is the ROOT framework. + The histogram in this project is designed to be more convenient to use, and + as fast or faster than the equivalent ROOT histograms. It comes without heavy + baggage, instead it has a clean and modern C++ design which follows the advice + given in popular C++ books, like those of Meyers + and Sutter and Alexandrescu. +

+

+ Two of the main design goals are to conveniently hide the internal details + on how things are counted, and to use the same interface for 1-dimensional + and n-dimensional histograms. The count storage is an implementation detail, + chosen automatically to be fast and efficient. The histogram should just work, users shouldn't be forced to make choices + among several storage options everytime they encounter a new data set. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_histogram/notes.html b/doc/html/boost_histogram/notes.html new file mode 100644 index 000000000..b358cef27 --- /dev/null +++ b/doc/html/boost_histogram/notes.html @@ -0,0 +1,526 @@ + + + +Notes + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+Notes +

+ +
+ +
    +
  • + Boost +
  • +
  • + CMake +
  • +
  • + Optional dependencies* +
      +
    • + Python for Python + bindings +
    • +
    • + Numpy for Numpy support +
    • +
    • + Sphinx to (re)build + this documentation +
    • +
    +
  • +
+
+
+ +

+

+
git clone https://github.com/HDembinski/histogram.git
+mkdir build && cd build
+cmake ../histogram/build
+make install
+
+

+

+

+ Do make test + to run the tests, or ctest -V for + more output. +

+
+ + + + + +
[Note]Note

+ I couldn't figure out a proper way to install the Python module with CMake, + so for the time being, CMake will print a message with manual instructions + instead. The main problem is how to pick the right dist-packages path in + a platform-independent way, and such that it respects the CMAKE_INSTALL_PREFIX +

+
+
+

+Tests +

+

+ Most of the C++ interface is implicitly tested in the tests of the Python + interface, which in turn calls the C++ interface. +

+
+
+

+Checks +

+

+ Some checks are included in test/check. + These are not strictly tests, and not strictly examples, yet they provide + useful information that belongs with the library code. They are not build + by default, building can be activated with the CMake flag BUILD_CHECKS. +

+
+
+ +

+ The Python and C++ interface are indentical - except when they are not. The + exceptions concern cases where a more elegant and pythonic way of implementing + things exists. In a few cases, the C++ classes have extra member functions + for convenience, which are not needed on the Python side. +

+

+ Properties Getter/setter-like functions are wrapped as properties. +

+

+ Keyword-based parameters C++ member functions :cpp:func:histogram::fill + and :cpp:func:histogram::wfill are wrapped by the single Python + member function :py:func:histogram.fill with + an optional keyword parameter w + to pass a weight. +

+

+ C++ convenience C++ member function :cpp:func:histogram::bins + is omitted on the Python side, since it is very easy to just query this directly + from the axis object in Python. On the C++ side, this would require a extra + type cast or applying a visitor. +

+
+
+ +

+ One design goal of this project is to be fast. The act of filling the histogram + with a number should be insignificant compared to the CPU cycles spend to + retrieve/generate that number. Naturally, we also want to beat the competition. +

+

+ The following table shows results of a simple benchmark against +

+
    +
  • + TH1I, TH3I + and THnI of the ROOT framework +
  • +
  • + histogram and histogramdd from the Python module + numpy +
  • +
+

+ The benchmark against ROOT is implemented in C++, the benchmark against numpy + in Python. +

+

+ Remarks: +

+
    +
  • + The comparison with ROOT puts ROOT at the advantage, since TH1I and TH3I + are specialized classes for 1 dimension and 3 dimensions, not a general + class for N-dimensions like boost::histogram. + ROOT histograms also lack a comparably flexible system to define different + binning schemes for each axis. +
  • +
  • + Large vectors are pre-allocated and with random numbers drawn from a + uniform or normal distribution for all tests. In the timed part, these + numbers are read from the vector and put into the histograms. This reduces + the overhead merely to memory access. +
  • +
  • + The test with uniform random numbers never fills the overflow and underflow + bins, while the test with random numbers from a normal distribution does. + This explains some of the differences between the two distributions. +
  • +
  • + All tests are repeated 10 times, the minimum is shown. +
  • +
+
+

Table 1.1. Test system: Intel Core i7-4500U CPU clocked at 1.8 GHz, 8 GB of DDR3 + RAM

+
+++++ + + + + + + + + + + +
+

+ distribution +

+
+

+ uniform +

+
+

+ normal +

+
+
+

Table 1.2. distribution

+
+ + + + + + + + + +
+

+ dimension +

+
+

+ No. of fills +

+
+

+ C++: ROOT [t/s] +

+
+

+ C++: boost [t/s] +

+
+

+ Py: numpy [t/s] +

+
+

+ Py: boost [t/s] +

+
+
+
+
+
+

Table 1.3. uniform

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ 1D +

+
+

+ 3D +

+
+

+ 6D +

+
+

+ 12M +

+
+

+ 4M +

+
+

+ 2M +

+
+

+ 0.127 +

+
+

+ 0.199 +

+
+

+ 0.185 +

+
+

+ 0.172 +

+
+

+ 0.177 +

+
+

+ 0.155 +

+
+

+ 0.825 +

+
+

+ 0.727 +

+
+

+ 0.436 +

+
+

+ 0.209 +

+
+

+ 0.229 +

+
+

+ 0.192 +

+
+
+
+
+
+

Table 1.4. normal

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ 1D +

+
+

+ 3D +

+
+

+ 6D +

+
+

+ 12M +

+
+

+ 4M +

+
+

+ 2M +

+
+

+ 0.168 +

+
+

+ 0.143 +

+
+

+ 0.179 +

+
+

+ 0.172 +

+
+

+ 0.171 +

+
+

+ 0.150 +

+
+

+ 0.824 +

+
+

+ 0.426 +

+
+

+ 0.401 +

+
+

+ 0.207 +

+
+

+ 0.194 +

+
+

+ 0.168 +

+
+
+
+
+
+

+ boost::histogram::histogram + shows consistent performance comparable to the specialized ROOT histograms. + It is faster than ROOT's implementation of a N-dimensional histogram THnI. The performance of boost::histogram::histogram + is similar in C++ and Python, showing only a small overhead in Python. It + is consistently faster than numpy's histogram functions. +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_histogram/rationale.html b/doc/html/boost_histogram/rationale.html new file mode 100644 index 000000000..4eb5f62e9 --- /dev/null +++ b/doc/html/boost_histogram/rationale.html @@ -0,0 +1,189 @@ + + + +Rationale + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ I designed the histogram based on a decade of experience collected in working + with Big Data, more precisely in the field of particle physics and astroparticle + physics. In many ways, the ROOT <https://root.cern.ch>_ histograms served as an example of not to do it. +

+
+ +
    +
  • + "Do one thing and do it well", Doug McIlroy +
  • +
  • + The Zen of Python + (also applies to other languages). +
  • +
+
+
+ +

+ A histogram should have the same consistent interface whatever the dimension. + Like std::vector it should just + work, users shouldn't be forced to make a + priori choices among several histogram classes and options everytime + they encounter a new data set. +

+
+
+ +

+ Python is a great language for data analysis, so the histogram needs Python + bindings. The histogram should be usable as an interface between a complex + simulation or data-storage system written in C++ and data-analysis/plotting + in Python: define the histogram in Python, let it be filled on the C++ side, + and then get it back for further data analysis or plotting. +

+

+ Data analysis in Python is Numpy-based, so Numpy support is a must. +

+
+
+ +

+ The histogram supports half a dozent different binning strategies, conveniently + encapsulated in axis objects. There is the standard sorting of real-valued + data into bins of equal or varying width, but also binning of angles or integer + values. +

+

+ Extra bins that count over- and underflow values are added by default. This + feature can be turned off individually for each axis. The extra bins do not + disturb normal bin counting. On an axis with n + bins, the first bin has the index 0, + the last bin n-1, while the under- and overflow bins are accessible + at -1 + and n, respectively. +

+
+
+ +

+ Dense storage in memory is a must for high performance. Unfortunately, the + curse + of dimensionality quickly become a problem as the number of dimensions + grows, leading to histograms which consume large amounts (up to GBs) of memory. +

+

+ Fortunately, having many dimensions typically reduces the number of counts + per bin, since counts get spread over many dimensions. The histogram uses + an adaptive count size per bin to be as memory-efficient as possible, by + starting with the smallest integer size per bin of 1 byte and increasing + as needed to up to 8 byte. A std::vector + grows in length as new elements are added, + while the count storage grows in depth. +

+
+
+ +

+ A histogram categorizes and counts, so the natural choice for the data type + of the counts are integers. However, in particle physics, histograms are + also often filled with weighted events, for example, to make sure that two + histograms look the same in one variable, while the distribution of another, + correlated variable is a subject of study. +

+

+ The histogram can be filled with either weighted or unweighted counts. In + the weighted case, the sum of weights is stored in a double. + The histogram provides a variance estimate is both cases. In the unweighted + case, the estimate is computed from the count itself, using Poisson-theory. + In the weighted case, the sum of squared weights is stored alongside the + sum of weights in a second double, + and used to compute a variance estimate. +

+
+
+ +

+ Serialization is implemented using boost::serialization. + Pickling in Python is implemented based on the C++ serialization code. To + ensure portability of the pickled histogram, the pickle string is an ASCII + representation of the histogram, generated with the boost::archive::text_oarchive. + It would be great to switch to a portable binary representation in the future, + when that becomes available. +

+

+ To reduce the size of the string, run-length encoding is applied (zero-suppression) + to sequences of zeros. Partly filled histograms often contain large sequences + of zeros. +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_histogram/references.html b/doc/html/boost_histogram/references.html new file mode 100644 index 000000000..9266fb8b1 --- /dev/null +++ b/doc/html/boost_histogram/references.html @@ -0,0 +1,56 @@ + + + +References + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_histogram/tutorial.html b/doc/html/boost_histogram/tutorial.html new file mode 100644 index 000000000..0406dd623 --- /dev/null +++ b/doc/html/boost_histogram/tutorial.html @@ -0,0 +1,191 @@ + + + +Tutorial + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
+ +

+ How to make a 1d-histogram in C++ and to fill it: +

+
#include <boost/histogram/histogram.hpp>
+#include <boost/histogram/axis.hpp>
+#include <iostream>
+#include <cmath>
+
+int main(int, char**) {
+    namespace bh = boost::histogram;
+
+    /* Create a 1-d histogram with an axis that has 10 bins
+     * of equal width, covering the real line in the interval
+     * [-1.0, 2.0), label it 'x'.
+     * Several other binning strategies are supported, see
+     * documentation of axis_types.
+     */
+    bh::histogram h(bh::regular_axis(10, -1.0, 2.0, "x"));
+
+    /* Fill histogram with a few entries. Values outside of
+     * axis are placed in the overflow and underflow bins.
+     * Normally you would loop over a source of values.
+     */
+    h.fill(-1.5); // put in underflow bin
+    h.fill(-0.5);
+    h.fill(1.1);
+    h.fill(-1.0); // included, interval is semi-open
+    h.fill(0.3);
+    h.fill(1.7);
+    h.fill(2.0);  // put in overflow bin, interval is semi-open
+    h.fill(20.0); // put in overflow bin
+
+    /* Fill histogram with a weighted count. This increases the
+     * bin counter not by one, but by the specified weight.
+     *
+     * This call transparently causes histogram to change it memory
+     * layout to store counts as doubles instead of integers. The
+     * layout for weighted counts requires up to 16x more memory
+     * and will cause inaccuracies of the type a + 1 == a if a is
+     * sufficiently large.
+     *
+     * Use wfill(...) if you have to, else prefer fill(...).
+     */
+    h.wfill(0.1, 5.0);
+
+    /* Print a table representation of the histogram showing the bin
+     * value and a estimate of the standard deviation. Overflow and
+     * Underflow bins are accessed naturally as the bins -1 and 10.
+     */
+    for (int i = -1; i <= h.bins(0); ++i) {
+        const bh::regular_axis& a = h.axis<bh::regular_axis>(0);
+        std::cout << "bin " << i
+                  << " x in [" << a[i] << ", " << a[i+1] << "): "
+                  << h.value(i) << " +/- " << std::sqrt(h.variance(i))
+                  << std::endl;
+    }
+}
+
+

+

+

+ The program output is: +

+

+

+
bin -1 x in [-inf, -1): 1 +/- 1
+bin 0 x in [-1, -0.7): 1 +/- 1
+bin 1 x in [-0.7, -0.4): 1 +/- 1
+bin 2 x in [-0.4, -0.1): 0 +/- 0
+bin 3 x in [-0.1, 0.2): 5 +/- 5
+bin 4 x in [0.2, 0.5): 1 +/- 1
+bin 5 x in [0.5, 0.8): 0 +/- 0
+bin 6 x in [0.8, 1.1): 0 +/- 0
+bin 7 x in [1.1, 1.4): 1 +/- 1
+bin 8 x in [1.4, 1.7): 0 +/- 0
+bin 9 x in [1.7, 2): 1 +/- 1
+bin 10 x in [2, inf): 2 +/- 1.41421
+
+

+

+
+
+ +

+ How to make a 2d-histogram in Python and to fill it using a Numpy array: +

+

+

+
import histogram as bh
+import numpy as np
+
+# create a 2d-histogram without underflow and overflow bins
+# for polar coordinates, using a specialized polar_axis for
+# the binning of the angle 'phi'
+#
+# radial axis with label 'radius' has 10 bins from 0.0 to 5.0
+# polar axis with label 'phi' has 4 bins and a phase of 0.0
+h = bh.histogram(bh.regular_axis(10, 0.0, 5.0, "radius",
+                                 uoflow=False),
+                 bh.polar_axis(4, 0.0, "phi"))
+
+# fill histogram with random values, using numpy to make 
+# a two-dimensional normal distribution in cartesian coordinates
+x = np.random.randn(1000)             # generate x
+y = np.random.randn(1000)             # generate y
+rphi = np.empty((1000, 2))
+rphi[:, 0] = (x ** 2 + y ** 2) ** 0.5 # compute radius
+rphi[:, 1] = np.arctan2(y, x)         # compute phi
+h.fill(rphi)
+
+# access counts as a numpy array (no data is copied)
+count_matrix = np.asarray(h)
+
+print count_matrix
+
+

+ The program output are the counts per bin as a 2d-array: +

+

+

+
[[37 26 33 37]
+ [60 69 76 62]
+ [48 80 80 77]
+ [38 49 45 49]
+ [22 24 20 23]
+ [ 7  9  9  8]
+ [ 3  2  3  3]
+ [ 0  0  0  0]
+ [ 0  1  0  0]
+ [ 0  0  0  0]]
+
+

+

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/histogram/reference.html b/doc/html/histogram/reference.html new file mode 100644 index 000000000..daa5fc191 --- /dev/null +++ b/doc/html/histogram/reference.html @@ -0,0 +1,150 @@ + + + +Reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+Reference

+ +
+ +

Includes all the non-experimental headers of the Boost.histogram library.

+

The library consists of a single histogram and several axis types which are stored in a boost::variant called axis_type The axis types are created and passed to the constructor of the histogram to define its binning scheme. All following types are embedded in the boost::histogram namespace, which is omitted for brevity.

+
+
+ +

Defines the core class of this library, boost::histogram::histogram .

+
+
+BOOST_HISTOGRAM_CTOR(z, n, unused)
+BOOST_HISTOGRAM_FILL(z, n, unused)
+BOOST_HISTOGRAM_WFILL(z, n, unused)
+BOOST_HISTOGRAM_VALUE(z, n, unused)
+BOOST_HISTOGRAM_VARIANCE(z, n, unused)
+
namespace boost {
+  namespace histogram {
+    class histogram;
+    histogram operator+(const histogram & a, const histogram & b);
+  }
+}
+
+
+ +
namespace boost {
+  namespace histogram {
+    class axis_base;
+    template<typename Derived> class real_axis;
+    class regular_axis;
+    class polar_axis;
+    class variable_axis;
+    class category_axis;
+    class integer_axis;
+
+    typedef variant< regular_axis, polar_axis, variable_axis, category_axis, integer_axis > axis_type;
+    std::ostream & operator<<(std::ostream &, const regular_axis &);
+    std::ostream & operator<<(std::ostream &, const polar_axis &);
+    std::ostream & operator<<(std::ostream &, const variable_axis &);
+    std::ostream & operator<<(std::ostream &, const category_axis &);
+    std::ostream & operator<<(std::ostream &, const integer_axis &);
+  }
+}
+
+
+ +
+
+BOOST_HISTOGRAM_AXIS_LIMIT
+BOOST_HISTOGRAM_BASE_APPEND(z, n, unused)
+BOOST_HISTOGRAM_BASE_CTOR(z, n, unused)
+
namespace boost {
+  namespace histogram {
+    class basic_histogram;
+  }
+}
+
+
+ +

Defines the serialization functions, to use with boost.serialize.

+
namespace boost {
+  namespace histogram {
+    template<typename Archive> 
+      void serialize(Archive & ar, axis_base & base, unsigned version);
+    template<typename Archive> 
+      void serialize(Archive & ar, regular_axis & axis, unsigned version);
+    template<typename Archive> 
+      void serialize(Archive & ar, polar_axis & axis, unsigned version);
+    template<typename Archive> 
+      void serialize(Archive & ar, variable_axis & axis, unsigned version);
+    template<typename Archive> 
+      void serialize(Archive & ar, category_axis & axis, unsigned version);
+    template<typename Archive> 
+      void serialize(Archive & ar, integer_axis & axis, unsigned version);
+    template<typename Archive> 
+      void serialize(Archive & ar, basic_histogram & h, unsigned version);
+    template<typename Archive> 
+      void serialize(Archive & ar, histogram & h, unsigned version);
+  }
+}
+
+
+ +
namespace boost {
+  namespace histogram {
+    namespace visitor {
+      struct bins;
+      struct shape;
+      struct uoflow;
+      struct index;
+      struct cmp;
+    }
+  }
+}
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/index.html b/doc/html/index.html new file mode 100644 index 000000000..ae17b584f --- /dev/null +++ b/doc/html/index.html @@ -0,0 +1,115 @@ + + + +Chapter 1. Boost.Histogram + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
Next
+
+
+

+Chapter 1. Boost.Histogram

+

+Hans Dembinski +

+
+
+

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +

+
+
+ +
+ +

+ This project contains an easy-to-use powerful n-dimensional histogram class + implemented in C++03, optimized for convenience and excellent performance under + heavy duty. Move semantics are supported using boost::move. The + histogram has a complete C++ and a Python + interface, and can be passed over the language boundary with ease. Numpy + is fully supported; histograms can be filled with Numpy arrays at C speeds + and are convertible into Numpy arrays without copying data. Histograms can + be streamed from/to files and pickled in Python. +

+

+ My goal is to submit this project to the Boost + Libraries +

+
+
+ + + +

Last revised: July 12, 2016 at 22:56:41 GMT

+
+
Next
+ + diff --git a/doc/html/standalone_HTML.manifest b/doc/html/standalone_HTML.manifest new file mode 100644 index 000000000..463ee72fb --- /dev/null +++ b/doc/html/standalone_HTML.manifest @@ -0,0 +1,31 @@ +index.html +boost_histogram/motivation.html +boost_histogram/introduction.html +boost_histogram/tutorial.html +boost_histogram/notes.html +boost_histogram/rationale.html +boost_histogram/references.html +histogram/reference.html +boost/histogram/histogram.html +BOOST_HISTOGRAM_CTOR.html +BOOST_HISTOGRAM_FILL.html +BOOST_HISTOGRAM_WFILL.html +BOOST_HISTOGRAM_VALUE.html +BOOST_HISTOGRAM_VARIANCE.html +boost/histogram/axis_base.html +boost/histogram/real_axis.html +boost/histogram/regular_axis.html +boost/histogram/polar_axis.html +boost/histogram/variable_axis.html +boost/histogram/category_axis.html +boost/histogram/integer_axis.html +boost/histogram/basic_histogram.html +BOOST_HISTOGRAM_AXIS_LIMIT.html +BOOST_HISTOGRAM_BASE_APPEND.html +BOOST_HISTOGRAM_BASE_CTOR.html +boost/histogram/visitor/bins.html +boost/histogram/visitor/shape.html +boost/histogram/visitor/uoflow.html +boost/histogram/visitor/index.html +boost/histogram/visitor/cmp.html +boost_histogram/changelog.html