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 // some forward declarations must be hidden from doxygen to fix the reference docu :(
43 #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
55 } // namespace transform
57 template <class Value = double, class Transform = use_default,
58 class MetaData = use_default, class Options = use_default>
61 template <class Value = int, class MetaData = use_default, class Options = use_default>
64 template <class Value = double, class MetaData = use_default, class Options = use_default,
65 class Allocator = std::allocator<Value>>
68 template <class Value = int, class MetaData = use_default, class Options = use_default,
69 class Allocator = std::allocator<Value>>
72 template <class... Ts>
75 #endif // BOOST_HISTOGRAM_DOXYGEN_INVOKED
79 #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
87 namespace accumulators {
89 template <class ValueType = double>
92 template <class ValueType = double>
95 template <class ValueType = double>
98 template <class ValueType = double>
101 template <class ValueType = double>
108 struct is_thread_safe : std::false_type {};
110 struct is_thread_safe<thread_safe<T>> : std::true_type {};
112 } // namespace accumulators
114 struct unsafe_access;
116 template <class Allocator = std::allocator<char>>
117 class unlimited_storage;
120 class storage_adaptor;
122 #endif // BOOST_HISTOGRAM_DOXYGEN_INVOKED
124 /// Vector-like storage for fast zero-overhead access to cells.
125 template <class T, class A = std::allocator<T>>
126 using dense_storage = storage_adaptor<std::vector<T, A>>;
128 /// Default storage, optimized for unweighted histograms
129 using default_storage = unlimited_storage<>;
131 /// Dense storage which tracks sums of weights and a variance estimate.
132 using weight_storage = dense_storage<accumulators::weighted_sum<>>;
134 /// Dense storage which tracks means of samples in each cell.
135 using profile_storage = dense_storage<accumulators::mean<>>;
137 /// Dense storage which tracks means of weighted samples in each cell.
138 using weighted_profile_storage = dense_storage<accumulators::weighted_mean<>>;
140 // some forward declarations must be hidden from doxygen to fix the reference docu :(
141 #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
143 template <class Axes, class Storage = default_storage>
144 class BOOST_ATTRIBUTE_NODISCARD histogram;
146 #endif // BOOST_HISTOGRAM_DOXYGEN_INVOKED
148 } // namespace histogram