guide_make_static_histogram.cpp 566 B

1234567891011121314151617181920212223
  1. // Copyright 2015-2018 Hans Dembinski
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt
  5. // or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //[ guide_make_static_histogram
  7. #include <boost/histogram.hpp>
  8. #include <cassert>
  9. int main() {
  10. using namespace boost::histogram;
  11. // create a 1d-histogram in default configuration which
  12. // covers the real line from -1 to 1 in 100 bins
  13. auto h = make_histogram(axis::regular<>(100, -1.0, 1.0));
  14. // rank is the number of axes
  15. assert(h.rank() == 1);
  16. }
  17. //]