|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56428 - in sandbox/statistics/distribution_toolkit: boost/statistics/detail/distribution_toolkit/data libs/statistics/detail/distribution_toolkit/example
From: erwann.rogard_at_[hidden]
Date: 2009-09-26 22:02:33
Author: e_r
Date: 2009-09-26 22:02:33 EDT (Sat, 26 Sep 2009)
New Revision: 56428
URL: http://svn.boost.org/trac/boost/changeset/56428
Log:
m
Text files modified:
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/data/sample_cdf.hpp | 31 ++++++++++++++++---------------
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.cpp | 15 +++++++--------
2 files changed, 23 insertions(+), 23 deletions(-)
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/data/sample_cdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/data/sample_cdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/data/sample_cdf.hpp 2009-09-26 22:02:33 EDT (Sat, 26 Sep 2009)
@@ -21,8 +21,6 @@
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
#include <boost/fusion/include/at_key.hpp>
-#include <boost/statistics/detail/distribution_toolkit/random/generator.hpp>
-
namespace boost{
namespace statistics{
namespace detail{
@@ -58,25 +56,28 @@
template<typename N>
void reserve(N n){ this->sample_.reserve(n); }
void clear(){ this->sample_.clear(); }
- template<typename X,typename D>
- void operator()(const X& x,const D& dist){
+ template<typename X,typename T1>
+ void operator()(const X& x,const T1& cdf){
map_ map(
fusion::make_pair<key1_>(x),
- fusion::make_pair<key2_>(cdf(dist,x))
+ fusion::make_pair<key2_>(cdf)
);
this->sample_.push_back(map);
}
- template<typename N,typename D,typename U>
- void generate(N n, U& urng,const D& dist){
- BOOST_AUTO(vg,boost::make_random_generator(urng,dist));
- size_type i = 0;
- while(i<n){
- (*this)(vg(),dist);
- ++i;
- };
-
- }
+ //template<typename N,typename D,typename U>
+ //void generate(N n, U& urng,const D& dist){
+ // BOOST_AUTO(vg,boost::make_random_generator(urng,dist));
+ // size_type i = 0;
+ // while(i<n){
+ // (*this)(vg(),dist);
+ //
+ // cdf(dist,x)
+ //
+ // ++i;
+ // };
+ //
+ //}
// Access
size_type size()const{ return boost::size(this->sample()); }
Modified: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.cpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.cpp (original)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.cpp 2009-09-26 22:02:33 EDT (Sat, 26 Sep 2009)
@@ -18,10 +18,9 @@
#include <boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/include.hpp>
-//#include <boost/statistics/detail/distribution_toolkit/distributions/uniform/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/random/include.hpp>
-#include <boost/statistics/detail/distribution_toolkit/data/sample_cdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/data/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/unscope/os.hpp>
#include <libs/statistics/detail/distribution_toolkit/example/random.h>
@@ -61,7 +60,7 @@
sc.clear();
while(i<n_loops){
sc.reserve(sc.size()+n_draws);
- sc.generate(n_draws,urng,dist);
+ generate_n(sc,n_draws,urng,dist);
os << sc << std::endl;
++i;
n_draws *= n2;
@@ -78,7 +77,7 @@
sc.clear();
while(i<n_loops){
sc.reserve(sc.size()+n_draws);
- sc.generate(n_draws,urng,dist);
+ generate_n(sc,n_draws,urng,dist);
os << sc << std::endl;
++i;
n_draws *= n2;
@@ -95,7 +94,7 @@
sc.clear();
while(i<n_loops){
sc.reserve(sc.size()+n_draws);
- sc.generate(n_draws,urng,dist);
+ generate_n(sc,n_draws,urng,dist);
os << sc << std::endl;
++i;
n_draws *= n2;
@@ -113,7 +112,7 @@
sc.clear();
while(i<n_loops){
sc.reserve(sc.size()+n_draws);
- sc.generate(n_draws,urng,dist);
+ generate_n(sc,n_draws,urng,dist);
os << sc << std::endl;
++i;
n_draws *= n2;
@@ -130,7 +129,7 @@
sc.clear();
while(i<n_loops){
sc.reserve(sc.size()+n_draws);
- sc.generate(n_draws,urng,dist);
+ generate_n(sc,n_draws,urng,dist);
os << sc << std::endl;
++i;
n_draws *= n2;
@@ -151,7 +150,7 @@
sc.clear();
while(i<n_loops){
sc.reserve(sc.size()+n_draws);
- sc.generate(n_draws,urng,dist);
+ generate_n(sc,n_draws,urng,dist);
os << sc << std::endl;
++i;
n_draws *= n2;
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