Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59492 - sandbox/statistics/detail/accumulator/boost/statistics/detail/accumulator/statistics
From: erwann.rogard_at_[hidden]
Date: 2010-02-04 19:42:04


Author: e_r
Date: 2010-02-04 19:42:03 EST (Thu, 04 Feb 2010)
New Revision: 59492
URL: http://svn.boost.org/trac/boost/changeset/59492

Log:
m
Text files modified:
   sandbox/statistics/detail/accumulator/boost/statistics/detail/accumulator/statistics/zscore.hpp | 80 ++++++++++++++++++----------------------
   1 files changed, 36 insertions(+), 44 deletions(-)

Modified: sandbox/statistics/detail/accumulator/boost/statistics/detail/accumulator/statistics/zscore.hpp
==============================================================================
--- sandbox/statistics/detail/accumulator/boost/statistics/detail/accumulator/statistics/zscore.hpp (original)
+++ sandbox/statistics/detail/accumulator/boost/statistics/detail/accumulator/statistics/zscore.hpp 2010-02-04 19:42:03 EST (Thu, 04 Feb 2010)
@@ -17,6 +17,7 @@
 #include <boost/accumulators/framework/parameters/sample.hpp>
 #include <boost/accumulators/framework/parameters/accumulator.hpp>
 #include <boost/accumulators/framework/depends_on.hpp>
+#include <boost/accumulators/statistics/stats.hpp>
 
 namespace boost{
 namespace statistics{
@@ -38,14 +39,9 @@
         void operator ()(dont_care_)const
         {
         }
-
- if(args[boost::accumulators::sample]<this->t)
- {
- ++this->cnt;
- }
 
         template<typename Args>
- void operator ()(const Args& args)
+ result_type result(const Args& args)const{
                 typedef boost::accumulators::tag::accumulator tag_acc_;
                 typedef boost::parameter::binding<Args,tag_acc_> bind1_;
                 typedef typename bind1_::type cref_acc_;
@@ -60,57 +56,53 @@
 
 }//impl
 
- namespace tag
- {
- struct zscore
+namespace tag
+{
+ struct zscore
         : boost::accumulators::depends_on<
                 boost::accumulators::tag::mean,
- boost::accumulators::tag::variance,
+ boost::accumulators::tag::variance
>
- {
- struct impl{
- template<typename T,typename W>
- struct apply{
- typedef boost::statistics::detail::accumulator::impl
+ {
+ struct impl{
+ template<typename T,typename W>
+ struct apply{
+ typedef boost::statistics::detail::accumulator::impl
                             ::zscore<T> type;
- };
             };
         };
- }
+ };
+}
     
- namespace result_of{
+namespace result_of{
         
- template<typename AccSet>
- struct zscore{
- typedef boost::statistics::detail
- ::accumulator::tag::zscore tag_;
- typedef typename boost::accumulators::detail::extractor_result<
- AccSet,
- tag_
- >::type type;
- };
+ template<typename AccSet>
+ struct zscore{
+ typedef boost::statistics::detail::accumulator::tag::zscore tag_;
+ typedef typename boost::accumulators::detail::extractor_result<
+ AccSet,
+ tag_
+ >::type type;
+ };
         
- }
+}
     
- namespace extract
- {
+namespace extract
+{
         
- // Usage : zscore(acc,x)
- template<typename AccSet,typename T1>
- typename boost::statistics::detail::accumulator::zscore
+ // Usage : zscore(acc,x)
+ template<typename AccSet,typename T1>
+ typename boost::statistics::detail::accumulator
                     ::result_of::template zscore<AccSet>::type
- statistic(AccSet const& acc,const T1& x)
- {
- typedef boost::statistics::detail
- ::accumulator::tag::zscore<T1> the_tag;
- return boost::accumulators::extract_result<the_tag>(
- acc,
- (
- boost::accumulators::sample = x
- )
- );
- }
+ zscore(AccSet const& acc,const T1& x)
+ {
+ typedef boost::statistics::detail::accumulator::tag::zscore the_tag;
+ return boost::accumulators::extract_result<the_tag>(
+ acc,
+ (boost::accumulators::sample = x)
+ );
     }
+}
     
     using extract::zscore;
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk