Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56417 - in sandbox/statistics/standard_distribution: boost/standard_distribution/unnormalized_pdf libs/standard_distribution/example
From: erwann.rogard_at_[hidden]
Date: 2009-09-26 20:20:28


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

Log:
m
Text files modified:
   sandbox/statistics/standard_distribution/boost/standard_distribution/unnormalized_pdf/exponential.hpp | 8 ++++----
   sandbox/statistics/standard_distribution/libs/standard_distribution/example/location_scale.cpp | 17 ++++++++++++-----
   2 files changed, 16 insertions(+), 9 deletions(-)

Modified: sandbox/statistics/standard_distribution/boost/standard_distribution/unnormalized_pdf/exponential.hpp
==============================================================================
--- sandbox/statistics/standard_distribution/boost/standard_distribution/unnormalized_pdf/exponential.hpp (original)
+++ sandbox/statistics/standard_distribution/boost/standard_distribution/unnormalized_pdf/exponential.hpp 2009-09-26 20:20:27 EDT (Sat, 26 Sep 2009)
@@ -22,12 +22,12 @@
         const T& x
     ){
 
+ typedef std::string str_;
         BOOST_MATH_STD_USING // for ADL of std functions
- // to keep width = 80 caracters
- static const char* function = strcpy(
- "boost::math::log_unnormalized_pdf(" ,
+ static const str_ function =
+ str_("boost::math::log_unnormalized_pdf(")+
             "const exponential_distribution<%1%>&,%1%)"
- );
+ ;
 
         T lambda = d.lambda();
         T result;

Modified: sandbox/statistics/standard_distribution/libs/standard_distribution/example/location_scale.cpp
==============================================================================
--- sandbox/statistics/standard_distribution/libs/standard_distribution/example/location_scale.cpp (original)
+++ sandbox/statistics/standard_distribution/libs/standard_distribution/example/location_scale.cpp 2009-09-26 20:20:27 EDT (Sat, 26 Sep 2009)
@@ -30,6 +30,7 @@
 #include <boost/standard_distribution/distributions/students_t.hpp>
 #include <boost/standard_distribution/transformation/location_scale.hpp>
 #include <boost/scalar_dist/algorithm/transform.hpp>
+#include <boost/scalar_dist/iterator/distribution_function.hpp>
 #include <boost/scalar_dist/meta/include.hpp>
 #include <boost/scalar_dist/fun_wrap/include.hpp>
 
@@ -95,14 +96,20 @@
             format ffd = fd; ffd%"mls_stud"%deleg(mls_stud,x);
             out << ffl.str() << ' ' << ffd.str() << std::endl;
         }
- { // math::transform + fun_wrap
+ { // make_distribution_function_iterator + fun_wrap
             vals_ range_log_pdf;
- math::transform<math::fun_wrap::log_unnormalized_pdf_>(
- mstud,
- begin(range_x),
- end(range_x),
+
+ std::copy(
+ math::make_distribution_function_iterator<
+ math::fun_wrap::log_unnormalized_pdf_
+ >(mstud,boost::begin(range_x)),
+ math::make_distribution_function_iterator<
+ math::fun_wrap::log_unnormalized_pdf_
+ >(mstud,boost::end(range_x)),
                 std::back_inserter(range_log_pdf)
             );
+
+
         }
         { // product_pdf + fun_wrap
             typedef math::product_pdf<mstud_,mls_stud_> prod_dist_;


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