Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56324 - in sandbox/statistics/autocovariance: boost/accumulators/statistics libs/accumulators/statistics/doc
From: erwann.rogard_at_[hidden]
Date: 2009-09-20 15:38:15


Author: e_r
Date: 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
New Revision: 56324
URL: http://svn.boost.org/trac/boost/changeset/56324

Log:
cosmetic update
Text files modified:
   sandbox/statistics/autocovariance/boost/accumulators/statistics/acf.hpp | 32 ++++++++++++------------
   sandbox/statistics/autocovariance/boost/accumulators/statistics/acv0.hpp | 20 +++++++-------
   sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf.hpp | 53 ++++++++++++++++++++-------------------
   sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf_analysis.hpp | 4 +-
   sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf_moving_average.hpp | 2
   sandbox/statistics/autocovariance/boost/accumulators/statistics/integrated_acf.hpp | 34 +++++++++++++++----------
   sandbox/statistics/autocovariance/boost/accumulators/statistics/integrated_acvf.hpp | 33 ++++++++++++------------
   sandbox/statistics/autocovariance/boost/accumulators/statistics/percentage_effective_sample_size.hpp | 26 +++++++++---------
   sandbox/statistics/autocovariance/boost/accumulators/statistics/standard_error_autocorrelated.hpp | 26 +++++++++---------
   sandbox/statistics/autocovariance/boost/accumulators/statistics/standard_error_iid.hpp | 26 +++++++++---------
   sandbox/statistics/autocovariance/libs/accumulators/statistics/doc/readme.txt | 1
   11 files changed, 132 insertions(+), 125 deletions(-)

