/
usr
/
include
/
boost
/
accumulators
/
statistics
/
/usr/include/boost/accumulators/statistics
mkdir
upload
Name
Size
Mode
Actions
parameters/
-
0755
rm
variates/
-
0755
rm
count.hpp
2013
0644
edit
dl
rm
covariance.hpp
7137
0644
edit
dl
rm
density.hpp
10007
0644
edit
dl
rm
error_of.hpp
2588
0644
edit
dl
rm
error_of_mean.hpp
2193
0644
edit
dl
rm
extended_p_square.hpp
11633
0644
edit
dl
rm
extended_p_square_quantile.hpp
12522
0644
edit
dl
rm
kurtosis.hpp
3864
0644
edit
dl
rm
max.hpp
2294
0644
edit
dl
rm
mean.hpp
9334
0644
edit
dl
rm
median.hpp
10242
0644
edit
dl
rm
min.hpp
2294
0644
edit
dl
rm
moment.hpp
3436
0644
edit
dl
rm
peaks_over_threshold.hpp
17525
0644
edit
dl
rm
pot_quantile.hpp
7336
0644
edit
dl
rm
pot_tail_mean.hpp
7802
0644
edit
dl
rm
p_square_cumulative_distribution.hpp
955
0644
edit
dl
rm
p_square_cumul_dist.hpp
10365
0644
edit
dl
rm
p_square_quantile.hpp
10086
0644
edit
dl
rm
rolling_count.hpp
2574
0644
edit
dl
rm
rolling_mean.hpp
6753
0644
edit
dl
rm
rolling_moment.hpp
3741
0644
edit
dl
rm
rolling_sum.hpp
2871
0644
edit
dl
rm
rolling_variance.hpp
9486
0644
edit
dl
rm
rolling_window.hpp
7254
0644
edit
dl
rm
skewness.hpp
3691
0644
edit
dl
rm
stats.hpp
972
0644
edit
dl
rm
sum.hpp
3884
0644
edit
dl
rm
sum_kahan.hpp
5104
0644
edit
dl
rm
tail.hpp
11012
0644
edit
dl
rm
tail_mean.hpp
9158
0644
edit
dl
rm
tail_quantile.hpp
5535
0644
edit
dl
rm
tail_variate.hpp
4504
0644
edit
dl
rm
tail_variate_means.hpp
10463
0644
edit
dl
rm
times2_iterator.hpp
1965
0644
edit
dl
rm
variance.hpp
7522
0644
edit
dl
rm
weighted_covariance.hpp
5244
0644
edit
dl
rm
weighted_density.hpp
9518
0644
edit
dl
rm
weighted_extended_p_square.hpp
12842
0644
edit
dl
rm
weighted_kurtosis.hpp
4147
0644
edit
dl
rm
weighted_mean.hpp
6637
0644
edit
dl
rm
weighted_median.hpp
8667
0644
edit
dl
rm
weighted_moment.hpp
3384
0644
edit
dl
rm
weighted_peaks_over_threshold.hpp
12352
0644
edit
dl
rm
weighted_p_square_cumulative_distribution.hpp
1009
0644
edit
dl
rm
weighted_p_square_cumul_dist.hpp
11058
0644
edit
dl
rm
weighted_p_square_quantile.hpp
11110
0644
edit
dl
rm
weighted_skewness.hpp
3844
0644
edit
dl
rm
weighted_sum.hpp
3639
0644
edit
dl
rm
weighted_sum_kahan.hpp
4559
0644
edit
dl
rm
weighted_tail_mean.hpp
5788
0644
edit
dl
rm
weighted_tail_quantile.hpp
5135
0644
edit
dl
rm
weighted_tail_variate_means.hpp
10052
0644
edit
dl
rm
weighted_variance.hpp
6774
0644
edit
dl
rm
with_error.hpp
1277
0644
edit
dl
rm
Edit:
/usr/include/boost/accumulators/statistics/sum_kahan.hpp
(5104B)
/////////////////////////////////////////////////////////////////////////////// // sum_kahan.hpp // // Copyright 2010 Gaetano Mendola. // Copyright 2011 Simon West. // 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_SUM_KAHAN_HPP_EAN_26_07_2010 #define BOOST_ACCUMULATORS_STATISTICS_SUM_KAHAN_HPP_EAN_26_07_2010 #include <boost/accumulators/framework/accumulator_base.hpp> #include <boost/accumulators/framework/parameters/sample.hpp> #include <boost/accumulators/statistics_fwd.hpp> #include <boost/accumulators/statistics/sum.hpp> #include <boost/accumulators/statistics/weighted_sum_kahan.hpp> #include <boost/numeric/conversion/cast.hpp> namespace boost { namespace accumulators { namespace impl { #if _MSC_VER > 1400 # pragma float_control(push) # pragma float_control(precise, on) #endif template<typename Sample, typename Tag> struct sum_kahan_impl : accumulator_base { typedef Sample result_type; //////////////////////////////////////////////////////////////////////////// // sum_kahan_impl /** @brief Kahan summation algorithm The Kahan summation algorithm reduces the numerical error obtained with standard sequential sum. */ template<typename Args> sum_kahan_impl(Args const & args) : sum(args[parameter::keyword<Tag>::get() | Sample()]), compensation(boost::numeric_cast<Sample>(0.0)) { } template<typename Args> void #if BOOST_ACCUMULATORS_GCC_VERSION > 40305 __attribute__((__optimize__("no-associative-math"))) #endif operator ()(Args const & args) { const Sample myTmp1 = args[parameter::keyword<Tag>::get()] - this->compensation; const Sample myTmp2 = this->sum + myTmp1; this->compensation = (myTmp2 - this->sum) - myTmp1; this->sum = myTmp2; } result_type result(dont_care) const { return this->sum; } // make this accumulator serializeable template<class Archive> void serialize(Archive & ar, const unsigned int file_version) { ar & sum; ar & compensation; } private: Sample sum; Sample compensation; }; #if _MSC_VER > 1400 # pragma float_control(pop) #endif } // namespace impl /////////////////////////////////////////////////////////////////////////////// // tag::sum_kahan // tag::sum_of_weights_kahan // tag::sum_of_variates_kahan // namespace tag { struct sum_kahan : depends_on<> { /// INTERNAL ONLY /// typedef impl::sum_kahan_impl< mpl::_1, tag::sample > impl; }; struct sum_of_weights_kahan : depends_on<> { typedef mpl::true_ is_weight_accumulator; /// INTERNAL ONLY /// typedef accumulators::impl::sum_kahan_impl<mpl::_2, tag::weight> impl; }; template<typename VariateType, typename VariateTag> struct sum_of_variates_kahan : depends_on<> { /// INTERNAL ONLY /// typedef mpl::always<accumulators::impl::sum_kahan_impl<VariateType, VariateTag> > impl; }; } // namespace tag /////////////////////////////////////////////////////////////////////////////// // extract::sum_kahan // extract::sum_of_weights_kahan // extract::sum_of_variates_kahan // namespace extract { extractor<tag::sum_kahan> const sum_kahan = {}; extractor<tag::sum_of_weights_kahan> const sum_of_weights_kahan = {}; extractor<tag::abstract_sum_of_variates> const sum_of_variates_kahan = {}; BOOST_ACCUMULATORS_IGNORE_GLOBAL(sum_kahan) BOOST_ACCUMULATORS_IGNORE_GLOBAL(sum_of_weights_kahan) BOOST_ACCUMULATORS_IGNORE_GLOBAL(sum_of_variates_kahan) } // namespace extract using extract::sum_kahan; using extract::sum_of_weights_kahan; using extract::sum_of_variates_kahan; // sum(kahan) -> sum_kahan template<> struct as_feature<tag::sum(kahan)> { typedef tag::sum_kahan type; }; // sum_of_weights(kahan) -> sum_of_weights_kahan template<> struct as_feature<tag::sum_of_weights(kahan)> { typedef tag::sum_of_weights_kahan type; }; // So that sum_kahan can be automatically substituted with // weighted_sum_kahan when the weight parameter is non-void. template<> struct as_weighted_feature<tag::sum_kahan> { typedef tag::weighted_sum_kahan type; }; template<> struct feature_of<tag::weighted_sum_kahan> : feature_of<tag::sum> {}; // for the purposes of feature-based dependency resolution, // sum_kahan provides the same feature as sum template<> struct feature_of<tag::sum_kahan> : feature_of<tag::sum> { }; // for the purposes of feature-based dependency resolution, // sum_of_weights_kahan provides the same feature as sum_of_weights template<> struct feature_of<tag::sum_of_weights_kahan> : feature_of<tag::sum_of_weights> { }; template<typename VariateType, typename VariateTag> struct feature_of<tag::sum_of_variates_kahan<VariateType, VariateTag> > : feature_of<tag::abstract_sum_of_variates> { }; }} // namespace boost::accumulators #endif
Save
cmd:
run