diff --git a/doc/guide.qbk b/doc/guide.qbk index 4de2be20..a27c79ef 100644 --- a/doc/guide.qbk +++ b/doc/guide.qbk @@ -20,7 +20,7 @@ The term /histogram/ is usually reserved for something that has bins over contin [section Static or dynamic histogram] -The histogram class comes in two variants with a common interface, see the [link histogram.rationale.histogram_types rationale] for more information. Using a [classref boost::histogram::histogram static histogram] is recommended. You need a [classref boost::histogram::histogram dynamic histogram] instead, if: +The histogram class comes in two variants with a common interface, see the [link histogram.rationale.histogram_types rationale] for more information. Using a [classref boost::histogram::static_histogram static histogram] is recommended. You need a [classref boost::histogram::dynamic_histogram dynamic histogram] instead, if: * you only know the histogram configurations at runtime, not at compile-time @@ -40,6 +40,7 @@ int main() { create a 1d-histogram in default configuration which covers the real line from -1 to 1 in 100 bins, the same call with `make_dynamic_histogram` would also work + */ auto h = bh::make_static_histogram(bh::axis::regular<>(100, -1, 1)); // do something with h @@ -394,7 +395,7 @@ Simple ostream operators are shipped with the library, which are internally used [c++]`` #include -#include +#include #include namespace bh = boost::histogram; @@ -686,7 +687,7 @@ namespace bh = boost::histogram; namespace bp = boost::python; // function that runs in C++ and accepts reference to dynamic histogram -void process(bh::histogram& h) { +void process(bh::dynamic_histogram& h) { // fill histogram, in reality this would be arbitrarily complex code for (int i = 0; i < 4; ++i) h.fill(0.25 * i, i); diff --git a/include/boost/histogram.hpp b/include/boost/histogram.hpp index 9a33c6b2..f965d376 100644 --- a/include/boost/histogram.hpp +++ b/include/boost/histogram.hpp @@ -7,7 +7,7 @@ #ifndef BOOST_HISTOGRAM_HPP_ #define BOOST_HISTOGRAM_HPP_ -#include +#include #include #include #include diff --git a/include/boost/histogram/arithmetic_operators.hpp b/include/boost/histogram/arithmetic_operators.hpp new file mode 100644 index 00000000..7372cce7 --- /dev/null +++ b/include/boost/histogram/arithmetic_operators.hpp @@ -0,0 +1,96 @@ +// Copyright 2015-2016 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) + +#ifndef _BOOST_HISTOGRAM_HISTOGRAM_ARITHMETIC_OPERATORS_HPP_ +#define _BOOST_HISTOGRAM_HISTOGRAM_ARITHMETIC_OPERATORS_HPP_ + +#include + +namespace boost { +namespace histogram { + +template