Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57589 - in sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling: statistics weights
From: erwann.rogard_at_[hidden]
Date: 2009-11-11 19:37:48


Author: e_r
Date: 2009-11-11 19:37:48 EST (Wed, 11 Nov 2009)
New Revision: 57589
URL: http://svn.boost.org/trac/boost/changeset/57589

Log:
m
Text files modified:
   sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/statistics/variance_of_mean_normalized.hpp | 2 --
   sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/weights/find_scale_to_finite_sum.hpp | 2 +-
   sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/weights/prepare_weights.hpp | 9 +++++++--
   3 files changed, 8 insertions(+), 5 deletions(-)

Modified: sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/statistics/variance_of_mean_normalized.hpp
==============================================================================
--- sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/statistics/variance_of_mean_normalized.hpp (original)
+++ sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/statistics/variance_of_mean_normalized.hpp 2009-11-11 19:37:48 EST (Wed, 11 Nov 2009)
@@ -46,11 +46,9 @@
         template<typename Args>
         result_type result(const Args& args) const
         {
-
             typedef
                 typename boost::parameter::binding<Args,tag_acc_>::type cref_;
             cref_ acc = args[boost::accumulators::accumulator];
-
             T v = accumulators::extract_result<tag_v_>(acc);
             T c = accumulators::extract_result<tag_m_>(acc);
             return v / (c*c);

Modified: sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/weights/find_scale_to_finite_sum.hpp
==============================================================================
--- sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/weights/find_scale_to_finite_sum.hpp (original)
+++ sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/weights/find_scale_to_finite_sum.hpp 2009-11-11 19:37:48 EST (Wed, 11 Nov 2009)
@@ -53,7 +53,7 @@
         typedef typename iterator_value<InIt>::type val_;
         static val_ zero = static_cast<val_>(0);
         static val_ two = static_cast<val_>(2);
- static val_ eps = math::tools::epsilon<val_>();
+ static val_ eps = boost::math::tools::epsilon<val_>();
 
         BOOST_ASSERT(low_init < high_init);
         BOOST_ASSERT(low_init > zero);

Modified: sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/weights/prepare_weights.hpp
==============================================================================
--- sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/weights/prepare_weights.hpp (original)
+++ sandbox/statistics/importance_sampling/boost/statistics/detail/importance_sampling/weights/prepare_weights.hpp 2009-11-11 19:37:48 EST (Wed, 11 Nov 2009)
@@ -46,6 +46,7 @@
         value_type offset()const{ return this->offset_; }
         // w <- w/c such that sum{w/c}<inf
         value_type scaling_factor()const{ return this->scaling_factor_; }
+ value_type count()const{ return this->n_; }
         
         // [ Side effect ]
         // 1) w <- exp(lw+offset)
@@ -65,6 +66,8 @@
                 b_w,
                 e_w
             );
+
+ this->n_ = std::distance(b_w,e_w);
         }
 
         static const char* header;
@@ -72,6 +75,7 @@
         value_type max_log_;
         value_type offset_;
         value_type scaling_factor_;
+ size_type n_;
         static const value_type zero;
         static const value_type default_max_log;
 
@@ -84,7 +88,8 @@
     ){
         out <<
             (
- boost::format("(%1%,%2%)")
+ boost::format("(%1%,%2%,%3%)")
+ % that.count()
                 % that.offset()
                 % that.scaling_factor()
             ).str();
@@ -93,7 +98,7 @@
 
     template<typename T>
     const char* prepare_weights<T>::header
- = "(offset,scaling_factor)";
+ = "(count, offset,scaling_factor)";
 
     template<typename T>
     const typename prepare_weights<T>::value_type


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