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

Class template count

boost::histogram::accumulators::count — Uses a C++ builtin arithmetic type to accumulate a count.

Synopsis

// In header: <boost/histogram/accumulators/count.hpp>

template<typename ValueType> 
class count {
public:
  // types
  typedef ValueType          value_type;     
  typedef const value_type & const_reference;

  // construct/copy/destruct
  count() = default;
  count(const_reference) noexcept;
  template<typename T> count(const count< T > &) noexcept;

  // public member functions
  count & operator++() noexcept;
  count & operator+=(const_reference) noexcept;
  count & operator+=(const count &) noexcept;
  count & operator *=(const_reference) noexcept;
  bool operator==(const count &) const noexcept;
  bool operator!=(const count &) const noexcept;
  const_reference value() const noexcept;
  explicit operator value_type() const noexcept;
  template<typename Archive> void serialize(Archive &, unsigned);
  count & operator *=(const count &) noexcept;
  count operator *(const count &) const noexcept;
  count & operator/=(const count &) noexcept;
  count operator/(const count &) const noexcept;
  bool operator<(const count &) const noexcept;
  bool operator>(const count &) const noexcept;
  bool operator<=(const count &) const noexcept;
  bool operator>=(const count &) const noexcept;
};

Description

This wrapper class may be used as a base class by users who want to add custom metadata to each bin of a histogram. Otherwise, arithmetic types should be used directly as accumulators in storages for simplicity. In other words, prefer dense_storage<double> overdense_storage<count<double>>, both are functionally equivalent.

When weighted data is accumulated and high precision is required, use accumulators::sum instead. If a local variance estimate for the weight distribution should be computed as well (generally needed for a detailed statistical analysis), useaccumulators::weighted_sum.

count public construct/copy/destruct

  1. count() = default;
  2. count(const_reference value) noexcept;
    Initialize count to value and allow implicit conversion.
  3. template<typename T> count(const count< T > & c) noexcept;
    Allow implicit conversion from other count.

count public member functions

  1. count & operator++() noexcept;
    Increment count by one.
  2. count & operator+=(const_reference value) noexcept;
    Increment count by value.
  3. count & operator+=(const count & s) noexcept;
    Add another count.
  4. count & operator *=(const_reference value) noexcept;
    Scale by value.
  5. bool operator==(const count & rhs) const noexcept;
  6. bool operator!=(const count & rhs) const noexcept;
  7. const_reference value() const noexcept;
    Return count.
  8. explicit operator value_type() const noexcept;
  9. template<typename Archive> void serialize(Archive & ar, unsigned);
  10. count & operator *=(const count & rhs) noexcept;
  11. count operator *(const count & rhs) const noexcept;
  12. count & operator/=(const count & rhs) noexcept;
  13. count operator/(const count & rhs) const noexcept;
  14. bool operator<(const count & rhs) const noexcept;
  15. bool operator>(const count & rhs) const noexcept;
  16. bool operator<=(const count & rhs) const noexcept;
  17. bool operator>=(const count & rhs) const noexcept;

PrevUpHomeNext