Skip to content
Browse files

Moved from Google code to github

  • Loading branch information...
0 parents commit 37b1a4f7d5245e9e452dbd98951110cd6bba7c7d @roxlu committed Aug 14, 2010
Showing with 19,875 additions and 0 deletions.
  1. +11 −0 install.xml
  2. BIN lib/mac/libboost_filesystem-xgcc42-mt-1_43.a
  3. BIN lib/mac/libboost_system-xgcc42-mt-1_43.a
  4. BIN lib/mac/libboost_thread-xgcc42-mt-1_43.a
  5. BIN lib/win/libboost_filesystem-mgw34-mt-1_43.a
  6. BIN lib/win/libboost_filesystem-mgw34-mt-d-1_43.a
  7. BIN lib/win/libboost_system-mgw34-mt-1_43.a
  8. BIN lib/win/libboost_system-mgw34-mt-d-1_43.a
  9. BIN lib/win/libboost_thread-mgw34-mt-1_43.a
  10. BIN lib/win/libboost_thread-mgw34-mt-d-1_43.a
  11. +59 −0 readme.txt
  12. +27 −0 src/lib/boost/accumulators/accumulators.hpp
  13. +216 −0 src/lib/boost/accumulators/accumulators_fwd.hpp
  14. +65 −0 src/lib/boost/accumulators/framework/accumulator_base.hpp
  15. +29 −0 src/lib/boost/accumulators/framework/accumulator_concept.hpp
  16. +401 −0 src/lib/boost/accumulators/framework/accumulator_set.hpp
  17. +317 −0 src/lib/boost/accumulators/framework/accumulators/droppable_accumulator.hpp
  18. +108 −0 src/lib/boost/accumulators/framework/accumulators/external_accumulator.hpp
  19. +89 −0 src/lib/boost/accumulators/framework/accumulators/reference_accumulator.hpp
  20. +89 −0 src/lib/boost/accumulators/framework/accumulators/value_accumulator.hpp
  21. +411 −0 src/lib/boost/accumulators/framework/depends_on.hpp
  22. +27 −0 src/lib/boost/accumulators/framework/external.hpp
  23. +229 −0 src/lib/boost/accumulators/framework/extractor.hpp
  24. +29 −0 src/lib/boost/accumulators/framework/features.hpp
  25. +20 −0 src/lib/boost/accumulators/framework/parameters/accumulator.hpp
  26. +20 −0 src/lib/boost/accumulators/framework/parameters/sample.hpp
  27. +21 −0 src/lib/boost/accumulators/framework/parameters/weight.hpp
  28. +21 −0 src/lib/boost/accumulators/framework/parameters/weights.hpp
  29. +75 −0 src/lib/boost/accumulators/numeric/detail/function1.hpp
  30. +10 −0 src/lib/boost/accumulators/numeric/detail/function2.hpp
  31. +10 −0 src/lib/boost/accumulators/numeric/detail/function3.hpp
  32. +10 −0 src/lib/boost/accumulators/numeric/detail/function4.hpp
  33. +148 −0 src/lib/boost/accumulators/numeric/detail/function_n.hpp
  34. +20 −0 src/lib/boost/accumulators/numeric/detail/pod_singleton.hpp
  35. +490 −0 src/lib/boost/accumulators/numeric/functional.hpp
  36. +82 −0 src/lib/boost/accumulators/numeric/functional/complex.hpp
  37. +360 −0 src/lib/boost/accumulators/numeric/functional/valarray.hpp
  38. +329 −0 src/lib/boost/accumulators/numeric/functional/vector.hpp
  39. +221 −0 src/lib/boost/accumulators/numeric/functional_fwd.hpp
  40. +59 −0 src/lib/boost/accumulators/statistics.hpp
  41. +80 −0 src/lib/boost/accumulators/statistics/count.hpp
  42. +220 −0 src/lib/boost/accumulators/statistics/covariance.hpp
  43. +246 −0 src/lib/boost/accumulators/statistics/density.hpp
  44. +99 −0 src/lib/boost/accumulators/statistics/error_of.hpp
  45. +73 −0 src/lib/boost/accumulators/statistics/error_of_mean.hpp
  46. +293 −0 src/lib/boost/accumulators/statistics/extended_p_square.hpp
  47. +319 −0 src/lib/boost/accumulators/statistics/extended_p_square_quantile.hpp
  48. +112 −0 src/lib/boost/accumulators/statistics/kurtosis.hpp
  49. +85 −0 src/lib/boost/accumulators/statistics/max.hpp
  50. +298 −0 src/lib/boost/accumulators/statistics/mean.hpp
  51. +301 −0 src/lib/boost/accumulators/statistics/median.hpp
  52. +85 −0 src/lib/boost/accumulators/statistics/min.hpp
  53. +125 −0 src/lib/boost/accumulators/statistics/moment.hpp
  54. +260 −0 src/lib/boost/accumulators/statistics/p_square_cumulative_distribution.hpp
  55. +257 −0 src/lib/boost/accumulators/statistics/p_square_quantile.hpp
  56. +20 −0 src/lib/boost/accumulators/statistics/parameters/quantile_probability.hpp
  57. +401 −0 src/lib/boost/accumulators/statistics/peaks_over_threshold.hpp
  58. +205 −0 src/lib/boost/accumulators/statistics/pot_quantile.hpp
  59. +211 −0 src/lib/boost/accumulators/statistics/pot_tail_mean.hpp
  60. +80 −0 src/lib/boost/accumulators/statistics/rolling_count.hpp
  61. +81 −0 src/lib/boost/accumulators/statistics/rolling_mean.hpp
  62. +93 −0 src/lib/boost/accumulators/statistics/rolling_sum.hpp
  63. +169 −0 src/lib/boost/accumulators/statistics/rolling_window.hpp
  64. +114 −0 src/lib/boost/accumulators/statistics/skewness.hpp
  65. +29 −0 src/lib/boost/accumulators/statistics/stats.hpp
  66. +141 −0 src/lib/boost/accumulators/statistics/sum.hpp
  67. +334 −0 src/lib/boost/accumulators/statistics/tail.hpp
  68. +246 −0 src/lib/boost/accumulators/statistics/tail_mean.hpp
  69. +158 −0 src/lib/boost/accumulators/statistics/tail_quantile.hpp
  70. +141 −0 src/lib/boost/accumulators/statistics/tail_variate.hpp
  71. +258 −0 src/lib/boost/accumulators/statistics/tail_variate_means.hpp
  72. +58 −0 src/lib/boost/accumulators/statistics/times2_iterator.hpp
  73. +236 −0 src/lib/boost/accumulators/statistics/variance.hpp
  74. +21 −0 src/lib/boost/accumulators/statistics/variates/covariate.hpp
  75. +133 −0 src/lib/boost/accumulators/statistics/weighted_covariance.hpp
  76. +221 −0 src/lib/boost/accumulators/statistics/weighted_density.hpp
  77. +290 −0 src/lib/boost/accumulators/statistics/weighted_extended_p_square.hpp
  78. +105 −0 src/lib/boost/accumulators/statistics/weighted_kurtosis.hpp
  79. +189 −0 src/lib/boost/accumulators/statistics/weighted_mean.hpp
  80. +237 −0 src/lib/boost/accumulators/statistics/weighted_median.hpp
  81. +96 −0 src/lib/boost/accumulators/statistics/weighted_moment.hpp
  82. +262 −0 src/lib/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp
  83. +254 −0 src/lib/boost/accumulators/statistics/weighted_p_square_quantile.hpp
  84. +288 −0 src/lib/boost/accumulators/statistics/weighted_peaks_over_threshold.hpp
  85. +101 −0 src/lib/boost/accumulators/statistics/weighted_skewness.hpp
  86. +116 −0 src/lib/boost/accumulators/statistics/weighted_sum.hpp
  87. +169 −0 src/lib/boost/accumulators/statistics/weighted_tail_mean.hpp
  88. +146 −0 src/lib/boost/accumulators/statistics/weighted_tail_quantile.hpp
  89. +242 −0 src/lib/boost/accumulators/statistics/weighted_tail_variate_means.hpp
  90. +186 −0 src/lib/boost/accumulators/statistics/weighted_variance.hpp
  91. +44 −0 src/lib/boost/accumulators/statistics/with_error.hpp
  92. +419 −0 src/lib/boost/accumulators/statistics_fwd.hpp
  93. +47 −0 src/lib/boost/algorithm/minmax.hpp
  94. +551 −0 src/lib/boost/algorithm/minmax_element.hpp
  95. +31 −0 src/lib/boost/algorithm/string.hpp
  96. +176 −0 src/lib/boost/algorithm/string/case_conv.hpp
  97. +312 −0 src/lib/boost/algorithm/string/classification.hpp
  98. +199 −0 src/lib/boost/algorithm/string/compare.hpp
  99. +83 −0 src/lib/boost/algorithm/string/concept.hpp
  100. +28 −0 src/lib/boost/algorithm/string/config.hpp
  101. +36 −0 src/lib/boost/algorithm/string/constants.hpp
  102. +121 −0 src/lib/boost/algorithm/string/detail/case_conv.hpp
  103. +353 −0 src/lib/boost/algorithm/string/detail/classification.hpp
  104. +194 −0 src/lib/boost/algorithm/string/detail/find_format.hpp
  105. +263 −0 src/lib/boost/algorithm/string/detail/find_format_all.hpp
  106. +78 −0 src/lib/boost/algorithm/string/detail/find_format_store.hpp
  107. +87 −0 src/lib/boost/algorithm/string/detail/find_iterator.hpp
  108. +646 −0 src/lib/boost/algorithm/string/detail/finder.hpp
  109. +122 −0 src/lib/boost/algorithm/string/detail/finder_regex.hpp
  110. +94 −0 src/lib/boost/algorithm/string/detail/formatter.hpp
  111. +61 −0 src/lib/boost/algorithm/string/detail/formatter_regex.hpp
  112. +77 −0 src/lib/boost/algorithm/string/detail/predicate.hpp
  113. +159 −0 src/lib/boost/algorithm/string/detail/replace_storage.hpp
  114. +200 −0 src/lib/boost/algorithm/string/detail/sequence.hpp
  115. +95 −0 src/lib/boost/algorithm/string/detail/trim.hpp
  116. +106 −0 src/lib/boost/algorithm/string/detail/util.hpp
  117. +844 −0 src/lib/boost/algorithm/string/erase.hpp
  118. +334 −0 src/lib/boost/algorithm/string/find.hpp
  119. +287 −0 src/lib/boost/algorithm/string/find_format.hpp
  120. +375 −0 src/lib/boost/algorithm/string/find_iterator.hpp
  121. +270 −0 src/lib/boost/algorithm/string/finder.hpp
  122. +103 −0 src/lib/boost/algorithm/string/formatter.hpp
  123. +193 −0 src/lib/boost/algorithm/string/iter_find.hpp
