Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60145 - in sandbox/statistics/adaptive_rejection_sampling: boost/ars boost/ars/test libs/ars/example
From: erwann.rogard_at_[hidden]
Date: 2010-03-03 22:42:10


Author: e_r
Date: 2010-03-03 22:42:09 EST (Wed, 03 Mar 2010)
New Revision: 60145
URL: http://svn.boost.org/trac/boost/changeset/60145

Log:
m
Text files modified:
   sandbox/statistics/adaptive_rejection_sampling/boost/ars/proposal_sampler.hpp | 44 ++++++++++++++++++++++++++-------------
   sandbox/statistics/adaptive_rejection_sampling/boost/ars/test/gamma_distribution.hpp | 1
   sandbox/statistics/adaptive_rejection_sampling/boost/ars/test/normal_distribution.hpp | 1
   sandbox/statistics/adaptive_rejection_sampling/libs/ars/example/standard_distribution.cpp | 3 -
   4 files changed, 30 insertions(+), 19 deletions(-)

Modified: sandbox/statistics/adaptive_rejection_sampling/boost/ars/proposal_sampler.hpp
==============================================================================
--- sandbox/statistics/adaptive_rejection_sampling/boost/ars/proposal_sampler.hpp (original)
+++ sandbox/statistics/adaptive_rejection_sampling/boost/ars/proposal_sampler.hpp 2010-03-03 22:42:09 EST (Wed, 03 Mar 2010)
@@ -11,10 +11,6 @@
 #include <vector>
 #include <algorithm>
 #include <functional>
-#include <boost/config.hpp>
-#ifndef BOOST_MSCV
- #include <ext/algorithm>
-#endif
 #include <string>
 #include <iterator>
 #include <numeric>
@@ -767,17 +763,35 @@
     ++iter;
     BOOST_ASSERT(!(iter!=boost::end(datas_)));
 
- BOOST_ASSERT(
- is_sorted(
- begin(datas_),
- boost::end(datas_),
- bind<bool>(
- std::less<tang_t>(),
- _1,
- _2
- )
- )
- );
+ {
+ // Replaces version below to accomodate MSVC
+ //http://stackoverflow.com/questions/262000/c-best-algorithm-to-check-if-a-vector-is-sorted
+ using namespace boost::lambda;
+ BOOST_ASSERT(
+ std::adjacent_find(
+ boost::begin(datas_),
+ boost::end(datas_),
+ boost::lambda::bind(
+ std::less<tang_t>(),
+ _2,
+ _1
+ )
+ ) == boost::end(datas_)
+ );
+ }
+
+ // Previously:
+ //BOOST_ASSERT(
+ // is_sorted(
+ // begin(datas_),
+ // boost::end(datas_),
+ // bind<bool>(
+ // std::less<tang_t>(),
+ // _1,
+ // _2
+ // )
+ // )
+ //);
 }
 
 template<

Modified: sandbox/statistics/adaptive_rejection_sampling/boost/ars/test/gamma_distribution.hpp
==============================================================================
--- sandbox/statistics/adaptive_rejection_sampling/boost/ars/test/gamma_distribution.hpp (original)
+++ sandbox/statistics/adaptive_rejection_sampling/boost/ars/test/gamma_distribution.hpp 2010-03-03 22:42:09 EST (Wed, 03 Mar 2010)
@@ -39,7 +39,6 @@
         {
 
             using namespace boost;
- using namespace math;
             typedef double val_;
             typedef ars::constant<val_> const_;
             typedef math::gamma_distribution<val_> mdist_t;

Modified: sandbox/statistics/adaptive_rejection_sampling/boost/ars/test/normal_distribution.hpp
==============================================================================
--- sandbox/statistics/adaptive_rejection_sampling/boost/ars/test/normal_distribution.hpp (original)
+++ sandbox/statistics/adaptive_rejection_sampling/boost/ars/test/normal_distribution.hpp 2010-03-03 22:42:09 EST (Wed, 03 Mar 2010)
@@ -39,7 +39,6 @@
         {
 
             using namespace boost;
- using namespace math;
             typedef double value_t;
             typedef ars::constant<value_t> const_;
             typedef math::normal_distribution<value_t> mdist_t;

Modified: sandbox/statistics/adaptive_rejection_sampling/libs/ars/example/standard_distribution.cpp
==============================================================================
--- sandbox/statistics/adaptive_rejection_sampling/libs/ars/example/standard_distribution.cpp (original)
+++ sandbox/statistics/adaptive_rejection_sampling/libs/ars/example/standard_distribution.cpp 2010-03-03 22:42:09 EST (Wed, 03 Mar 2010)
@@ -18,8 +18,7 @@
 void example_standard_distribution(std::ostream& out){
     out << "-> example_standard_distribution " << std::endl;
 
- using namespace boost;
- using namespace statistics::detail;
+ using namespace boost::statistics::detail;
 
     // This example checks the convergence of ars for standard distributions
     // by verifying that the kolmogorov-smirnov statistic converges to zero


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