Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function template sum

boost::histogram::algorithm::sum — Compute the sum over all histogram cells, including underflow/overflow bins.

Synopsis

// In header: <boost/histogram/algorithm/sum.hpp>


template<typename A, typename S> auto sum(const histogram< A, S > & h);

Description

If the value type of the histogram is an integral or floating point type, boost::accumulators::sum<double> is used to compute the sum, else the original value type is used. Compilation fails, if the value type does not support operator+=.

Return type is double if the value type of the histogram is integral or floating point, and the original value type otherwise.


PrevUpHomeNext