Sorry, we could not display the entire diff because too many files (7,329) changed.
11 install.xml
@@ -0,0 +1,11 @@
+<install>
+ <name>ofxBoost</name>
+ <version>0.01</version>
+ <author>Diederick Huijbers</author>
+ <url>http://www.roxlu.com</url>
+ <add>
+ <include>
+ <path>../../../addons_diederick/ofxBoost/src/lib/</path>
+ </include>
+ </add>
+</install>
BIN lib/mac/libboost_filesystem-xgcc42-mt-1_43.a
Binary file not shown.
BIN lib/mac/libboost_system-xgcc42-mt-1_43.a
Binary file not shown.
BIN lib/mac/libboost_thread-xgcc42-mt-1_43.a
Binary file not shown.
BIN lib/win/libboost_filesystem-mgw34-mt-1_43.a
Binary file not shown.
BIN lib/win/libboost_filesystem-mgw34-mt-d-1_43.a
Binary file not shown.
BIN lib/win/libboost_system-mgw34-mt-1_43.a
Binary file not shown.
BIN lib/win/libboost_system-mgw34-mt-d-1_43.a
Binary file not shown.
BIN lib/win/libboost_thread-mgw34-mt-1_43.a
Binary file not shown.
BIN lib/win/libboost_thread-mgw34-mt-d-1_43.a
Binary file not shown.
59 readme.txt
@@ -0,0 +1,59 @@
+ofxBoost
+=========
+Allows you to use boost in openFrameworks.
+
+Compiling boost on Windows
+==========================
+You can use the precompiled libraries for mingw/code::blocks, but when you want
+to build Boost yourself follow these steps
+
+- download the boost source
+
+
+- I tried to compile boost on two computers, on one I simply used the
+windows console (cmd) the other one I created using "bash" from a cygwin
+installation...
+- in the root of boost, run: bootstrap.bat
+- run:
+./bjam.exe toolset=gcc target-os=windows --layout=versioned install
+
+This created C:\Boost\
+
+
+Compiling boost on Mac OSX
+===========================
+- Download boost_1_43_0 (http://sourceforge.net/projects/boost/files/boost/1.43.0/boost_1_43_0.tar.bz2/download)
+$ bunzip2 boost_1_43_0.tar.bz2
+$ tar -xvf boost_1_43_0.tar
+$ cd boost_1_43_0
+$ ./boostrap.sh
+$ ./bjam --build-type=minimal \
+ --layout=versioned \
+ --macosx-version=10.6 \
+ --without-regex \
+ --without-mpi \
+ --without-wave \
+ --without-test \
+ --without-python \
+ --without-graph \
+ --without-graph_parallel \
+ --without-serialization \
+ --without-signals \
+ toolset=darwin \
+ target-os=darwin \
+ architecture=combined \
+ address-model=32_64 \
+ stage
+
+Installing on Mac OSX (XCode)
+=============================
+- make sure that you use:
+#undef check
+before including any of the boost .hpp files where you need those
+
+- Add this to your search paths: ../../../addons_diederick/ofxBoost/src/lib/
+- Add the static libs form the ofxBoost/lib/mac dir to your project by dragging
+them on your project.
+
+
+
27 src/lib/boost/accumulators/accumulators.hpp
@@ -0,0 +1,27 @@
+///////////////////////////////////////////////////////////////////////////////
+/// \file accumulators.hpp
+/// Includes all of the Accumulators Framework
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_ACCUMULATORS_HPP_EAN_28_10_2005
+#define BOOST_ACCUMULATORS_ACCUMULATORS_HPP_EAN_28_10_2005
+
+#include <boost/accumulators/framework/accumulator_set.hpp>
+#include <boost/accumulators/framework/accumulator_concept.hpp>
+#include <boost/accumulators/framework/accumulator_base.hpp>
+#include <boost/accumulators/framework/extractor.hpp>
+#include <boost/accumulators/framework/external.hpp>
+#include <boost/accumulators/framework/features.hpp>
+#include <boost/accumulators/framework/parameters/accumulator.hpp>
+#include <boost/accumulators/framework/parameters/sample.hpp>
+#include <boost/accumulators/framework/parameters/weight.hpp>
+#include <boost/accumulators/framework/parameters/weights.hpp>
+#include <boost/accumulators/framework/accumulators/external_accumulator.hpp>
+#include <boost/accumulators/framework/accumulators/droppable_accumulator.hpp>
+#include <boost/accumulators/framework/accumulators/reference_accumulator.hpp>
+#include <boost/accumulators/framework/accumulators/value_accumulator.hpp>
+
+#endif
216 src/lib/boost/accumulators/accumulators_fwd.hpp
@@ -0,0 +1,216 @@
+///////////////////////////////////////////////////////////////////////////////
+// accumulators_fwd.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005
+#define BOOST_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005
+
+#include <boost/config.hpp>
+#include <boost/mpl/apply_fwd.hpp> // for mpl::na
+#include <boost/mpl/limits/vector.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/accumulators/numeric/functional_fwd.hpp>
+
+#ifndef BOOST_ACCUMULATORS_MAX_FEATURES
+ /// The maximum number of accumulators that may be put in an accumulator_set.
+ /// Defaults to BOOST_MPL_LIMIT_VECTOR_SIZE (which defaults to 20).
+# define BOOST_ACCUMULATORS_MAX_FEATURES BOOST_MPL_LIMIT_VECTOR_SIZE
+#endif
+
+#if BOOST_ACCUMULATORS_MAX_FEATURES > BOOST_MPL_LIMIT_VECTOR_SIZE
+# error BOOST_ACCUMULATORS_MAX_FEATURES cannot be larger than BOOST_MPL_LIMIT_VECTOR_SIZE
+#endif
+
+#ifndef BOOST_ACCUMULATORS_MAX_ARGS
+ /// The maximum number of arguments that may be specified to an accumulator_set's
+ /// accumulation function. Defaults to 15.
+# define BOOST_ACCUMULATORS_MAX_ARGS 15
+#endif
+
+#if BOOST_WORKAROUND(__GNUC__, == 3) \
+ || BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(306))
+# define BOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS
+#endif
+
+#ifdef BOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS
+# include <boost/utility/enable_if.hpp>
+# include <boost/type_traits/is_const.hpp>
+# define BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)\
+ , typename boost::disable_if<boost::is_const<T> >::type * = 0
+#else
+# define BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)
+#endif
+
+namespace boost { namespace accumulators
+{
+
+///////////////////////////////////////////////////////////////////////////////
+// Named parameters tags
+//
+namespace tag
+{
+ struct sample;
+ struct weight;
+ struct accumulator;
+ struct weights;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// User-level features
+//
+namespace tag
+{
+ template<typename ValueType, typename Tag>
+ struct value;
+
+ template<typename Tag>
+ struct value_tag;
+
+ template<typename Referent, typename Tag>
+ struct reference;
+
+ template<typename Tag>
+ struct reference_tag;
+
+ template<typename Type, typename Tag = void, typename AccumulatorSet = void>
+ struct external;
+
+ template<typename Feature>
+ struct droppable;
+}
+
+template<typename Accumulator>
+struct droppable_accumulator_base;
+
+template<typename Accumulator>
+struct droppable_accumulator;
+
+template<typename Accumulator>
+struct with_cached_result;
+
+template<typename Sample, typename Features, typename Weight = void>
+struct accumulator_set;
+
+template<typename Feature>
+struct extractor;
+
+template<typename Feature>
+struct feature_of;
+
+template<typename Feature>
+struct as_feature;
+
+template<typename Feature>
+struct as_weighted_feature;
+
+template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature, mpl::na)>
+struct depends_on;
+
+template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature, mpl::na)>
+struct features;
+
+template<typename Feature, typename AccumulatorSet>
+typename mpl::apply<AccumulatorSet, Feature>::type const &
+find_accumulator(AccumulatorSet const &acc);
+
+template<typename Feature, typename AccumulatorSet>
+typename mpl::apply<AccumulatorSet, Feature>::type::result_type
+extract_result(AccumulatorSet const &acc);
+
+template<typename Feature, typename AccumulatorSet, typename A1>
+typename mpl::apply<AccumulatorSet, Feature>::type::result_type
+extract_result(AccumulatorSet const &acc, A1 const &a1);
+
+// ... other overloads generated by Boost.Preprocessor:
+
+/// INTERNAL ONLY
+///
+#define BOOST_ACCUMULATORS_EXTRACT_RESULT_FWD(z, n, _) \
+ template< \
+ typename Feature \
+ , typename AccumulatorSet \
+ BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A) \
+ > \
+ typename mpl::apply<AccumulatorSet, Feature>::type::result_type \
+ extract_result( \
+ AccumulatorSet const &acc \
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) \
+ );
+
+/// INTERNAL ONLY
+///
+BOOST_PP_REPEAT_FROM_TO(
+ 2
+ , BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
+ , BOOST_ACCUMULATORS_EXTRACT_RESULT_FWD
+ , _
+)
+
+#ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
+template<typename Feature, typename AccumulatorSet, typename A1, typename A2 ...>
+typename mpl::apply<AccumulatorSet, Feature>::type::result_type
+extract_result(AccumulatorSet const &acc, A1 const &a1, A2 const &a2 ...);
+#endif
+
+namespace impl
+{
+ using namespace numeric::operators;
+
+ template<typename Accumulator, typename Tag>
+ struct external_impl;
+}
+
+namespace detail
+{
+ template<typename Accumulator>
+ struct feature_tag;
+
+ template<typename Feature, typename Sample, typename Weight>
+ struct to_accumulator;
+
+ struct accumulator_set_base;
+
+ template<typename T>
+ struct is_accumulator_set;
+
+ inline void ignore_variable(void const *) {}
+
+ #define BOOST_ACCUMULATORS_IGNORE_GLOBAL(X)\
+ namespace detail { inline void BOOST_PP_CAT(ignore_, X)() { boost::accumulators::detail::ignore_variable(&X); } }
+}
+
+}} // namespace boost::accumulators
+
+// For defining boost::parameter keywords that can be inherited from to
+// get a nested, class-scoped keyword with the requested alias
+#define BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias) \
+ namespace tag_namespace \
+ { \
+ template<int Dummy = 0> \
+ struct name ## _ \
+ { \
+ static char const* keyword_name() \
+ { \
+ return #name; \
+ } \
+ static ::boost::parameter::keyword<name ## _<Dummy> > &alias; \
+ }; \
+ template<int Dummy> \
+ ::boost::parameter::keyword<name ## _<Dummy> > &name ## _<Dummy>::alias = \
+ ::boost::parameter::keyword<name ## _<Dummy> >::get(); \
+ typedef name ## _ <> name; \
+ } \
+ namespace \
+ { \
+ ::boost::parameter::keyword<tag_namespace::name> &name = \
+ ::boost::parameter::keyword<tag_namespace::name>::get(); \
+ }
+
+#endif
65 src/lib/boost/accumulators/framework/accumulator_base.hpp
@@ -0,0 +1,65 @@
+///////////////////////////////////////////////////////////////////////////////
+// accumulator_base.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_BASE_HPP_EAN_28_10_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_BASE_HPP_EAN_28_10_2005
+
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/joint_view.hpp>
+#include <boost/mpl/single_view.hpp>
+#include <boost/mpl/fold.hpp>
+#include <boost/mpl/contains.hpp>
+#include <boost/mpl/empty_sequence.hpp>
+#include <boost/accumulators/framework/accumulator_concept.hpp>
+
+namespace boost { namespace accumulators
+{
+
+namespace detail
+{
+ typedef void void_;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// dont_care
+//
+struct dont_care
+{
+ template<typename Args>
+ dont_care(Args const &)
+ {
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// accumulator_base
+//
+struct accumulator_base
+{
+ // hidden if defined in derived classes
+ detail::void_ operator ()(dont_care)
+ {
+ }
+
+ typedef mpl::false_ is_droppable;
+
+ detail::void_ add_ref(dont_care)
+ {
+ }
+
+ detail::void_ drop(dont_care)
+ {
+ }
+
+ detail::void_ on_drop(dont_care)
+ {
+ }
+};
+
+}} // namespace boost::accumulators
+
+#endif
29 src/lib/boost/accumulators/framework/accumulator_concept.hpp
@@ -0,0 +1,29 @@
+///////////////////////////////////////////////////////////////////////////////
+// accumulator_concept.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_CONCEPT_HPP_EAN_28_10_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_CONCEPT_HPP_EAN_28_10_2005
+
+#include <boost/concept_check.hpp>
+
+namespace boost { namespace accumulators
+{
+
+template<typename Stat>
+struct accumulator_concept
+{
+ void constraints()
+ {
+ // TODO: define the stat concept
+ }
+
+ Stat stat;
+};
+
+}} // namespace boost::accumulators
+
+#endif
401 src/lib/boost/accumulators/framework/accumulator_set.hpp
@@ -0,0 +1,401 @@
+///////////////////////////////////////////////////////////////////////////////
+// accumulator_set.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_SET_HPP_EAN_28_10_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATOR_SET_HPP_EAN_28_10_2005
+
+#include <boost/version.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/protect.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/parameter/parameters.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/accumulators/accumulators_fwd.hpp>
+#include <boost/accumulators/framework/depends_on.hpp>
+#include <boost/accumulators/framework/accumulator_concept.hpp>
+#include <boost/accumulators/framework/parameters/accumulator.hpp>
+#include <boost/accumulators/framework/parameters/sample.hpp>
+#include <boost/accumulators/framework/accumulators/external_accumulator.hpp>
+#include <boost/accumulators/framework/accumulators/droppable_accumulator.hpp>
+#include <boost/fusion/include/any.hpp>
+#include <boost/fusion/include/find_if.hpp>
+#include <boost/fusion/include/for_each.hpp>
+#include <boost/fusion/include/filter_view.hpp>
+
+namespace boost { namespace accumulators
+{
+
+namespace detail
+{
+ ///////////////////////////////////////////////////////////////////////////////
+ // accumulator_visitor
+ // wrap a boost::parameter argument pack in a Fusion extractor object
+ template<typename Args>
+ struct accumulator_visitor
+ {
+ explicit accumulator_visitor(Args const &a)
+ : args(a)
+ {
+ }
+
+ template<typename Accumulator>
+ void operator ()(Accumulator &accumulator) const
+ {
+ accumulator(this->args);
+ }
+
+ private:
+ accumulator_visitor &operator =(accumulator_visitor const &);
+ Args const &args;
+ };
+
+ template<typename Args>
+ inline accumulator_visitor<Args> const make_accumulator_visitor(Args const &args)
+ {
+ return accumulator_visitor<Args>(args);
+ }
+
+ typedef
+ parameter::parameters<
+ parameter::required<tag::accumulator>
+ , parameter::optional<tag::sample>
+ // ... and others which are not specified here...
+ >
+ accumulator_params;
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // accumulator_set_base
+ struct accumulator_set_base
+ {
+ };
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // is_accumulator_set
+ template<typename T>
+ struct is_accumulator_set
+ : is_base_and_derived<accumulator_set_base, T>
+ {
+ };
+
+} // namespace detail
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4355) // warning C4355: 'this' : used in base member initializer list
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief A set of accumulators.
+///
+/// accumulator_set resolves the dependencies between features and ensures that
+/// the accumulators in the set are updated in the proper order.
+///
+/// acccumulator_set provides a general mechanism to visit the accumulators
+/// in the set in order, with or without a filter. You can also fetch a reference
+/// to an accumulator that corresponds to a feature.
+///
+template<typename Sample, typename Features, typename Weight>
+struct accumulator_set
+ : detail::accumulator_set_base
+{
+ typedef Sample sample_type; ///< The type of the samples that will be accumulated
+ typedef Features features_type; ///< An MPL sequence of the features that should be accumulated.
+ typedef Weight weight_type; ///< The type of the weight parameter. Must be a scalar. Defaults to void.
+
+ /// INTERNAL ONLY
+ ///
+ typedef
+ typename detail::make_accumulator_tuple<
+ Features
+ , Sample
+ , Weight
+ >::type
+ accumulators_mpl_vector;
+
+ // generate a fusion::list of accumulators
+ /// INTERNAL ONLY
+ ///
+ typedef
+ typename detail::meta::make_acc_list<
+ accumulators_mpl_vector
+ >::type
+ accumulators_type;
+
+ /// INTERNAL ONLY
+ ///
+ //BOOST_MPL_ASSERT((mpl::is_sequence<accumulators_type>));
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// default-construct all contained accumulators
+ accumulator_set()
+ : accumulators(
+ detail::make_acc_list(
+ accumulators_mpl_vector()
+ , detail::accumulator_params()(*this)
+ )
+ )
+ {
+ // Add-ref the Features that the user has specified
+ this->template visit_if<detail::contains_feature_of_<Features> >(
+ detail::make_add_ref_visitor(detail::accumulator_params()(*this))
+ );
+ }
+
+ /// \overload
+ ///
+ /// \param a1 Optional named parameter to be passed to all the accumulators
+ template<typename A1>
+ explicit accumulator_set(A1 const &a1)
+ : accumulators(
+ detail::make_acc_list(
+ accumulators_mpl_vector()
+ , detail::accumulator_params()(*this, a1)
+ )
+ )
+ {
+ // Add-ref the Features that the user has specified
+ this->template visit_if<detail::contains_feature_of_<Features> >(
+ detail::make_add_ref_visitor(detail::accumulator_params()(*this))
+ );
+ }
+
+ // ... other overloads generated by Boost.Preprocessor:
+
+ /// INTERNAL ONLY
+ ///
+#define BOOST_ACCUMULATORS_ACCUMULATOR_SET_CTOR(z, n, _) \
+ template<BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
+ accumulator_set(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, A, const &a)) \
+ : accumulators( \
+ detail::make_acc_list( \
+ accumulators_mpl_vector() \
+ , detail::accumulator_params()( \
+ *this BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a) \
+ ) \
+ ) \
+ ) \
+ { \
+ /* Add-ref the Features that the user has specified */ \
+ this->template visit_if<detail::contains_feature_of_<Features> >( \
+ detail::make_add_ref_visitor(detail::accumulator_params()(*this)) \
+ ); \
+ }
+
+ /// INTERNAL ONLY
+ ///
+ BOOST_PP_REPEAT_FROM_TO(
+ 2
+ , BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
+ , BOOST_ACCUMULATORS_ACCUMULATOR_SET_CTOR
+ , _
+ )
+
+ #ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
+ /// \overload
+ ///
+ template<typename A1, typename A2, ...>
+ accumulator_set(A1 const &a1, A2 const &a2, ...);
+ #endif
+
+ // ... other overloads generated by Boost.Preprocessor below ...
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// Visitation
+ /// \param func UnaryFunction which is invoked with each accumulator in turn.
+ template<typename UnaryFunction>
+ void visit(UnaryFunction const &func)
+ {
+ fusion::for_each(this->accumulators, func);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// Conditional visitation
+ /// \param func UnaryFunction which is invoked with each accumulator in turn,
+ /// provided the accumulator satisfies the MPL predicate FilterPred.
+ template<typename FilterPred, typename UnaryFunction>
+ void visit_if(UnaryFunction const &func)
+ {
+ fusion::filter_view<accumulators_type, FilterPred> filtered_accs(this->accumulators);
+ fusion::for_each(filtered_accs, func);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// The return type of the operator() overloads is void.
+ typedef void result_type;
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// Accumulation
+ /// \param a1 Optional named parameter to be passed to all the accumulators
+ void operator ()()
+ {
+ this->visit(
+ detail::make_accumulator_visitor(
+ detail::accumulator_params()(*this)
+ )
+ );
+ }
+
+ template<typename A1>
+ void operator ()(A1 const &a1)
+ {
+ this->visit(
+ detail::make_accumulator_visitor(
+ detail::accumulator_params()(*this, a1)
+ )
+ );
+ }
+
+ // ... other overloads generated by Boost.Preprocessor:
+
+ /// INTERNAL ONLY
+ ///
+#define BOOST_ACCUMULATORS_ACCUMULATOR_SET_FUN_OP(z, n, _) \
+ template<BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
+ void operator ()(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, A, const &a)) \
+ { \
+ this->visit( \
+ detail::make_accumulator_visitor( \
+ detail::accumulator_params()( \
+ *this BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a) \
+ ) \
+ ) \
+ ); \
+ }
+
+ /// INTERNAL ONLY
+ ///
+ BOOST_PP_REPEAT_FROM_TO(
+ 2
+ , BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
+ , BOOST_ACCUMULATORS_ACCUMULATOR_SET_FUN_OP
+ , _
+ )
+
+ #ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
+ /// \overload
+ ///
+ template<typename A1, typename A2, ...>
+ void operator ()(A1 const &a1, A2 const &a2, ...);
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// Extraction
+ template<typename Feature>
+ struct apply
+ : fusion::result_of::value_of<
+ typename fusion::result_of::find_if<
+ accumulators_type
+ , detail::matches_feature<Feature>
+ >::type
+ >
+ {
+ };
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// Extraction
+ template<typename Feature>
+ typename apply<Feature>::type &extract()
+ {
+ return *fusion::find_if<detail::matches_feature<Feature> >(this->accumulators);
+ }
+
+ /// \overload
+ template<typename Feature>
+ typename apply<Feature>::type const &extract() const
+ {
+ return *fusion::find_if<detail::matches_feature<Feature> >(this->accumulators);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// Drop
+ template<typename Feature>
+ void drop()
+ {
+ // You can only drop the features that you have specified explicitly
+ typedef typename apply<Feature>::type the_accumulator;
+ BOOST_MPL_ASSERT((detail::contains_feature_of<Features, the_accumulator>));
+
+ typedef
+ typename feature_of<typename as_feature<Feature>::type>::type
+ the_feature;
+
+ (*fusion::find_if<detail::matches_feature<Feature> >(this->accumulators))
+ .drop(detail::accumulator_params()(*this));
+
+ // Also drop accumulators that this feature depends on
+ typedef typename the_feature::dependencies dependencies;
+ this->template visit_if<detail::contains_feature_of_<dependencies> >(
+ detail::make_drop_visitor(detail::accumulator_params()(*this))
+ );
+ }
+
+private:
+
+ accumulators_type accumulators;
+};
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// find_accumulator
+// find an accumulator in an accumulator_set corresponding to a feature
+template<typename Feature, typename AccumulatorSet>
+typename mpl::apply<AccumulatorSet, Feature>::type &
+find_accumulator(AccumulatorSet &acc BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(AccumulatorSet))
+{
+ return acc.template extract<Feature>();
+}
+
+/// \overload
+template<typename Feature, typename AccumulatorSet>
+typename mpl::apply<AccumulatorSet, Feature>::type const &
+find_accumulator(AccumulatorSet const &acc)
+{
+ return acc.template extract<Feature>();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// extract_result
+// extract a result from an accumulator set
+/// INTERNAL ONLY
+///
+#define BOOST_ACCUMULATORS_EXTRACT_RESULT_FUN(z, n, _) \
+ template< \
+ typename Feature \
+ , typename AccumulatorSet \
+ BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A) \
+ > \
+ typename mpl::apply<AccumulatorSet, Feature>::type::result_type \
+ extract_result( \
+ AccumulatorSet const &acc \
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) \
+ ) \
+ { \
+ return find_accumulator<Feature>(acc).result( \
+ detail::accumulator_params()( \
+ acc \
+ BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a) \
+ ) \
+ ); \
+ }
+
+BOOST_PP_REPEAT(
+ BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
+ , BOOST_ACCUMULATORS_EXTRACT_RESULT_FUN
+ , _
+)
+
+}} // namespace boost::accumulators
+
+#endif
317 src/lib/boost/accumulators/framework/accumulators/droppable_accumulator.hpp
@@ -0,0 +1,317 @@
+///////////////////////////////////////////////////////////////////////////////
+// droppable_accumulator.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_DROPPABLE_ACCUMULATOR_HPP_EAN_13_12_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_DROPPABLE_ACCUMULATOR_HPP_EAN_13_12_2005
+
+#include <new>
+#include <boost/assert.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/aligned_storage.hpp>
+#include <boost/accumulators/framework/depends_on.hpp> // for feature_of
+#include <boost/accumulators/framework/parameters/accumulator.hpp> // for accumulator
+
+namespace boost { namespace accumulators
+{
+
+ template<typename Accumulator>
+ struct droppable_accumulator;
+
+ namespace detail
+ {
+ ///////////////////////////////////////////////////////////////////////////////
+ // add_ref_visitor
+ // a fusion function object for add_ref'ing accumulators
+ template<typename Args>
+ struct add_ref_visitor
+ {
+ explicit add_ref_visitor(Args const &args)
+ : args_(args)
+ {
+ }
+
+ template<typename Accumulator>
+ void operator ()(Accumulator &acc) const
+ {
+ typedef typename Accumulator::feature_tag::dependencies dependencies;
+
+ acc.add_ref(this->args_);
+
+ // Also add_ref accumulators that this feature depends on
+ this->args_[accumulator].template
+ visit_if<detail::contains_feature_of_<dependencies> >(
+ *this
+ );
+ }
+
+ private:
+ add_ref_visitor &operator =(add_ref_visitor const &);
+ Args const &args_;
+ };
+
+ template<typename Args>
+ add_ref_visitor<Args> make_add_ref_visitor(Args const &args)
+ {
+ return add_ref_visitor<Args>(args);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // drop_visitor
+ // a fusion function object for dropping accumulators
+ template<typename Args>
+ struct drop_visitor
+ {
+ explicit drop_visitor(Args const &args)
+ : args_(args)
+ {
+ }
+
+ template<typename Accumulator>
+ void operator ()(Accumulator &acc) const
+ {
+ if(typename Accumulator::is_droppable())
+ {
+ typedef typename Accumulator::feature_tag::dependencies dependencies;
+
+ acc.drop(this->args_);
+ // Also drop accumulators that this feature depends on
+ this->args_[accumulator].template
+ visit_if<detail::contains_feature_of_<dependencies> >(
+ *this
+ );
+ }
+ }
+
+ private:
+ drop_visitor &operator =(drop_visitor const &);
+ Args const &args_;
+ };
+
+ template<typename Args>
+ drop_visitor<Args> make_drop_visitor(Args const &args)
+ {
+ return drop_visitor<Args>(args);
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // droppable_accumulator_base
+ template<typename Accumulator>
+ struct droppable_accumulator_base
+ : Accumulator
+ {
+ typedef droppable_accumulator_base base;
+ typedef mpl::true_ is_droppable;
+ typedef typename Accumulator::result_type result_type;
+
+ template<typename Args>
+ droppable_accumulator_base(Args const &args)
+ : Accumulator(args)
+ , ref_count_(0)
+ {
+ }
+
+ template<typename Args>
+ void operator ()(Args const &args)
+ {
+ if(!this->is_dropped())
+ {
+ this->Accumulator::operator ()(args);
+ }
+ }
+
+ template<typename Args>
+ void add_ref(Args const &)
+ {
+ ++this->ref_count_;
+ }
+
+ template<typename Args>
+ void drop(Args const &args)
+ {
+ BOOST_ASSERT(0 < this->ref_count_);
+ if(1 == this->ref_count_)
+ {
+ static_cast<droppable_accumulator<Accumulator> *>(this)->on_drop(args);
+ }
+ --this->ref_count_;
+ }
+
+ bool is_dropped() const
+ {
+ return 0 == this->ref_count_;
+ }
+
+ private:
+ int ref_count_;
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // droppable_accumulator
+ // this can be specialized for any type that needs special handling
+ template<typename Accumulator>
+ struct droppable_accumulator
+ : droppable_accumulator_base<Accumulator>
+ {
+ template<typename Args>
+ droppable_accumulator(Args const &args)
+ : droppable_accumulator::base(args)
+ {
+ }
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // with_cached_result
+ template<typename Accumulator>
+ struct with_cached_result
+ : Accumulator
+ {
+ typedef typename Accumulator::result_type result_type;
+
+ template<typename Args>
+ with_cached_result(Args const &args)
+ : Accumulator(args)
+ , cache()
+ {
+ }
+
+ with_cached_result(with_cached_result const &that)
+ : Accumulator(*static_cast<Accumulator const *>(&that))
+ , cache()
+ {
+ if(that.has_result())
+ {
+ this->set(that.get());
+ }
+ }
+
+ ~with_cached_result()
+ {
+ // Since this is a base class of droppable_accumulator_base,
+ // this destructor is called before any of droppable_accumulator_base's
+ // members get cleaned up, including is_dropped, so the following
+ // call to has_result() is valid.
+ if(this->has_result())
+ {
+ this->get().~result_type();
+ }
+ }
+
+ template<typename Args>
+ void on_drop(Args const &args)
+ {
+ // cache the result at the point this calcuation was dropped
+ BOOST_ASSERT(!this->has_result());
+ this->set(this->Accumulator::result(args));
+ }
+
+ template<typename Args>
+ result_type result(Args const &args) const
+ {
+ return this->has_result() ? this->get() : this->Accumulator::result(args);
+ }
+
+ private:
+ with_cached_result &operator =(with_cached_result const &);
+
+ void set(result_type const &r)
+ {
+ ::new(this->cache.address()) result_type(r);
+ }
+
+ result_type const &get() const
+ {
+ return *static_cast<result_type const *>(this->cache.address());
+ }
+
+ bool has_result() const
+ {
+ typedef with_cached_result<Accumulator> this_type;
+ typedef droppable_accumulator_base<this_type> derived_type;
+ return static_cast<derived_type const *>(this)->is_dropped();
+ }
+
+ aligned_storage<sizeof(result_type)> cache;
+ };
+
+ namespace tag
+ {
+ template<typename Feature>
+ struct as_droppable
+ {
+ typedef droppable<Feature> type;
+ };
+
+ template<typename Feature>
+ struct as_droppable<droppable<Feature> >
+ {
+ typedef droppable<Feature> type;
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // droppable
+ template<typename Feature>
+ struct droppable
+ : as_feature<Feature>::type
+ {
+ typedef typename as_feature<Feature>::type feature_type;
+ typedef typename feature_type::dependencies tmp_dependencies_;
+
+ typedef
+ typename mpl::transform<
+ typename feature_type::dependencies
+ , as_droppable<mpl::_1>
+ >::type
+ dependencies;
+
+ struct impl
+ {
+ template<typename Sample, typename Weight>
+ struct apply
+ {
+ typedef
+ droppable_accumulator<
+ typename mpl::apply2<typename feature_type::impl, Sample, Weight>::type
+ >
+ type;
+ };
+ };
+ };
+ }
+
+ // make droppable<tag::feature(modifier)> work
+ template<typename Feature>
+ struct as_feature<tag::droppable<Feature> >
+ {
+ typedef tag::droppable<typename as_feature<Feature>::type> type;
+ };
+
+ // make droppable<tag::mean> work with non-void weights (should become
+ // droppable<tag::weighted_mean>
+ template<typename Feature>
+ struct as_weighted_feature<tag::droppable<Feature> >
+ {
+ typedef tag::droppable<typename as_weighted_feature<Feature>::type> type;
+ };
+
+ // for the purposes of feature-based dependency resolution,
+ // droppable<Foo> provides the same feature as Foo
+ template<typename Feature>
+ struct feature_of<tag::droppable<Feature> >
+ : feature_of<Feature>
+ {
+ };
+
+ // Note: Usually, the extractor is pulled into the accumulators namespace with
+ // a using directive, not the tag. But the droppable<> feature doesn't have an
+ // extractor, so we can put the droppable tag in the accumulators namespace
+ // without fear of a name conflict.
+ using tag::droppable;
+
+}} // namespace boost::accumulators
+
+#endif
108 src/lib/boost/accumulators/framework/accumulators/external_accumulator.hpp
@@ -0,0 +1,108 @@
+///////////////////////////////////////////////////////////////////////////////
+// external_accumulator.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_EXTERNAL_ACCUMULATOR_HPP_EAN_01_12_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_EXTERNAL_ACCUMULATOR_HPP_EAN_01_12_2005
+
+#include <boost/mpl/placeholders.hpp>
+#include <boost/parameter/keyword.hpp>
+#include <boost/accumulators/framework/extractor.hpp>
+#include <boost/accumulators/framework/depends_on.hpp> // for feature_tag
+#include <boost/accumulators/framework/accumulator_base.hpp>
+#include <boost/accumulators/framework/accumulators/reference_accumulator.hpp>
+
+namespace boost { namespace accumulators { namespace impl
+{
+
+ //////////////////////////////////////////////////////////////////////////
+ // external_impl
+ /// INTERNAL ONLY
+ ///
+ template<typename Accumulator, typename Tag>
+ struct external_impl
+ : accumulator_base
+ {
+ typedef typename Accumulator::result_type result_type;
+ typedef typename detail::feature_tag<Accumulator>::type feature_tag;
+
+ external_impl(dont_care) {}
+
+ template<typename Args>
+ result_type result(Args const &args) const
+ {
+ return this->extract_(args, args[parameter::keyword<Tag>::get() | 0]);
+ }
+
+ private:
+
+ template<typename Args>
+ static result_type extract_(Args const &args, int)
+ {
+ // No named parameter passed to the extractor. Maybe the external
+ // feature is held by reference<>.
+ extractor<feature_tag> extract;
+ return extract(accumulators::reference_tag<Tag>(args));
+ }
+
+ template<typename Args, typename AccumulatorSet>
+ static result_type extract_(Args const &, AccumulatorSet const &acc)
+ {
+ // OK, a named parameter for this external feature was passed to the
+ // extractor, so use that.
+ extractor<feature_tag> extract;
+ return extract(acc);
+ }
+ };
+
+} // namespace impl
+
+namespace tag
+{
+ //////////////////////////////////////////////////////////////////////////
+ // external
+ template<typename Feature, typename Tag, typename AccumulatorSet>
+ struct external
+ : depends_on<reference<AccumulatorSet, Tag> >
+ {
+ typedef
+ accumulators::impl::external_impl<
+ detail::to_accumulator<Feature, mpl::_1, mpl::_2>
+ , Tag
+ >
+ impl;
+ };
+
+ template<typename Feature, typename Tag>
+ struct external<Feature, Tag, void>
+ : depends_on<>
+ {
+ typedef
+ accumulators::impl::external_impl<
+ detail::to_accumulator<Feature, mpl::_1, mpl::_2>
+ , Tag
+ >
+ impl;
+ };
+}
+
+// for the purposes of feature-based dependency resolution,
+// external_accumulator<Feature, Tag> provides the same feature as Feature
+template<typename Feature, typename Tag, typename AccumulatorSet>
+struct feature_of<tag::external<Feature, Tag, AccumulatorSet> >
+ : feature_of<Feature>
+{
+};
+
+// Note: Usually, the extractor is pulled into the accumulators namespace with
+// a using directive, not the tag. But the external<> feature doesn't have an
+// extractor, so we can put the external tag in the accumulators namespace
+// without fear of a name conflict.
+using tag::external;
+
+}} // namespace boost::accumulators
+
+#endif
89 src/lib/boost/accumulators/framework/accumulators/reference_accumulator.hpp
@@ -0,0 +1,89 @@
+///////////////////////////////////////////////////////////////////////////////
+// reference_accumulator.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_REFERENCE_ACCUMULATOR_HPP_EAN_03_23_2006
+#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_REFERENCE_ACCUMULATOR_HPP_EAN_03_23_2006
+
+#include <boost/ref.hpp>
+#include <boost/mpl/always.hpp>
+#include <boost/parameter/keyword.hpp>
+#include <boost/accumulators/framework/depends_on.hpp> // for feature_tag
+#include <boost/accumulators/framework/accumulator_base.hpp>
+#include <boost/accumulators/framework/extractor.hpp>
+
+namespace boost { namespace accumulators
+{
+
+namespace impl
+{
+ //////////////////////////////////////////////////////////////////////////
+ // reference_accumulator_impl
+ //
+ template<typename Referent, typename Tag>
+ struct reference_accumulator_impl
+ : accumulator_base
+ {
+ typedef Referent &result_type;
+
+ template<typename Args>
+ reference_accumulator_impl(Args const &args)
+ : ref(args[parameter::keyword<Tag>::get()])
+ {
+ }
+
+ result_type result(dont_care) const
+ {
+ return this->ref;
+ }
+
+ private:
+ reference_wrapper<Referent> ref;
+ };
+} // namespace impl
+
+namespace tag
+{
+ //////////////////////////////////////////////////////////////////////////
+ // reference_tag
+ template<typename Tag>
+ struct reference_tag
+ {
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // reference
+ template<typename Referent, typename Tag>
+ struct reference
+ : depends_on<>
+ {
+ /// INTERNAL ONLY
+ ///
+ typedef mpl::always<accumulators::impl::reference_accumulator_impl<Referent, Tag> > impl;
+ };
+}
+
+namespace extract
+{
+ BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, reference, (typename)(typename))
+ BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, reference_tag, (typename))
+}
+
+using extract::reference;
+using extract::reference_tag;
+
+// Map all reference<V,T> features to reference_tag<T> so
+// that references can be extracted using reference_tag<T>
+// without specifying the referent type.
+template<typename ValueType, typename Tag>
+struct feature_of<tag::reference<ValueType, Tag> >
+ : feature_of<tag::reference_tag<Tag> >
+{
+};
+
+}} // namespace boost::accumulators
+
+#endif
89 src/lib/boost/accumulators/framework/accumulators/value_accumulator.hpp
@@ -0,0 +1,89 @@
+///////////////////////////////////////////////////////////////////////////////
+// value_accumulator.hpp
+//
+// Copyright 2005 Eric Niebler, Daniel Egloff. 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_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_VALUE_ACCUMULATOR_HPP_EAN_03_23_2006
+#define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_VALUE_ACCUMULATOR_HPP_EAN_03_23_2006
+
+#include <boost/mpl/always.hpp>
+#include <boost/parameter/keyword.hpp>
+#include <boost/accumulators/framework/depends_on.hpp> // for feature_tag
+#include <boost/accumulators/framework/accumulator_base.hpp>
+#include <boost/accumulators/framework/extractor.hpp>
+
+namespace boost { namespace accumulators
+{
+
+namespace impl
+{
+
+ //////////////////////////////////////////////////////////////////////////
+ // value_accumulator_impl
+ template<typename ValueType, typename Tag>
+ struct value_accumulator_impl
+ : accumulator_base
+ {
+ typedef ValueType result_type;
+
+ template<typename Args>
+ value_accumulator_impl(Args const &args)
+ : val(args[parameter::keyword<Tag>::get()])
+ {
+ }
+
+ result_type result(dont_care) const
+ {
+ return this->val;
+ }
+
+ private:
+ ValueType val;
+ };
+
+} // namespace impl
+
+namespace tag
+{
+ //////////////////////////////////////////////////////////////////////////
+ // value_tag
+ template<typename Tag>
+ struct value_tag
+ {
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // value
+ template<typename ValueType, typename Tag>
+ struct value
+ : depends_on<>
+ {
+ /// INTERNAL ONLY
+ ///
+ typedef mpl::always<accumulators::impl::value_accumulator_impl<ValueType, Tag> > impl;
+ };
+}
+
+namespace extract
+{
+ BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, value, (typename)(typename))
+ BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, value_tag, (typename))
+}
+
+using extract::value;
+using extract::value_tag;
+
+// Map all value<V,T> features to value_tag<T> so
+// that values can be extracted using value_tag<T>
+// without specifying the value type.
+template<typename ValueType, typename Tag>
+struct feature_of<tag::value<ValueType, Tag> >
+ : feature_of<tag::value_tag<Tag> >
+{
+};
+
+}} // namespace boost::accumulators
+
+#endif
411 src/lib/boost/accumulators/framework/depends_on.hpp
@@ -0,0 +1,411 @@
+///////////////////////////////////////////////////////////////////////////////
+// depends_on.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_DEPENDS_ON_HPP_EAN_28_10_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_DEPENDS_ON_HPP_EAN_28_10_2005
+
+#include <boost/version.hpp>
+#include <boost/mpl/end.hpp>
+#include <boost/mpl/map.hpp>
+#include <boost/mpl/fold.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/sort.hpp>
+#include <boost/mpl/insert.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/remove.hpp>
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/inherit.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/equal_to.hpp>
+#include <boost/mpl/contains.hpp>
+#include <boost/mpl/transform.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/insert_range.hpp>
+#include <boost/mpl/transform_view.hpp>
+#include <boost/mpl/inherit_linearly.hpp>
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/accumulators/accumulators_fwd.hpp>
+#include <boost/fusion/include/next.hpp>
+#include <boost/fusion/include/equal_to.hpp>
+#include <boost/fusion/include/value_of.hpp>
+#include <boost/fusion/include/mpl.hpp>
+#include <boost/fusion/include/end.hpp>
+#include <boost/fusion/include/begin.hpp>
+#include <boost/fusion/include/cons.hpp>
+
+namespace boost { namespace accumulators
+{
+ ///////////////////////////////////////////////////////////////////////////
+ // as_feature
+ template<typename Feature>
+ struct as_feature
+ {
+ typedef Feature type;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ // weighted_feature
+ template<typename Feature>
+ struct as_weighted_feature
+ {
+ typedef Feature type;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ // feature_of
+ template<typename Feature>
+ struct feature_of
+ {
+ typedef Feature type;
+ };
+
+ namespace detail
+ {
+ ///////////////////////////////////////////////////////////////////////////
+ // feature_tag
+ template<typename Accumulator>
+ struct feature_tag
+ {
+ typedef typename Accumulator::feature_tag type;
+ };
+
+ template<typename Feature>
+ struct undroppable
+ {
+ typedef Feature type;
+ };
+
+ template<typename Feature>
+ struct undroppable<tag::droppable<Feature> >
+ {
+ typedef Feature type;
+ };
+
+ // For the purpose of determining whether one feature depends on another,
+ // disregard whether the feature is droppable or not.
+ template<typename A, typename B>
+ struct is_dependent_on
+ : is_base_and_derived<
+ typename undroppable<B>::type
+ , typename undroppable<A>::type
+ >
+ {};
+
+ template<typename Features>
+ struct depends_on_base
+ : mpl::inherit_linearly<
+ typename mpl::sort<Features, is_dependent_on<mpl::_1, mpl::_2> >::type
+ // Don't inherit multiply from a feature
+ , mpl::if_<
+ is_dependent_on<mpl::_1, mpl::_2>
+ , mpl::_1
+ , mpl::inherit<mpl::_1, mpl::_2>
+ >
+ >::type
+ {
+ };
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// depends_on
+ template<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature)>
+ struct depends_on
+ : detail::depends_on_base<
+ typename mpl::transform<
+ mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, Feature)>
+ , as_feature<mpl::_1>
+ >::type
+ >
+ {
+ typedef mpl::false_ is_weight_accumulator;
+ typedef
+ typename mpl::transform<
+ mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, Feature)>
+ , as_feature<mpl::_1>
+ >::type
+ dependencies;
+ };
+
+ namespace detail
+ {
+ template<typename Feature>
+ struct matches_feature
+ {
+ template<typename Accumulator>
+ struct apply
+ : is_same<
+ typename feature_of<typename as_feature<Feature>::type>::type
+ , typename feature_of<typename as_feature<typename feature_tag<Accumulator>::type>::type>::type
+ >
+ {};
+ };
+
+ template<typename Features, typename Accumulator>
+ struct contains_feature_of
+ {
+ typedef
+ mpl::transform_view<Features, feature_of<as_feature<mpl::_> > >
+ features_list;
+
+ typedef
+ typename feature_of<typename feature_tag<Accumulator>::type>::type
+ the_feature;
+
+ typedef
+ typename mpl::contains<features_list, the_feature>::type
+ type;
+ };
+
+ // This is to work around a bug in early versions of Fusion which caused
+ // a compile error if contains_feature_of<List, mpl::_> is used as a
+ // predicate to fusion::find_if
+ template<typename Features>
+ struct contains_feature_of_
+ {
+ template<typename Accumulator>
+ struct apply
+ : contains_feature_of<Features, Accumulator>
+ {};
+ };
+
+ template<
+ typename First
+ , typename Last
+ , bool is_empty = fusion::result_of::equal_to<First, Last>::value
+ >
+ struct build_acc_list;
+
+ template<typename First, typename Last>
+ struct build_acc_list<First, Last, true>
+ {
+ typedef fusion::nil type;
+
+ template<typename Args>
+ static fusion::nil
+ call(Args const &, First const&, Last const&)
+ {
+ return fusion::nil();
+ }
+ };
+
+ template<typename First, typename Last>
+ struct build_acc_list<First, Last, false>
+ {
+ typedef
+ build_acc_list<typename fusion::result_of::next<First>::type, Last>
+ next_build_acc_list;
+
+ typedef fusion::cons<
+ typename fusion::result_of::value_of<First>::type
+ , typename next_build_acc_list::type>
+ type;
+
+ template<typename Args>
+ static type
+ call(Args const &args, First const& f, Last const& l)
+ {
+ return type(args, next_build_acc_list::call(args, fusion::next(f), l));
+ }
+ };
+
+ namespace meta
+ {
+ template<typename Sequence>
+ struct make_acc_list
+ : build_acc_list<
+ typename fusion::result_of::begin<Sequence>::type
+ , typename fusion::result_of::end<Sequence>::type
+ >
+ {};
+ }
+
+ template<typename Sequence, typename Args>
+ typename meta::make_acc_list<Sequence>::type
+ make_acc_list(Sequence const &seq, Args const &args)
+ {
+ return meta::make_acc_list<Sequence>::call(args, fusion::begin(seq), fusion::end(seq));
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // checked_as_weighted_feature
+ template<typename Feature>
+ struct checked_as_weighted_feature
+ {
+ typedef typename as_feature<Feature>::type feature_type;
+ typedef typename as_weighted_feature<feature_type>::type type;
+ // weighted and non-weighted flavors should provide the same feature.
+ BOOST_MPL_ASSERT((
+ is_same<
+ typename feature_of<feature_type>::type
+ , typename feature_of<type>::type
+ >
+ ));
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ // as_feature_list
+ template<typename Features, typename Weight>
+ struct as_feature_list
+ : mpl::transform_view<Features, checked_as_weighted_feature<mpl::_1> >
+ {
+ };
+
+ template<typename Features>
+ struct as_feature_list<Features, void>
+ : mpl::transform_view<Features, as_feature<mpl::_1> >
+ {
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ // accumulator_wrapper
+ template<typename Accumulator, typename Feature>
+ struct accumulator_wrapper
+ : Accumulator
+ {
+ typedef Feature feature_tag;
+
+ accumulator_wrapper(accumulator_wrapper const &that)
+ : Accumulator(*static_cast<Accumulator const *>(&that))
+ {
+ }
+
+ template<typename Args>
+ accumulator_wrapper(Args const &args)
+ : Accumulator(args)
+ {
+ }
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ // to_accumulator
+ template<typename Feature, typename Sample, typename Weight>
+ struct to_accumulator
+ {
+ typedef
+ accumulator_wrapper<
+ typename mpl::apply2<typename Feature::impl, Sample, Weight>::type
+ , Feature
+ >
+ type;
+ };
+
+ template<typename Feature, typename Sample, typename Weight, typename Tag, typename AccumulatorSet>
+ struct to_accumulator<Feature, Sample, tag::external<Weight, Tag, AccumulatorSet> >
+ {
+ BOOST_MPL_ASSERT((is_same<Tag, void>));
+ BOOST_MPL_ASSERT((is_same<AccumulatorSet, void>));
+
+ typedef
+ accumulator_wrapper<
+ typename mpl::apply2<typename Feature::impl, Sample, Weight>::type
+ , Feature
+ >
+ accumulator_type;
+
+ typedef
+ typename mpl::if_<
+ typename Feature::is_weight_accumulator
+ , accumulator_wrapper<impl::external_impl<accumulator_type, tag::weights>, Feature>
+ , accumulator_type
+ >::type
+ type;
+ };
+
+ // BUGBUG work around a MPL bug wrt map insertion
+ template<typename FeatureMap, typename Feature>
+ struct insert_feature
+ : mpl::eval_if<
+ mpl::has_key<FeatureMap, typename feature_of<Feature>::type>
+ , mpl::identity<FeatureMap>
+ , mpl::insert<FeatureMap, mpl::pair<typename feature_of<Feature>::type, Feature> >
+ >
+ {
+ };
+
+ template<typename FeatureMap, typename Feature, typename Weight>
+ struct insert_dependencies
+ : mpl::fold<
+ as_feature_list<typename Feature::dependencies, Weight>
+ , FeatureMap
+ , insert_dependencies<
+ insert_feature<mpl::_1, mpl::_2>
+ , mpl::_2
+ , Weight
+ >
+ >
+ {
+ };
+
+ template<typename FeatureMap, typename Features, typename Weight>
+ struct insert_sequence
+ : mpl::fold< // BUGBUG should use insert_range, but doesn't seem to work for maps
+ as_feature_list<Features, Weight>
+ , FeatureMap
+ , insert_feature<mpl::_1, mpl::_2>
+ >
+ {
+ };
+
+ template<typename Features, typename Sample, typename Weight>
+ struct make_accumulator_tuple
+ {
+ typedef
+ typename mpl::fold<
+ as_feature_list<Features, Weight>
+ , mpl::map0<>
+ , mpl::if_<
+ mpl::is_sequence<mpl::_2>
+ , insert_sequence<mpl::_1, mpl::_2, Weight>
+ , insert_feature<mpl::_1, mpl::_2>
+ >
+ >::type
+ feature_map;
+
+ // for each element in the map, add its dependencies also
+ typedef
+ typename mpl::fold<
+ feature_map
+ , feature_map
+ , insert_dependencies<mpl::_1, mpl::second<mpl::_2>, Weight>
+ >::type
+ feature_map_with_dependencies;
+
+ // turn the map into a vector so we can sort it
+ typedef
+ typename mpl::insert_range<
+ mpl::vector<>
+ , mpl::end<mpl::vector<> >::type
+ , mpl::transform_view<feature_map_with_dependencies, mpl::second<mpl::_1> >
+ >::type
+ feature_vector_with_dependencies;
+
+ // sort the features according to which is derived from which
+ typedef
+ typename mpl::sort<
+ feature_vector_with_dependencies
+ , is_dependent_on<mpl::_2, mpl::_1>
+ >::type
+ sorted_feature_vector;
+
+ // From the vector of features, construct a vector of accumulators
+ typedef
+ typename mpl::transform<
+ sorted_feature_vector
+ , to_accumulator<mpl::_1, Sample, Weight>
+ >::type
+ type;
+ };
+
+ } // namespace detail
+
+}} // namespace boost::accumulators
+
+#endif
27 src/lib/boost/accumulators/framework/external.hpp
@@ -0,0 +1,27 @@
+///////////////////////////////////////////////////////////////////////////////
+// external.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_EXTERNAL_HPP_EAN_01_12_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_EXTERNAL_HPP_EAN_01_12_2005
+
+#include <boost/mpl/apply.hpp>
+#include <boost/accumulators/framework/accumulators/external_accumulator.hpp>
+
+//namespace boost { namespace accumulators
+//{
+//
+/////////////////////////////////////////////////////////////////////////////////
+//// external
+////
+//template<typename Type>
+//struct external
+//{
+//};
+//
+//}} // namespace boost::accumulators
+
+#endif
229 src/lib/boost/accumulators/framework/extractor.hpp
@@ -0,0 +1,229 @@
+///////////////////////////////////////////////////////////////////////////////
+// extractor.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_EXTRACTOR_HPP_EAN_28_10_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_EXTRACTOR_HPP_EAN_28_10_2005
+
+#include <boost/preprocessor/tuple/rem.hpp>
+#include <boost/preprocessor/array/size.hpp>
+#include <boost/preprocessor/array/data.hpp>
+#include <boost/preprocessor/array/elem.hpp>
+#include <boost/preprocessor/seq/to_array.hpp>
+#include <boost/preprocessor/seq/transform.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
+#include <boost/parameter/binding.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/accumulators/accumulators_fwd.hpp>
+#include <boost/accumulators/framework/parameters/accumulator.hpp>
+
+namespace boost { namespace accumulators
+{
+
+namespace detail
+{
+ template<typename AccumulatorSet, typename Feature>
+ struct accumulator_set_result
+ {
+ typedef typename as_feature<Feature>::type feature_type;
+ typedef typename mpl::apply<AccumulatorSet, feature_type>::type::result_type type;
+ };
+
+ template<typename Args, typename Feature>
+ struct argument_pack_result
+ : accumulator_set_result<
+ typename remove_reference<
+ typename parameter::binding<Args, tag::accumulator>::type
+ >::type
+ , Feature
+ >
+ {
+ };
+
+ template<typename A, typename Feature>
+ struct extractor_result
+ : mpl::eval_if<
+ detail::is_accumulator_set<A>
+ , accumulator_set_result<A, Feature>
+ , argument_pack_result<A, Feature>
+ >
+ {
+ };
+
+ template<typename Feature, typename AccumulatorSet>
+ typename extractor_result<AccumulatorSet, Feature>::type
+ do_extract(AccumulatorSet const &acc, mpl::true_)
+ {
+ typedef typename as_feature<Feature>::type feature_type;
+ return extract_result<feature_type>(acc);
+ }
+
+ template<typename Feature, typename Args>
+ typename extractor_result<Args, Feature>::type
+ do_extract(Args const &args, mpl::false_)
+ {
+ typedef typename as_feature<Feature>::type feature_type;
+ return find_accumulator<feature_type>(args[accumulator]).result(args);
+ }
+
+} // namespace detail
+
+
+///////////////////////////////////////////////////////////////////////////////
+/// Extracts the result associated with Feature from the specified accumulator_set.
+template<typename Feature>
+struct extractor
+{
+ typedef extractor<Feature> this_type;
+
+ /// The result meta-function for determining the return type of the extractor
+ template<typename F>
+ struct result;
+
+ template<typename A1>
+ struct result<this_type(A1)>
+ : detail::extractor_result<A1, Feature>
+ {
+ };
+
+ /// Extract the result associated with Feature from the accumulator set
+ /// \param acc The accumulator set object from which to extract the result
+ template<typename Arg1>
+ typename detail::extractor_result<Arg1, Feature>::type
+ operator ()(Arg1 const &arg1) const
+ {
+ // Arg1 could be an accumulator_set or an argument pack containing
+ // an accumulator_set. Dispatch accordingly.
+ return detail::do_extract<Feature>(arg1, detail::is_accumulator_set<Arg1>());
+ }
+
+ /// \overload
+ ///
+ /// \param a1 Optional named parameter to be passed to the accumulator's result() function.
+ template<typename AccumulatorSet, typename A1>
+ typename detail::extractor_result<AccumulatorSet, Feature>::type
+ operator ()(AccumulatorSet const &acc, A1 const &a1) const
+ {
+ BOOST_MPL_ASSERT((detail::is_accumulator_set<AccumulatorSet>));
+ typedef typename as_feature<Feature>::type feature_type;
+ return extract_result<feature_type>(acc, a1);
+ }
+
+ // ... other overloads generated by Boost.Preprocessor:
+
+ /// INTERNAL ONLY
+ ///
+#define BOOST_ACCUMULATORS_EXTRACTOR_FUN_OP(z, n, _) \
+ template<BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
+ struct result<this_type(BOOST_PP_ENUM_PARAMS_Z(z, n, A))> \
+ : detail::extractor_result<A1, Feature> \
+ {}; \
+ template< \
+ typename AccumulatorSet \
+ BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A) \
+ > \
+ typename detail::extractor_result<AccumulatorSet, Feature>::type \
+ operator ()( \
+ AccumulatorSet const &acc \
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) \
+ ) const \
+ { \
+ BOOST_MPL_ASSERT((detail::is_accumulator_set<AccumulatorSet>)); \
+ typedef typename as_feature<Feature>::type feature_type; \
+ return extract_result<feature_type>(acc BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a));\
+ }
+
+ BOOST_PP_REPEAT_FROM_TO(
+ 2
+ , BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
+ , BOOST_ACCUMULATORS_EXTRACTOR_FUN_OP
+ , _
+ )
+
+ #ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
+ /// \overload
+ ///
+ template<typename AccumulatorSet, typename A1, typename A2, ...>
+ typename detail::extractor_result<AccumulatorSet, Feature>::type
+ operator ()(AccumulatorSet const &acc, A1 const &a1, A2 const &a2, ...);
+ #endif
+};
+
+/// INTERNAL ONLY
+///
+#define BOOST_ACCUMULATORS_ARRAY_REM(Array) \
+ BOOST_PP_TUPLE_REM_CTOR(BOOST_PP_ARRAY_SIZE(Array), BOOST_PP_ARRAY_DATA(Array))
+
+/// INTERNAL ONLY
+///
+#define BOOST_ACCUMULATORS_SEQ_REM(Seq) \
+ BOOST_ACCUMULATORS_ARRAY_REM(BOOST_PP_SEQ_TO_ARRAY(Seq))
+
+/// INTERNAL ONLY
+///
+#define BOOST_ACCUMULATORS_ARGS_OP(s, data, elem) \
+ T ## s
+
+/// INTERNAL ONLY
+///
+#define BOOST_ACCUMULATORS_PARAMS_OP(s, data, elem) \
+ elem T ## s
+
+/// INTERNAL ONLY
+///
+#define BOOST_ACCUMULATORS_MAKE_FEATURE(Tag, Feature, ParamsSeq) \
+ Tag::Feature< \
+ BOOST_ACCUMULATORS_SEQ_REM( \
+ BOOST_PP_SEQ_TRANSFORM(BOOST_ACCUMULATORS_ARGS_OP, ~, ParamsSeq) \
+ ) \
+ >
+
+/// INTERNAL ONLY
+///
+#define BOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN_IMPL(z, n, Tag, Feature, ParamsSeq) \
+ template< \
+ BOOST_ACCUMULATORS_SEQ_REM( \
+ BOOST_PP_SEQ_TRANSFORM(BOOST_ACCUMULATORS_PARAMS_OP, ~, ParamsSeq) \
+ ) \
+ , typename Arg1 \
+ BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A) \
+ > \
+ typename boost::accumulators::detail::extractor_result< \
+ Arg1 \
+ , BOOST_ACCUMULATORS_MAKE_FEATURE(Tag, Feature, ParamsSeq) \
+ >::type \
+ Feature(Arg1 const &arg1 BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a) ) \
+ { \
+ typedef BOOST_ACCUMULATORS_MAKE_FEATURE(Tag, Feature, ParamsSeq) feature_type; \
+ return boost::accumulators::extractor<feature_type>()( \
+ arg1 BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, a)); \
+ }
+
+/// INTERNAL ONLY
+///
+#define BOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN(z, n, _) \
+ BOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN_IMPL( \
+ z \
+ , n \
+ , BOOST_PP_ARRAY_ELEM(0, _) \
+ , BOOST_PP_ARRAY_ELEM(1, _) \
+ , BOOST_PP_ARRAY_ELEM(2, _) \
+ )
+
+#define BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(Tag, Feature, ParamSeq) \
+ BOOST_PP_REPEAT( \
+ BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS) \
+ , BOOST_ACCUMULATORS_DEFINE_EXTRACTOR_FUN \
+ , (3, (Tag, Feature, ParamSeq)) \
+ )
+
+}} // namespace boost::accumulators
+
+#endif
29 src/lib/boost/accumulators/framework/features.hpp
@@ -0,0 +1,29 @@
+///////////////////////////////////////////////////////////////////////////////
+// features.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_STATISTICS_STATS_HPP_EAN_08_12_2005
+#define BOOST_ACCUMULATORS_STATISTICS_STATS_HPP_EAN_08_12_2005
+
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/mpl/vector.hpp>
+#include <boost/accumulators/accumulators_fwd.hpp>
+
+namespace boost { namespace accumulators
+{
+
+///////////////////////////////////////////////////////////////////////////////
+// features
+//
+template<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature)>
+struct features
+ : mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_ACCUMULATORS_MAX_FEATURES, Feature)>
+{
+};
+
+}} // namespace boost::accumulators
+
+#endif
20 src/lib/boost/accumulators/framework/parameters/accumulator.hpp
@@ -0,0 +1,20 @@
+///////////////////////////////////////////////////////////////////////////////
+// accumulator.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_PARAMETERS_ACCUMULATOR_HPP_EAN_31_10_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_ACCUMULATOR_HPP_EAN_31_10_2005
+
+#include <boost/parameter/keyword.hpp>
+
+namespace boost { namespace accumulators
+{
+
+BOOST_PARAMETER_KEYWORD(tag, accumulator)
+
+}} // namespace boost::accumulators
+
+#endif
20 src/lib/boost/accumulators/framework/parameters/sample.hpp
@@ -0,0 +1,20 @@
+///////////////////////////////////////////////////////////////////////////////
+// sample.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_PARAMETERS_SAMPLE_HPP_EAN_31_10_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_SAMPLE_HPP_EAN_31_10_2005
+
+#include <boost/parameter/keyword.hpp>
+
+namespace boost { namespace accumulators
+{
+
+BOOST_PARAMETER_KEYWORD(tag, sample)
+
+}} // namespace boost::accumulators
+
+#endif
21 src/lib/boost/accumulators/framework/parameters/weight.hpp
@@ -0,0 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// weight.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHT_HPP_EAN_31_10_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHT_HPP_EAN_31_10_2005
+
+#include <boost/parameter/keyword.hpp>
+
+namespace boost { namespace accumulators
+{
+
+// The weight of a single sample
+BOOST_PARAMETER_KEYWORD(tag, weight)
+
+}} // namespace boost::accumulators
+
+#endif
21 src/lib/boost/accumulators/framework/parameters/weights.hpp
@@ -0,0 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// weights.hpp
+//
+// Copyright 2005 Eric Niebler. 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_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHTS_HPP_EAN_28_10_2005
+#define BOOST_ACCUMULATORS_FRAMEWORK_PARAMETERS_WEIGHTS_HPP_EAN_28_10_2005
+
+#include <boost/parameter/keyword.hpp>
+
+namespace boost { namespace accumulators
+{
+
+// The weight accumulator
+BOOST_PARAMETER_KEYWORD(tag, weights)
+
+}} // namespace boost::accumulators
+
+#endif
75 src/lib/boost/accumulators/numeric/detail/function1.hpp
@@ -0,0 +1,75 @@
+// Copyright David Abrahams 2006. 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_DETAIL_FUNCTION1_DWA200655_HPP
+# define BOOST_DETAIL_FUNCTION1_DWA200655_HPP
+
+# include <boost/concept_check.hpp>
+# include <boost/type_traits/remove_reference.hpp>
+# include <boost/type_traits/add_const.hpp>
+# include <boost/mpl/apply.hpp>
+
+namespace bo