|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56388 - in sandbox/statistics/random: boost/random libs/random/doc
From: erwann.rogard_at_[hidden]
Date: 2009-09-26 16:40:54
Author: e_r
Date: 2009-09-26 16:40:52 EDT (Sat, 26 Sep 2009)
New Revision: 56388
URL: http://svn.boost.org/trac/boost/changeset/56388
Log:
m
Text files modified:
sandbox/statistics/random/boost/random/chi_squared.hpp | 2 +-
sandbox/statistics/random/boost/random/location_scale.hpp | 14 +++++++-------
sandbox/statistics/random/libs/random/doc/readme.txt | 4 +++-
3 files changed, 11 insertions(+), 9 deletions(-)
Modified: sandbox/statistics/random/boost/random/chi_squared.hpp
==============================================================================
--- sandbox/statistics/random/boost/random/chi_squared.hpp (original)
+++ sandbox/statistics/random/boost/random/chi_squared.hpp 2009-09-26 16:40:52 EDT (Sat, 26 Sep 2009)
@@ -46,7 +46,7 @@
static nd_t nd(0,1);
result_type z;
result_type res = static_cast<T>(0);
- for(unsigned i = 0; i<df(); i++){
+ for(unsigned i = 0; i<this->df(); i++){
z = nd(urng);
res += (z * z);
}
Modified: sandbox/statistics/random/boost/random/location_scale.hpp
==============================================================================
--- sandbox/statistics/random/boost/random/location_scale.hpp (original)
+++ sandbox/statistics/random/boost/random/location_scale.hpp 2009-09-26 16:40:52 EDT (Sat, 26 Sep 2009)
@@ -34,11 +34,11 @@
location_scale_distribution(){}
location_scale_distribution(
- typename call_traits<Z>::param_type z,
const result_type& mu,
- const result_type& sigma
+ const result_type& sigma,
+ typename call_traits<Z>::param_type z
)
- :z_(z),mu_(mu),sigma_(sigma){}
+ :mu_(mu),sigma_(sigma),z_(z){}
template<typename U>
result_type operator()(U& urng){ return (this->impl(urng)); }
@@ -46,14 +46,14 @@
template<typename U>
result_type operator()(U& urng)const{ return (this->impl(urng)); }
- const result_type& mu()const{ return mu_; }
- const result_type& sigma()const{ return sigma_; }
- const Z& z(){ return z_ ;}
+ const result_type& mu()const{ return this->mu_; }
+ const result_type& sigma()const{ return this->sigma_; }
+ const Z& z(){ return this->z_ ;}
private:
- typename call_traits<Z>::value_type z_;
result_type mu_;
result_type sigma_;
+ typename call_traits<Z>::value_type z_;
template<typename U>
result_type impl(U& urng){
return (this->mu()) + (this->sigma()) * (this->z_)(urng);
Modified: sandbox/statistics/random/libs/random/doc/readme.txt
==============================================================================
--- sandbox/statistics/random/libs/random/doc/readme.txt (original)
+++ sandbox/statistics/random/libs/random/doc/readme.txt 2009-09-26 16:40:52 EDT (Sat, 26 Sep 2009)
@@ -29,7 +29,7 @@
chi_squared<T>
students_t_distribution<T>
location_scale<Z> X = sigma Z + mu
- categorical_distribution<U> Samples indices by their probability
+ categorical_distribution<U> Samples indices by their probability (deprecated)
ref_distribution<X&> A reference wrapper
gen_to_random<X> A generator that acts like a RandomDist
@@ -44,6 +44,8 @@
[ History ]
+Sept 25 2009 : location_scale : modified constructor and constrain Z to be
+a class type because a reference would be redundant with ref_distribution).
August 18 2009 : renamed multinomial_distribution to categorical_distribution
July 2009 : Current 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