Modified: sandbox/statistics/autocovariance/boost/accumulators/statistics/acf.hpp
==============================================================================
--- sandbox/statistics/autocovariance/boost/accumulators/statistics/acf.hpp (original)
+++ sandbox/statistics/autocovariance/boost/accumulators/statistics/acf.hpp 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -40,41 +40,41 @@
 {
     ////////////////////////////////////////////////////////////////////////////
     // acf_impl
- template<typename Sample,typename Discriminator>
+ template<typename T,typename I>
     class acf_impl
       : public accumulator_base
     {
        //TODO via the feature for delay (?)
- typedef acvf_impl<Sample,Discriminator> acvf_type;
+ typedef acvf_impl<T,I> acvf_type;
            typedef typename acvf_type::result_type acvfs_result_type;
- typedef std::vector<Sample> acfs_type;
+ typedef std::vector<T> acfs_type;
     public:
        typedef boost::iterator_range<
             typename acfs_type::const_iterator> result_type;
 
- acf_impl(dont_care):acfs(0,(Sample)(0.0)){}
+ acf_impl(dont_care):acfs(0,(T)(static_cast<T>(0))){}
 
         template<typename Args>
         void operator ()(Args const &args){
             const acvfs_result_type& range
- = acvf<Discriminator>(args[accumulator]);
+ = acvf<I>(args[accumulator]);
             std::size_t sz = range.size();
             acfs.resize(sz);
- Sample acv0 = (*begin(range));
- if(acv0>0.0){
- Sample div=(1.0/acv0);
+ T acv0 = (*begin(range));
+ if(acv0>static_cast<T>(0)){
+ T div=(static_cast<T>(1)/acv0);
                 transform(
                     begin(range),
                     end(range),
                     acfs.begin(),
                     boost::bind(
- std::multiplies<Sample>(),
+ std::multiplies<T>(),
                         _1,
                         div
                     )
                 );
             }else{
- std::fill_n(acfs.begin(),sz,0.0);
+ std::fill_n(acfs.begin(),sz,static_cast<T>(0));
             }
         }
         result_type result(dont_care) const
@@ -93,12 +93,12 @@
 
 namespace tag
 {
- template <typename Discriminator = default_delay_discriminator>
+ template <typename I = default_delay_discriminator>
     struct acf
- : depends_on<acvf<Discriminator> >
+ : depends_on<acvf<I> >
     {
         /// INTERNAL ONLY
- typedef accumulators::impl::acf_impl<mpl::_1,Discriminator> impl;
+ typedef accumulators::impl::acf_impl<mpl::_1,I> impl;
 
     };
 }
@@ -112,11 +112,11 @@
 namespace extract
 {
 
- template<typename Discriminator,typename AccumulatorSet>
+ template<typename I,typename AccumulatorSet>
   typename
- mpl::apply<AccumulatorSet,tag::acf<Discriminator> >::type::result_type
+ mpl::apply<AccumulatorSet,tag::acf<I> >::type::result_type
   acf(AccumulatorSet const& acc){
- typedef tag::acf<Discriminator> the_tag;
+ typedef tag::acf<I> the_tag;
     return extract_result<the_tag>(acc);
   }//typical call://acf<default_delay_discriminator>(acc)
 

Modified: sandbox/statistics/autocovariance/boost/accumulators/statistics/acv0.hpp
==============================================================================
--- sandbox/statistics/autocovariance/boost/accumulators/statistics/acv0.hpp (original)
+++ sandbox/statistics/autocovariance/boost/accumulators/statistics/acv0.hpp 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -37,19 +37,19 @@
 {
     ////////////////////////////////////////////////////////////////////////////
     // acv0_impl
- template<typename Sample,typename Discriminator>
+ template<typename T,typename I>
     class acv0_impl
       : public accumulator_base
     {
     public:
- typedef Sample result_type;
+ typedef T result_type;
         acv0_impl(dont_care)
         {}
 
         template<typename Args>
         void operator()(Args const &args)
         {
- val = (*begin(acvf<Discriminator>(args[accumulator])));
+ val = (*begin(acvf<I>(args[accumulator])));
         }
 
 
@@ -58,7 +58,7 @@
             return val;
         }
     private:
- Sample val;
+ T val;
     };
 
 } // namespace impl
@@ -68,14 +68,14 @@
 
 namespace tag
 {
- template <typename Discriminator = default_delay_discriminator>
+ template <typename I = default_delay_discriminator>
     struct acv0
- : depends_on<acvf<Discriminator> >
+ : depends_on<acvf<I> >
     {
         /// INTERNAL ONLY
       typedef
         accumulators::impl::acv0_impl<
- mpl::_1,Discriminator> impl;
+ mpl::_1,I> impl;
 
     };
 }
@@ -90,12 +90,12 @@
 {
 
 
- template<typename Discriminator,typename AccumulatorSet>
+ template<typename I,typename AccumulatorSet>
   typename mpl::apply<
- AccumulatorSet,tag::acv0<Discriminator>
+ AccumulatorSet,tag::acv0<I>
>::type::result_type
   acv0(AccumulatorSet const& acc){
- typedef tag::acv0<Discriminator> the_tag;
+ typedef tag::acv0<I> the_tag;
     return extract_result<the_tag>(acc);
   }
 

Modified: sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf.hpp
==============================================================================
--- sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf.hpp (original)
+++ sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf.hpp 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -40,24 +40,26 @@
 {
     ////////////////////////////////////////////////////////////////////////////
     // acvf_impl (Autocovariance function)
- template<typename Sample,typename Discriminator>
+ //
+ template<typename T,typename I>
     class acvf_impl
       : public accumulator_base
     {
- typedef std::vector<Sample> acvs_type;
- typedef delay_impl<Sample,Discriminator> delay_type;
- typedef typename delay_type::result_type input_type;
+ typedef std::vector<T> acvs_type;
+ typedef delay_impl<T,I> delay_type;
+ typedef typename delay_type::result_type input_type;
     public:
- typedef boost::iterator_range<
- typename acvs_type::const_iterator
- > result_type;
+ typedef I discriminator_type;
 
+ typedef boost::iterator_range<
+ typename acvs_type::const_iterator
+ > result_type;
 
         template<typename Args>
         acvf_impl(Args const &args)
         :acvs(
- args[tag::delay<Discriminator>::cache_size|delay(args).size()],
- (Sample)(0.0)
+ args[tag::delay<I>::cache_size|delay(args).size()],
+ static_cast<T>(0)
         )
         {
         }
@@ -66,10 +68,12 @@
         :acvs(that.acvs){}
 
         acvf_impl& operator=(const acvf_impl& that){
- if(&that!=this){acvs = that.acvs;} return *this;
+ if(&that!=this){
+ acvs = that.acvs;
+ }
+ return *this;
         }
 
-
         template<typename Args>
         void operator ()(Args const &args)
         {
@@ -82,20 +86,17 @@
           in_iter_type i = begin(in);
           in_iter_type e = end(in);
 
- Sample x0 = (*i);
+ T x0 = (*i);
           std::size_t n = count(args);
           std::size_t k = 0;
- //TODO replace by
- //for_each(make_zip_iterator(
- // make_tuple(begin(in),acvs.begin())),...,local_class(...))
                   while((k<in_sz) && (n>1+k)){
                       BOOST_ASSERT(i<e);
- Sample xk = (*i);
- Sample div = (Sample) ((n-1)-k);
- Sample sum_prod = acvs[k] * div;
- Sample mean_val = mean(args);
+ T xk = (*i);
+ T div = (T) ((n-1)-k);
+ T sum_prod = acvs[k] * div;
+ T mean_val = mean(args);
               sum_prod += (xk - mean_val) * (x0 - mean_val);
- div = (Sample)(n-k);
+ div = (T)(n-k);
               acvs[k] = sum_prod / div;
               ++i;
               ++k;
@@ -120,12 +121,12 @@
 
 namespace tag
 {
- template <typename Discriminator = default_delay_discriminator>
+ template <typename I = default_delay_discriminator>
     struct acvf
- : depends_on<count,mean,delay<Discriminator> >
+ : depends_on<count, mean, delay<I> >
     {
         /// INTERNAL ONLY
- typedef accumulators::impl::acvf_impl<mpl::_1,Discriminator> impl;
+ typedef accumulators::impl::acvf_impl<mpl::_1,I> impl;
 
     };
 }
@@ -143,11 +144,11 @@
 // //struct my_other_delay {};
 // //extractor<tag::delay<my_other_delay> > other_delay={};
 
- template<typename Discriminator,typename AccumulatorSet>
+ template<typename I,typename AccumulatorSet>
   typename
- mpl::apply<AccumulatorSet,tag::acvf<Discriminator> >::type::result_type
+ mpl::apply<AccumulatorSet,tag::acvf<I> >::type::result_type
   acvf(AccumulatorSet const& acc){
- typedef tag::acvf<Discriminator> the_tag;
+ typedef tag::acvf<I> the_tag;
     return extract_result<the_tag>(acc);
   }//typical call://acvf<default_delay_discriminator>(acc)
 

Modified: sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf_analysis.hpp
==============================================================================
--- sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf_analysis.hpp (original)
+++ sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf_analysis.hpp 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -37,10 +37,10 @@
 
     template<
         typename RealType,
- typename Discriminator = default_delay_discriminator
+ typename I = default_delay_discriminator
>
     class acvf_analysis{
- typedef Discriminator discr_t;
+ typedef I discr_t;
         public:
         typedef RealType value_type;
 

Modified: sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf_moving_average.hpp
==============================================================================
--- sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf_moving_average.hpp (original)
+++ sandbox/statistics/autocovariance/boost/accumulators/statistics/acvf_moving_average.hpp 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -42,7 +42,7 @@
             }
             result_type operator()(argument_type delay)const{
                 typedef typename range_iterator<const R>::type iterator_type;
- result_type res = 0.0;
+ result_type res = static_cast<result_type>(0);
                 size_t h = delay;
                 if(coeffs.size()>0){
                     std::size_t q = coeffs.size()-1;//MA(q)

Modified: sandbox/statistics/autocovariance/boost/accumulators/statistics/integrated_acf.hpp
==============================================================================
--- sandbox/statistics/autocovariance/boost/accumulators/statistics/integrated_acf.hpp (original)
+++ sandbox/statistics/autocovariance/boost/accumulators/statistics/integrated_acf.hpp 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -39,27 +39,33 @@
 {
     ////////////////////////////////////////////////////////////////////////////
     // integrated_acf_impl
- template<typename Sample,typename Discriminator>
+ template<typename T,typename I>
     class integrated_acf_impl
       : public accumulator_base
     {
     public:
- typedef Sample result_type;
+ typedef T result_type;
 
- integrated_acf_impl(dont_care):val((Sample)(0.0)){}
+ integrated_acf_impl(dont_care):val(static_cast<T>(0)){}
 
         template<typename Args>
         void operator ()(Args const &args)
         {
- Sample iacvf = integrated_acvf<Discriminator>(args[accumulator]);
- Sample acv0_val = acv0<Discriminator>(args[accumulator]);
- if(acv0_val>0.0){val=iacvf/acv0_val;}else{val = 0.0;}
+ T iacvf = integrated_acvf<I>(args[accumulator]);
+ T acv0_val = acv0<I>(args[accumulator]);
+ if(acv0_val>static_cast<T>(0)){
+ val = iacvf/acv0_val;
+ }else{
+ val = static_cast<T>(0);
+ }
                 }
 
- result_type result(dont_care) const{return val;}
+ result_type result(dont_care) const{
+ return val;
+ }
 
     private:
- Sample val;
+ T val;
 
     };
 
@@ -72,13 +78,13 @@
 namespace tag
 {
 
- template <typename Discriminator = default_delay_discriminator>
+ template <typename I = default_delay_discriminator>
     struct integrated_acf
- : depends_on<acv0<Discriminator>,integrated_acvf<Discriminator> >
+ : depends_on<acv0<I>,integrated_acvf<I> >
     {
         /// INTERNAL ONLY
       typedef
- accumulators::impl::integrated_acf_impl<mpl::_1,Discriminator> impl;
+ accumulators::impl::integrated_acf_impl<mpl::_1,I> impl;
 
     };
 }
@@ -92,11 +98,11 @@
 namespace extract
 {
 
- template<typename Discriminator,typename AccumulatorSet>
+ template<typename I,typename AccumulatorSet>
   typename mpl::apply<
- AccumulatorSet,tag::integrated_acf<Discriminator> >::type::result_type
+ AccumulatorSet,tag::integrated_acf<I> >::type::result_type
   integrated_acf(AccumulatorSet const& acc){
- typedef tag::integrated_acf<Discriminator> the_tag;
+ typedef tag::integrated_acf<I> the_tag;
     return extract_result<the_tag>(acc);
   }
 

Modified: sandbox/statistics/autocovariance/boost/accumulators/statistics/integrated_acvf.hpp
==============================================================================
--- sandbox/statistics/autocovariance/boost/accumulators/statistics/integrated_acvf.hpp (original)
+++ sandbox/statistics/autocovariance/boost/accumulators/statistics/integrated_acvf.hpp 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -22,7 +22,6 @@
 
 #include <boost/accumulators/framework/extractor.hpp>
 #include <boost/accumulators/framework/accumulator_base.hpp>
-#include <boost/accumulators/framework/extractor.hpp>
 #include <boost/accumulators/numeric/functional.hpp>
 #include <boost/accumulators/framework/parameters/sample.hpp>
 #include <boost/accumulators/framework/depends_on.hpp>
@@ -38,32 +37,32 @@
 {
     ////////////////////////////////////////////////////////////////////////////
     // integrated_acvf_impl
- template<typename Sample,typename Discriminator>
+ template<typename T,typename I>
     class integrated_acvf_impl
       : public accumulator_base
     {
        //TODO or via feature?
- typedef acvf_impl<Sample,Discriminator> acvf_type;
- typedef typename acvf_type::result_type range_type;
+ typedef acvf_impl<T,I> acvf_type;
+ typedef typename acvf_type::result_type range_type;
     public:
- typedef Sample result_type;
- integrated_acvf_impl(dont_care):val(0.0){}
+ typedef T result_type;
+ integrated_acvf_impl(dont_care):val(static_cast<T>(0)){}
 
         template<typename Args>
         void operator ()(Args const &args)
         {
- range_type range = acvf<Discriminator>(args[accumulator]);
+ range_type range = acvf<I>(args[accumulator]);
           typedef typename range_type::const_iterator iter_type;
- Sample acv0_val = (*begin(range));
- val = std::accumulate(begin(range),end(range),0.0);
- val *=2.0;
+ T acv0_val = (*begin(range));
+ val = std::accumulate(begin(range),end(range),static_cast<T>(0));
+ val *=static_cast<T>(2);
           val -=acv0_val;
                 }
 
         result_type result(dont_care) const{return val;}
 
     private:
- Sample val;
+ T val;
 
     };
 
@@ -75,12 +74,12 @@
 
 namespace tag
 {
- template <typename Discriminator = default_delay_discriminator>
+ template <typename I = default_delay_discriminator>
     struct integrated_acvf
- : depends_on<acvf<Discriminator> >
+ : depends_on<acvf<I> >
     {
         /// INTERNAL ONLY
- typedef accumulators::impl::integrated_acvf_impl<mpl::_1,Discriminator> impl;
+ typedef accumulators::impl::integrated_acvf_impl<mpl::_1,I> impl;
 
     };
 }
@@ -97,12 +96,12 @@
 // extractor<tag::integrated_acvf<> > const integrated_acvf = {};
 
   // see acvf about default_delay_discriminator
- template<typename Discriminator,typename AccumulatorSet>
+ template<typename I,typename AccumulatorSet>
   typename mpl::apply<
- AccumulatorSet,tag::integrated_acvf<Discriminator>
+ AccumulatorSet,tag::integrated_acvf<I>
>::type::result_type
   integrated_acvf(AccumulatorSet const& acc){
- typedef tag::integrated_acvf<Discriminator> the_tag;
+ typedef tag::integrated_acvf<I> the_tag;
     return extract_result<the_tag>(acc);
   }
 

Modified: sandbox/statistics/autocovariance/boost/accumulators/statistics/percentage_effective_sample_size.hpp
==============================================================================
--- sandbox/statistics/autocovariance/boost/accumulators/statistics/percentage_effective_sample_size.hpp (original)
+++ sandbox/statistics/autocovariance/boost/accumulators/statistics/percentage_effective_sample_size.hpp 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -37,7 +37,7 @@
 {
     ////////////////////////////////////////////////////////////////////////////
     // percentage_effective_sample_size
- template<typename Sample,typename Discriminator>
+ template<typename T,typename I>
     class percentage_effective_sample_size_impl
       : public accumulator_base
     {
@@ -49,13 +49,13 @@
         template<typename Args>
         void operator()(const Args& args)
         {
- Sample iacvf = integrated_acvf<Discriminator>(args[accumulator]);
- if(iacvf>0.0){
+ T iacvf = integrated_acvf<I>(args[accumulator]);
+ if(iacvf>static_cast<T>(0)){
 
- typedef boost::numeric::converter<result_type,Sample> Sample2res;
- Sample acv0_val = acv0<Discriminator>(args[accumulator]);
- Sample tmp = 100.0*acv0_val/iacvf;
- val = Sample2res::convert(tmp);
+ typedef boost::numeric::converter<result_type,T> T2res;
+ T acv0_val = acv0<I>(args[accumulator]);
+ T tmp = static_cast<T>(100)*acv0_val/iacvf;
+ val = T2res::convert(tmp);
             }else{
                 val = 0;
             }
@@ -76,14 +76,14 @@
 
 namespace tag
 {
- template <typename Discriminator = default_delay_discriminator>
+ template <typename I = default_delay_discriminator>
     struct percentage_effective_sample_size
- : depends_on<acv0<Discriminator>, integrated_acvf<Discriminator> >
+ : depends_on<acv0<I>, integrated_acvf<I> >
     {
         /// INTERNAL ONLY
       typedef
         accumulators::impl::percentage_effective_sample_size_impl<
- mpl::_1,Discriminator> impl;
+ mpl::_1,I> impl;
 
     };
 }
@@ -101,12 +101,12 @@
 // const percentage_effective_sample_size = {};
 
   // see acvf about default_delay_discriminator
- template<typename Discriminator,typename AccumulatorSet>
+ template<typename I,typename AccumulatorSet>
   typename mpl::apply<
- AccumulatorSet,tag::percentage_effective_sample_size<Discriminator>
+ AccumulatorSet,tag::percentage_effective_sample_size<I>
>::type::result_type
   percentage_effective_sample_size(AccumulatorSet const& acc){
- typedef tag::percentage_effective_sample_size<Discriminator> the_tag;
+ typedef tag::percentage_effective_sample_size<I> the_tag;
     return extract_result<the_tag>(acc);
   }
 

Modified: sandbox/statistics/autocovariance/boost/accumulators/statistics/standard_error_autocorrelated.hpp
==============================================================================
--- sandbox/statistics/autocovariance/boost/accumulators/statistics/standard_error_autocorrelated.hpp (original)
+++ sandbox/statistics/autocovariance/boost/accumulators/statistics/standard_error_autocorrelated.hpp 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -38,12 +38,12 @@
 {
     ////////////////////////////////////////////////////////////////////////////
     // standard_error_autocorrelated
- template<typename Sample,typename Discriminator>
+ template<typename T,typename I>
     class standard_error_autocorrelated_impl
       : public accumulator_base
     {
     public:
- typedef Sample result_type;
+ typedef T result_type;
 
         standard_error_autocorrelated_impl(dont_care)
         {}
@@ -51,10 +51,10 @@
         template<typename Args>
         void operator()(Args const &args)
         {
- Sample iacv = integrated_acvf<Discriminator>(args[accumulator]);
- Sample n = (Sample)(count(args));
- val = 0.0;
- if((iacv>0.0) && (n>0.0)){val = sqrt(iacv/n);}//also = sqrt(acv0/ess)
+ T iacv = integrated_acvf<I>(args[accumulator]);
+ T n = (T)(count(args));
+ val = static_cast<T>(0);
+ if((iacv>static_cast<T>(0)) && (n>static_cast<T>(0))){val = sqrt(iacv/n);}//also = sqrt(acv0/ess)
         }
 
         result_type result(dont_care) const
@@ -62,7 +62,7 @@
             return val;
         }
     private:
- Sample val;
+ T val;
     };
 
 } // namespace impl
@@ -72,14 +72,14 @@
 
 namespace tag
 {
- template <typename Discriminator = default_delay_discriminator>
+ template <typename I = default_delay_discriminator>
     struct standard_error_autocorrelated
- : depends_on<count,integrated_acvf<Discriminator> >
+ : depends_on<count,integrated_acvf<I> >
     {
         /// INTERNAL ONLY
       typedef
         accumulators::impl::standard_error_autocorrelated_impl<
- mpl::_1,Discriminator> impl;
+ mpl::_1,I> impl;
 
     };
 }
@@ -97,12 +97,12 @@
 // const standard_error_autocorrelated = {};
 
   // see acvf about default_delay_discriminator
- template<typename Discriminator,typename AccumulatorSet>
+ template<typename I,typename AccumulatorSet>
   typename mpl::apply<
- AccumulatorSet,tag::standard_error_autocorrelated<Discriminator>
+ AccumulatorSet,tag::standard_error_autocorrelated<I>
>::type::result_type
   standard_error_autocorrelated(AccumulatorSet const& acc){
- typedef tag::standard_error_autocorrelated<Discriminator> the_tag;
+ typedef tag::standard_error_autocorrelated<I> the_tag;
     return extract_result<the_tag>(acc);
   }
 

Modified: sandbox/statistics/autocovariance/boost/accumulators/statistics/standard_error_iid.hpp
==============================================================================
--- sandbox/statistics/autocovariance/boost/accumulators/statistics/standard_error_iid.hpp (original)
+++ sandbox/statistics/autocovariance/boost/accumulators/statistics/standard_error_iid.hpp 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -38,12 +38,12 @@
 {
     ////////////////////////////////////////////////////////////////////////////
     // standard_error_iid
- template<typename Sample,typename Discriminator>
+ template<typename T,typename I>
     class standard_error_iid_impl
       : public accumulator_base
     {
     public:
- typedef Sample result_type;
+ typedef T result_type;
 
         standard_error_iid_impl(dont_care)
         {}
@@ -51,10 +51,10 @@
         template<typename Args>
         void operator()(Args const &args)
         {
- Sample acv0_val = acv0<Discriminator>(args[accumulator]);
- Sample n = (Sample)(count(args));
- val = 0.0;
- if((acv0_val>0.0) && (n>0.0)){val = sqrt(acv0_val/n);}
+ T acv0_val = acv0<I>(args[accumulator]);
+ T n = (T)(count(args));
+ val = static_cast<T>(0);
+ if((acv0_val>static_cast<T>(0)) && (n>static_cast<T>(0))){val = sqrt(acv0_val/n);}
         }
 
 
@@ -63,7 +63,7 @@
             return val;
         }
     private:
- Sample val;
+ T val;
     };
 
 } // namespace impl
@@ -73,14 +73,14 @@
 
 namespace tag
 {
- template <typename Discriminator = default_delay_discriminator>
+ template <typename I = default_delay_discriminator>
     struct standard_error_iid
- : depends_on<count,acv0<Discriminator> >
+ : depends_on<count,acv0<I> >
     {
         /// INTERNAL ONLY
       typedef
         accumulators::impl::standard_error_iid_impl<
- mpl::_1,Discriminator> impl;
+ mpl::_1,I> impl;
 
     };
 }
@@ -98,12 +98,12 @@
 // const standard_error_iid = {};
 
   // see acvf about default_delay_discriminator
- template<typename Discriminator,typename AccumulatorSet>
+ template<typename I,typename AccumulatorSet>
   typename mpl::apply<
- AccumulatorSet,tag::standard_error_iid<Discriminator>
+ AccumulatorSet,tag::standard_error_iid<I>
>::type::result_type
   standard_error_iid(AccumulatorSet const& acc){
- typedef tag::standard_error_iid<Discriminator> the_tag;
+ typedef tag::standard_error_iid<I> the_tag;
     return extract_result<the_tag>(acc);
   }
 

Modified: sandbox/statistics/autocovariance/libs/accumulators/statistics/doc/readme.txt
==============================================================================
--- sandbox/statistics/autocovariance/libs/accumulators/statistics/doc/readme.txt (original)
+++ sandbox/statistics/autocovariance/libs/accumulators/statistics/doc/readme.txt 2009-09-20 15:38:13 EDT (Sun, 20 Sep 2009)
@@ -35,6 +35,7 @@
 
 [ History ]
 
+2009/09 : Cosmetic changes
 2009/07 : Cosmetic changes
 2008/04 : First version
 


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