Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56903 - in sandbox/statistics/importance_sampling/libs/importance_sampling: doc example src
From: erwann.rogard_at_[hidden]
Date: 2009-10-16 01:16:24


Author: e_r
Date: 2009-10-16 01:16:23 EDT (Fri, 16 Oct 2009)
New Revision: 56903
URL: http://svn.boost.org/trac/boost/changeset/56903

Log:
m
Text files modified:
   sandbox/statistics/importance_sampling/libs/importance_sampling/doc/readme.txt | 5 ++++-
   sandbox/statistics/importance_sampling/libs/importance_sampling/example/sampler.cpp | 14 +++++++-------
   sandbox/statistics/importance_sampling/libs/importance_sampling/example/sampler.h | 2 +-
   sandbox/statistics/importance_sampling/libs/importance_sampling/src/main.cpp | 2 +-
   4 files changed, 13 insertions(+), 10 deletions(-)

Modified: sandbox/statistics/importance_sampling/libs/importance_sampling/doc/readme.txt
==============================================================================
--- sandbox/statistics/importance_sampling/libs/importance_sampling/doc/readme.txt (original)
+++ sandbox/statistics/importance_sampling/libs/importance_sampling/doc/readme.txt 2009-10-16 01:16:23 EDT (Fri, 16 Oct 2009)
@@ -53,7 +53,7 @@
     the proposal sample.
 
     Class
- is::sampler<R> SIR sampler
+ statistics::importance_sampling::sampler<R> SIR sampler
 
 [ Sources ]
 
@@ -71,6 +71,9 @@
 
 [ History ]
 
+Sep 3 2009 :
+ - replaced is:: by statistics::importance_sampling
+ - modified the interface of generate_n
 August 18 2009 : refactored sampler to use discrete_distribution, no longer
     categorical_distribution
     

Modified: sandbox/statistics/importance_sampling/libs/importance_sampling/example/sampler.cpp
==============================================================================
--- sandbox/statistics/importance_sampling/libs/importance_sampling/example/sampler.cpp (original)
+++ sandbox/statistics/importance_sampling/libs/importance_sampling/example/sampler.cpp 2009-10-16 01:16:23 EDT (Fri, 16 Oct 2009)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// is::example::sampler.cpp //
+// statistics::importance_sampling::example::sampler.cpp //
 // //
 // Copyright 2009 Erwann Rogard. Distributed under the Boost //
 // Software License, Version 1.0. (See accompanying file //
@@ -31,6 +31,7 @@
     // The quality of the sample is assessed by a series of
     // kolmorov-distances along the the sample size of the targets.
     using namespace boost;
+ using namespace statistics;
     typedef std::string str_;
     typedef double val_;
     typedef std::vector<val_> vec_;
@@ -74,8 +75,7 @@
 
     prepare_weights(
         boost::begin(is_weights),
- boost::end(is_weights),
- boost::begin(proposals)
+ boost::end(is_weights)
     );
 
     out << std::endl << "Initial sample : " << std::endl
@@ -83,13 +83,13 @@
         << prepare_weights << std::endl;
 
     targets.clear();
- is::generate(
- urng,
+ statistics::importance_sampling::generate(
+ std::back_inserter(targets),
+ n_t_pl * n_ks,
         boost::begin(is_weights),
         boost::end(is_weights),
         boost::begin(proposals),
- std::back_inserter(targets),
- n_t_pl * n_ks
+ urng
     );
     {
         // i 0 1 ... n-1

Modified: sandbox/statistics/importance_sampling/libs/importance_sampling/example/sampler.h
==============================================================================
--- sandbox/statistics/importance_sampling/libs/importance_sampling/example/sampler.h (original)
+++ sandbox/statistics/importance_sampling/libs/importance_sampling/example/sampler.h 2009-10-16 01:16:23 EDT (Fri, 16 Oct 2009)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// is::example::sampler.h //
+// statistics::importance_sampling::example::sampler.h //
 // //
 // Copyright 2009 Erwann Rogard. Distributed under the Boost //
 // Software License, Version 1.0. (See accompanying file //

Modified: sandbox/statistics/importance_sampling/libs/importance_sampling/src/main.cpp
==============================================================================
--- sandbox/statistics/importance_sampling/libs/importance_sampling/src/main.cpp (original)
+++ sandbox/statistics/importance_sampling/libs/importance_sampling/src/main.cpp 2009-10-16 01:16:23 EDT (Fri, 16 Oct 2009)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// is::src::main.cpp //
+// statistics::importance_sampling::src::main.cpp //
 // //
 // Copyright 2009 Erwann Rogard. Distributed under the Boost //
 // Software License, Version 1.0. (See accompanying file //


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