Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:12

0001 // Copyright 2015-2019 Hans Dembinski
0002 //
0003 // Distributed under the Boost Software License, Version 1.0.
0004 // (See accompanying file LICENSE_1_0.txt
0005 // or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_HISTOGRAM_FWD_HPP
0008 #define BOOST_HISTOGRAM_FWD_HPP
0009 
0010 /**
0011   \file boost/histogram/fwd.hpp
0012   Forward declarations, tag types and type aliases.
0013 */
0014 
0015 #include <boost/config.hpp> // BOOST_ATTRIBUTE_NODISCARD
0016 #include <boost/core/use_default.hpp>
0017 #include <tuple>
0018 #include <type_traits>
0019 #include <vector>
0020 
0021 namespace boost {
0022 namespace histogram {
0023 
0024 /// Tag type to indicate use of a default type
0025 using boost::use_default;
0026 
0027 namespace axis {
0028 
0029 /// Integral type for axis indices
0030 using index_type = int;
0031 
0032 /// Real type for axis indices
0033 using real_index_type = double;
0034 
0035 /// Empty metadata type
0036 struct null_type {
0037   template <class Archive>
0038   void serialize(Archive&, unsigned /* version */) {}
0039 };
0040 
0041 /// Another alias for an empty metadata type
0042 using empty_type = null_type;
0043 
0044 // some forward declarations must be hidden from doxygen to fix the reference docu :(
0045 #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
0046 
0047 namespace transform {
0048 
0049 struct id;
0050 
0051 struct log;
0052 
0053 struct sqrt;
0054 
0055 struct pow;
0056 
0057 } // namespace transform
0058 
0059 template <class Value = double, class Transform = use_default,
0060           class MetaData = use_default, class Options = use_default>
0061 class regular;
0062 
0063 template <class Value = int, class MetaData = use_default, class Options = use_default>
0064 class integer;
0065 
0066 template <class Value = double, class MetaData = use_default, class Options = use_default,
0067           class Allocator = std::allocator<Value>>
0068 class variable;
0069 
0070 template <class Value = int, class MetaData = use_default, class Options = use_default,
0071           class Allocator = std::allocator<Value>>
0072 class category;
0073 
0074 template <class MetaData = use_default>
0075 class boolean;
0076 
0077 template <class... Ts>
0078 class variant;
0079 
0080 #endif // BOOST_HISTOGRAM_DOXYGEN_INVOKED
0081 
0082 } // namespace axis
0083 
0084 #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
0085 
0086 template <class T>
0087 struct weight_type;
0088 
0089 template <class T>
0090 struct sample_type;
0091 
0092 namespace accumulators {
0093 
0094 template <class ValueType = double, bool ThreadSafe = false>
0095 class count;
0096 
0097 template <class ValueType = double>
0098 class fraction;
0099 
0100 template <class ValueType = double>
0101 class sum;
0102 
0103 template <class ValueType = double>
0104 class weighted_sum;
0105 
0106 template <class ValueType = double>
0107 class mean;
0108 
0109 template <class ValueType = double>
0110 class weighted_mean;
0111 
0112 } // namespace accumulators
0113 
0114 struct unsafe_access;
0115 
0116 template <class Allocator = std::allocator<char>>
0117 class unlimited_storage;
0118 
0119 template <class T>
0120 class storage_adaptor;
0121 
0122 #endif // BOOST_HISTOGRAM_DOXYGEN_INVOKED
0123 
0124 /// Vector-like storage for fast zero-overhead access to cells.
0125 template <class T, class A = std::allocator<T>>
0126 using dense_storage = storage_adaptor<std::vector<T, A>>;
0127 
0128 /// Default storage, optimized for unweighted histograms
0129 using default_storage = unlimited_storage<>;
0130 
0131 /// Dense storage which tracks sums of weights and a variance estimate.
0132 using weight_storage = dense_storage<accumulators::weighted_sum<>>;
0133 
0134 /// Dense storage which tracks means of samples in each cell.
0135 using profile_storage = dense_storage<accumulators::mean<>>;
0136 
0137 /// Dense storage which tracks means of weighted samples in each cell.
0138 using weighted_profile_storage = dense_storage<accumulators::weighted_mean<>>;
0139 
0140 // some forward declarations must be hidden from doxygen to fix the reference docu :(
0141 #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
0142 
0143 template <class Axes, class Storage = default_storage>
0144 class BOOST_ATTRIBUTE_NODISCARD histogram;
0145 
0146 #endif // BOOST_HISTOGRAM_DOXYGEN_INVOKED
0147 
0148 namespace utility {
0149 
0150 template <class ValueType = double>
0151 class clopper_pearson_interval;
0152 
0153 template <class ValueType = double>
0154 class jeffreys_interval;
0155 
0156 template <class ValueType = double>
0157 class wald_interval;
0158 
0159 template <class ValueType = double>
0160 class wilson_interval;
0161 
0162 } // namespace utility
0163 
0164 namespace detail {
0165 
0166 /*
0167  Most of the histogram code is generic and works for any number of axes. Buffers with a
0168  fixed maximum capacity are used in some places, which have a size equal to the rank of
0169  a histogram. The buffers are allocated from the stack to improve performance, which
0170  means in C++ that they need a preset maximum capacity. 32 seems like a safe upper limit
0171  for the rank. You can nevertheless increase it with the compile-time flag
0172  BOOST_HISTOGRAM_DETAIL_AXES_LIMIT, if necessary.
0173 */
0174 #ifndef BOOST_HISTOGRAM_DETAIL_AXES_LIMIT
0175 #define BOOST_HISTOGRAM_DETAIL_AXES_LIMIT 32
0176 #endif
0177 
0178 template <class T>
0179 struct buffer_size_impl
0180     : std::integral_constant<std::size_t, BOOST_HISTOGRAM_DETAIL_AXES_LIMIT> {};
0181 
0182 template <class... Ts>
0183 struct buffer_size_impl<std::tuple<Ts...>>
0184     : std::integral_constant<std::size_t, sizeof...(Ts)> {};
0185 
0186 template <class T>
0187 using buffer_size = typename buffer_size_impl<T>::type;
0188 
0189 } // namespace detail
0190 
0191 } // namespace histogram
0192 } // namespace boost
0193 
0194 #endif