Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56413 - in sandbox/statistics/dist_random: boost/dist_random/random libs/dist_random/example
From: erwann.rogard_at_[hidden]
Date: 2009-09-26 20:17:24


Author: e_r
Date: 2009-09-26 20:17:23 EDT (Sat, 26 Sep 2009)
New Revision: 56413
URL: http://svn.boost.org/trac/boost/changeset/56413

Log:
m
Text files modified:
   sandbox/statistics/dist_random/boost/dist_random/random/generate_n.hpp | 20 ++++++++++++++------
   sandbox/statistics/dist_random/libs/dist_random/example/chi_squared.cpp | 3 +++
   sandbox/statistics/dist_random/libs/dist_random/example/location_scale_students_t.cpp | 2 ++
   3 files changed, 19 insertions(+), 6 deletions(-)

Modified: sandbox/statistics/dist_random/boost/dist_random/random/generate_n.hpp
==============================================================================
--- sandbox/statistics/dist_random/boost/dist_random/random/generate_n.hpp (original)
+++ sandbox/statistics/dist_random/boost/dist_random/random/generate_n.hpp 2009-09-26 20:17:23 EDT (Sat, 26 Sep 2009)
@@ -13,7 +13,7 @@
 #include <boost/random/variate_generator.hpp>
 #include <boost/utility/enable_if.hpp>
 #include <boost/scalar_dist/fun_wrap/include.hpp>
-#include <boost/scalar_dist/algorithm/transform.hpp>
+#include <boost/scalar_dist/iterator/distribution_function.hpp>
 #include <boost/dist_random/functional/make_random.hpp>
 
 namespace boost{
@@ -92,19 +92,27 @@
>::type
     generate_function_n(ItX b_x, ItF b_f, N n,const D& dist, U& urng){
         BOOST_CONCEPT_ASSERT((boost_concepts::IncrementableIterator<ItX>));
- BOOST_CONCEPT_ASSERT((boost_concepts::WritableIterator<ItX>));
+ // TODO was there a reason std::back_inserter would not be allowed?
+ // BOOST_CONCEPT_ASSERT((boost_concepts::WritableIterator<ItF>));
         ItX e_x = generate_n(
             b_x,
             n,
             dist,
             urng
         );
- boost::math::transform<F>(
- dist,
- b_x,
- e_x,
+
+ std::copy(
+ math::make_distribution_function_iterator<F>(
+ dist,
+ b_x
+ ),
+ math::make_distribution_function_iterator<F>(
+ dist,
+ e_x
+ ),
             b_f
         );
+
         return e_x;
     }
 

Modified: sandbox/statistics/dist_random/libs/dist_random/example/chi_squared.cpp
==============================================================================
--- sandbox/statistics/dist_random/libs/dist_random/example/chi_squared.cpp (original)
+++ sandbox/statistics/dist_random/libs/dist_random/example/chi_squared.cpp 2009-09-26 20:17:23 EDT (Sat, 26 Sep 2009)
@@ -42,6 +42,7 @@
     urng_ urng;
 
     check_ check;
+ /*
     check(
         mdist,
         make_random(mdist),
@@ -49,6 +50,8 @@
         n_ks,
         urng
     );
+ */
+
     
     out << check;
     out << "<-" << std::endl;

Modified: sandbox/statistics/dist_random/libs/dist_random/example/location_scale_students_t.cpp
==============================================================================
--- sandbox/statistics/dist_random/libs/dist_random/example/location_scale_students_t.cpp (original)
+++ sandbox/statistics/dist_random/libs/dist_random/example/location_scale_students_t.cpp 2009-09-26 20:17:23 EDT (Sat, 26 Sep 2009)
@@ -46,6 +46,7 @@
     mdist_ mdist( mstud_( df ), mu , sigma);
     urng_ urng;
 
+/*
     check_ check;
     check(
         mdist,
@@ -56,6 +57,7 @@
     );
     
     out << check;
+*/
     out << "<-" << std::endl;
 
 }
\ No newline at end of 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