|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56857 - in sandbox/statistics/distribution_toolkit: boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf boost/statistics/detail/distribution_toolkit/test libs/statistics/detail/distribution_toolkit/example libs/statistics/detail/distribution_toolkit/src
From: erwann.rogard_at_[hidden]
Date: 2009-10-14 19:58:15
Author: e_r
Date: 2009-10-14 19:58:14 EDT (Wed, 14 Oct 2009)
New Revision: 56857
URL: http://svn.boost.org/trac/boost/changeset/56857
Log:
m
Text files modified:
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/include.hpp | 2 ++
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/ratio_pdf.hpp | 11 +++++++++--
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/test/random.hpp | 9 +--------
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.cpp | 9 +++++++--
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/src/main.cpp | 2 +-
5 files changed, 20 insertions(+), 13 deletions(-)
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/include.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/include.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/include.hpp 2009-10-14 19:58:14 EDT (Wed, 14 Oct 2009)
@@ -9,6 +9,8 @@
#ifndef BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_RATIO_PDF_INCLUDE_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_RATIO_PDF_INCLUDE_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/ratio_pdf.hpp>
#endif
\ No newline at end of file
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/ratio_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/ratio_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/ratio_pdf.hpp 2009-10-14 19:58:14 EDT (Wed, 14 Oct 2009)
@@ -23,7 +23,7 @@
struct meta_ratio_pdf{
typedef inverse_pdf<B> inv_;
typedef product_pdf<A, inv_ > type;
- static type make(A a,B b){
+ static type make(const A& a,const B& b){
return type(
a,
inv_(b)
@@ -31,9 +31,16 @@
}
};
+ template<typename A,typename B>
+ typename meta_ratio_pdf<A,B>::type
+ make_ratio_pdf(const A& a, const B& b)
+ {
+ typedef meta_ratio_pdf<A,B> meta_;
+ return meta_::make(a,b);
+ }
+
}// distribution
}// toolkit
-
}// detail
}// statistics
}// boost
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/test/random.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/test/random.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/test/random.hpp 2009-10-14 19:58:14 EDT (Wed, 14 Oct 2009)
@@ -9,6 +9,7 @@
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_TEST_RANDOM_HPP_ER_2009
#include <iterator>
#include <boost/utility/result_of.hpp>
+#include <boost/typeof/typeof.hpp>
#include <ext/algorithm>
#include <boost/range.hpp>
#include <boost/static_assert.hpp>
@@ -27,7 +28,6 @@
#include <boost/statistics/detail/distribution_toolkit/fun_wrap/cdf.hpp>
#include <boost/statistics/detail/distribution_toolkit/random/include.hpp>
-#include <boost/statistics/detail/distribution_toolkit/data/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/unscope/os.hpp>
namespace boost{
@@ -56,10 +56,7 @@
// Types
typedef typename common::meta::value<D>::type val_;
typedef mt19937 urng_;
-
typedef typename meta::bind_delegate<D>::type fun_;
-// typedef function<val_(const val_&)> fun_;
-
typedef detail::fusion::functor::map_identity_f<
mpl::int_<0>,
mpl::int_<1>,
@@ -69,7 +66,6 @@
typedef typename functor_::identity::key_ key1_;
typedef typename functor_::function::key_ key2_;
-
typedef non_parametric::kolmogorov_smirnov::statistic<
val_,
key1_,
@@ -88,9 +84,6 @@
kolmogorov_smirnov_stat_ kolmogorov_smirnov_stat;
{
- typedef math::chi_squared_distribution<val_> dist_;
- const val_ df = 10;
- dist_ dist( df );
functor_ functor(
make_bind_delegate<fun_wrap::cdf_>(dist)
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-10-14 19:58:14 EDT (Wed, 14 Oct 2009)
@@ -11,6 +11,9 @@
#include <boost/statistics/detail/distribution_toolkit/distributions/gamma/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp>
+
+// Warning: location_scale<Z> comes after fwd_math because Z is defined in math::
+#include <boost/statistics/detail/distribution_toolkit/fwd_math/cdf.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/include.hpp>
@@ -25,6 +28,8 @@
// smirnov statistics. Convergence to zero is evidence that
// the sample agrees wit the cdf of dist
+ os << "-> test_random " << std::endl;
+
using namespace boost;
using namespace boost::statistics;
namespace stat = statistics::detail;
@@ -53,7 +58,7 @@
}
{
- typedef math::exponential_distribution<val_> dist_;
+ typedef math::exponential_distribution<val_> dist_;
const val_ lambda = 1.0;
dist_ dist( lambda );
@@ -127,7 +132,7 @@
}
{
typedef math::students_t_distribution<val_> d0_;
- typedef tk::wrapper<d0_> dist_;
+ typedef tk::wrapper<d0_> dist_;
const val_ df = 4.0;
d0_ d0( df );
dist_ dist(d0);
Modified: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/src/main.cpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/src/main.cpp (original)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/src/main.cpp 2009-10-14 19:58:14 EDT (Wed, 14 Oct 2009)
@@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////////////////////////
-// distribution::toolkit::src::main.h //
+// distribution::toolkit::src::main.h //
// //
// (C) Copyright 2009 Erwann Rogard //
// Use, modification and distribution are subject to the //
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