Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55634 - in sandbox/statistics: importance_sampling/boost/importance_sampling random/boost/random
From: erwann.rogard_at_[hidden]
Date: 2009-08-17 19:26:01


Author: e_r
Date: 2009-08-17 19:26:00 EDT (Mon, 17 Aug 2009)
New Revision: 55634
URL: http://svn.boost.org/trac/boost/changeset/55634

Log:
renaming multinomial_... to categorical_...
Text files modified:
   sandbox/statistics/importance_sampling/boost/importance_sampling/sampler.hpp | 8 +++---
   sandbox/statistics/random/boost/random/multinomial_distribution.hpp | 48 ++++++++++++++++++++--------------------
   2 files changed, 28 insertions(+), 28 deletions(-)

Modified: sandbox/statistics/importance_sampling/boost/importance_sampling/sampler.hpp
==============================================================================
--- sandbox/statistics/importance_sampling/boost/importance_sampling/sampler.hpp (original)
+++ sandbox/statistics/importance_sampling/boost/importance_sampling/sampler.hpp 2009-08-17 19:26:00 EDT (Mon, 17 Aug 2009)
@@ -16,7 +16,7 @@
 #include <boost/range.hpp>
 #include <boost/random/variate_generator.hpp>
 #include <boost/random/uniform_real.hpp>
-#include <boost/random/multinomial_distribution.hpp>
+#include <boost/random/categorical_distribution.hpp>
 
 namespace boost{
 namespace is{
@@ -41,7 +41,7 @@
     typedef typename range_value<const_values_>::type result_type;
     private:
     typedef Ur<result_type> unif_;
- typedef random::multinomial_distribution<unif_> mult_dist_t;
+ typedef random::categorical_distribution<unif_> mult_dist_t;
     public:
     typedef typename mult_dist_t::input_type input_type;
 
@@ -55,7 +55,7 @@
     sampler& operator=(const sampler& that);
 
     template<typename U> result_type operator()(U& urng)const;
- const mult_dist_t& multinomial_distribution()const;
+ const mult_dist_t& categorical_distribution()const;
 
     // TODO os/is
 
@@ -117,7 +117,7 @@
 // Access
 template<typename R1, template<typename> class Ur>
 const typename sampler<R1,Ur>::mult_dist_t&
-sampler<R1,Ur>::multinomial_distribution()const{ return mult_dist_; }
+sampler<R1,Ur>::categorical_distribution()const{ return mult_dist_; }
 
 }//random
 }//boost

Modified: sandbox/statistics/random/boost/random/multinomial_distribution.hpp
==============================================================================
--- sandbox/statistics/random/boost/random/multinomial_distribution.hpp (original)
+++ sandbox/statistics/random/boost/random/multinomial_distribution.hpp 2009-08-17 19:26:00 EDT (Mon, 17 Aug 2009)
@@ -1,12 +1,12 @@
 ///////////////////////////////////////////////////////////////////////////////
-// is::multinomial_distribution.hpp //
+// random::categorical_distribution.hpp //
 // //
 // Copyright 2009 Erwann Rogard. Distributed under the Boost //
 // Software License, Version 1.0. (See accompanying file //
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
 ///////////////////////////////////////////////////////////////////////////////
-#ifndef BOOST_RANDOM_MULTINOMIAL_DISTRIBUTION_HPP_ER_2009
-#define BOOST_RANDOM_MULTINOMIAL_DISTRIBUTION_HPP_ER_2009
+#ifndef BOOST_RANDOM_CATEGORICAL_DISTRIBUTION_HPP_ER_2009
+#define BOOST_RANDOM_CATEGORICAL_DISTRIBUTION_HPP_ER_2009
 #include <algorithm>
 #include <numeric>
 #include <cmath>
@@ -21,7 +21,7 @@
 namespace random{
 
 // Usage:
-// typedef multinomial_distribution<> rmult_;
+// typedef categorical_distribution<> rmult_;
 // typedef rmult_::value_type value_type;
 // typedef rmult_::result_type idx_;
 //
@@ -31,7 +31,7 @@
 // rmult_ rmult(weights);
 // idx_ idx = rmult(urng);
 template<typename Ur = uniform_real<double> >
-class multinomial_distribution{
+class categorical_distribution{
     typedef Ur unif_t;
     public:
     typedef typename unif_t::input_type input_type;
@@ -44,14 +44,14 @@
     typedef typename range_difference<cont_t>::type result_type;
 
     // Construction
- multinomial_distribution();
+ categorical_distribution();
     
     // Passing sorted from large to small weights will speed up execution.
     template<typename R>
- multinomial_distribution( const R& unnormalized_weights );
- multinomial_distribution( const multinomial_distribution& that );
- multinomial_distribution&
- operator=(const multinomial_distribution& that);
+ categorical_distribution( const R& unnormalized_weights );
+ categorical_distribution( const categorical_distribution& that );
+ categorical_distribution&
+ operator=(const categorical_distribution& that);
 
     // Draw
     template<typename U> result_type operator()(U& urng)const;
@@ -72,11 +72,11 @@
 
     // Construction
     template<typename Ur>
- multinomial_distribution<Ur>::multinomial_distribution() : cum_sums_(){}
+ categorical_distribution<Ur>::categorical_distribution() : cum_sums_(){}
 
     template<typename Ur>
     template<typename R>
- multinomial_distribution<Ur>::multinomial_distribution(
+ categorical_distribution<Ur>::categorical_distribution(
         const R& unnormalized_weights
     )
     {
@@ -84,15 +84,15 @@
     }
     
     template<typename Ur>
- multinomial_distribution<Ur>::multinomial_distribution(
- const multinomial_distribution& that
+ categorical_distribution<Ur>::categorical_distribution(
+ const categorical_distribution& that
     )
     :cum_sums_(that.cum_sums_){}
     
     template<typename Ur>
- multinomial_distribution<Ur>&
- multinomial_distribution<Ur>::operator=(
- const multinomial_distribution& that
+ categorical_distribution<Ur>&
+ categorical_distribution<Ur>::operator=(
+ const categorical_distribution& that
     ){
         if(&that!=this){
             this->cum_sums_ = that.cum_sums_;
@@ -102,8 +102,8 @@
     
     template<typename Ur>
     template<typename U>
- typename multinomial_distribution<Ur>::result_type
- multinomial_distribution<Ur>::operator()(U& urng)const{
+ typename categorical_distribution<Ur>::result_type
+ categorical_distribution<Ur>::operator()(U& urng)const{
         unif_t unif(static_cast<value_type>(0),normalizing_constant());
         typedef typename range_iterator<const cont_t>::type iter_;
         value_type u = unif(urng);
@@ -118,20 +118,20 @@
     
     // Access
     template<typename Ur>
- const typename multinomial_distribution<Ur>::cont_t&
- multinomial_distribution<Ur>::cumulative_weights()const{
+ const typename categorical_distribution<Ur>::cont_t&
+ categorical_distribution<Ur>::cumulative_weights()const{
         return (this->cum_sums_);
     }
     
     template<typename Ur>
- typename multinomial_distribution<Ur>::value_type
- multinomial_distribution<Ur>::normalizing_constant()const{
+ typename categorical_distribution<Ur>::value_type
+ categorical_distribution<Ur>::normalizing_constant()const{
         return (this->cum_sums_).back();
     }
     
     template<typename Ur>
     template<typename R>
- void multinomial_distribution<Ur>::set(const R& unnormalized_weights){
+ void categorical_distribution<Ur>::set(const R& unnormalized_weights){
         const char* method = "multinormal_distribution::set, error : ";
         static value_type eps = math::tools::epsilon<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