1 // Copyright 2015-2019 Hans Dembinski
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)
7 #ifndef BOOST_HISTOGRAM_FWD_HPP
8 #define BOOST_HISTOGRAM_FWD_HPP
11 \file boost/histogram/fwd.hpp
12 Forward declarations, tag types and type aliases.
15 #include <boost/config.hpp> // BOOST_ATTRIBUTE_NODISCARD
16 #include <boost/core/use_default.hpp>
22 /// Tag type to indicate use of a default type
23 using boost::use_default;
27 /// Integral type for axis indices
28 using index_type = int;
30 /// Real type for axis indices
31 using real_index_type = double;
33 /// Empty metadata type
35 template <class Archive>
36 void serialize(Archive&, unsigned /* version */) {}
39 /// Another alias for an empty metadata type
40 using empty_type = null_type;
42 #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
49 } // namespace transform
51 template <class Value = double, class Transform = use_default,
52 class MetaData = use_default, class Options = use_default>
55 template <class Value = int, class MetaData = use_default, class Options = use_default>
58 template <class Value = double, class MetaData = use_default, class Options = use_default,
59 class Allocator = std::allocator<Value>>
62 template <class Value = int, class MetaData = use_default, class Options = use_default,
63 class Allocator = std::allocator<Value>>
66 template <class... Ts>
69 #endif // BOOST_HISTOGRAM_DOXYGEN_INVOKED
73 #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
81 namespace accumulators {
82 template <class Value = double>
84 template <class Value = double>
86 template <class Value = double>
88 template <class Value = double>
95 struct is_thread_safe : std::false_type {};
97 struct is_thread_safe<thread_safe<T>> : std::true_type {};
98 } // namespace accumulators
100 struct unsafe_access;
102 template <class Allocator = std::allocator<char>>
103 class unlimited_storage;
106 class storage_adaptor;
108 #endif // BOOST_HISTOGRAM_DOXYGEN_INVOKED
110 /// Vector-like storage for fast zero-overhead access to cells.
111 template <class T, class A = std::allocator<T>>
112 using dense_storage = storage_adaptor<std::vector<T, A>>;
114 /// Default storage, optimized for unweighted histograms
115 using default_storage = unlimited_storage<>;
117 /// Dense storage which tracks sums of weights and a variance estimate.
118 using weight_storage = dense_storage<accumulators::weighted_sum<>>;
120 /// Dense storage which tracks means of samples in each cell.
121 using profile_storage = dense_storage<accumulators::mean<>>;
123 /// Dense storage which tracks means of weighted samples in each cell.
124 using weighted_profile_storage = dense_storage<accumulators::weighted_mean<>>;
126 #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
128 template <class Axes, class Storage = default_storage>
129 class BOOST_ATTRIBUTE_NODISCARD histogram;
132 } // namespace histogram