|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56497 - in sandbox/statistics/distribution_toolkit: boost/statistics/detail/distribution_toolkit/concept/aggregate boost/statistics/detail/distribution_toolkit/concept/unary boost/statistics/detail/distribution_toolkit/distributions boost/statistics/detail/distribution_toolkit/distributions/chi_squared boost/statistics/detail/distribution_toolkit/distributions/exponential boost/statistics/detail/distribution_toolkit/distributions/gamma boost/statistics/detail/distribution_toolkit/distributions/location_scale boost/statistics/detail/distribution_toolkit/distributions/normal boost/statistics/detail/distribution_toolkit/distributions/students_t boost/statistics/detail/distribution_toolkit/distributions/uniform boost/statistics/detail/distribution_toolkit/distributions/wrapper boost/statistics/detail/distribution_toolkit/fun_wrap boost/statistics/detail/distribution_toolkit/fwd_math boost/statistics/detail/distribution_toolkit/iterator boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf boost/statistics/detail/distribution_toolkit/meta boost/statistics/detail/distribution_toolkit/unscope libs/statistics/detail/distribution_toolkit/doc libs/statistics/detail/distribution_toolkit/example libs/statistics/detail/distribution_toolkit/src libs/statistics/detail/distribution_toolkit/test
From: erwann.rogard_at_[hidden]
Date: 2009-09-30 22:28:31
Author: e_r
Date: 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
New Revision: 56497
URL: http://svn.boost.org/trac/boost/changeset/56497
Log:
a/m
Added:
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/aggregate/
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/aggregate/function_ptrs.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/aggregate/normalized_functions.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/aggregate/unnormalized_functions.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/cdf.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/derivative_log_unnormalized_pdf.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/function_ptr.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/log_unnormalized_pdf.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/mean.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/normalizing_constant.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/pdf.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/quantile.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/variance.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/derivative_log_unnormalized_pdf.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/derivative_log_unnormalized_pdf.hpp (contents, props changed)
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/test/
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/test/function_ptrs.cpp (contents, props changed)
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/test/unnormalized_functions.cpp (contents, props changed)
Text files modified:
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/derivative_log_unnormalized_pdf.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/include.hpp | 16 ++++----
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/log_unnormalized_pdf.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/derivative_log_unnormalized_pdf.hpp | 10 ++--
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/include.hpp | 16 ++++----
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/log_unnormalized_pdf.hpp | 8 ++--
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/derivative_log_unnormalized_pdf.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/include.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/log_unnormalized_pdf.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/include.hpp | 15 ++++---
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/log_unnormalized_pdf.hpp | 5 --
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/normalizing_constant.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp | 16 ++++----
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/is_math_distribution.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/include.hpp | 17 ++++----
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/is_math_distribution.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/log_unnormalized_pdf.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/cdf.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/derivative_log_unnormalized_pdf.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/log_unnormalized_pdf.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/mean.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/normalizing_constant.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/pdf.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/variance.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/cdf.hpp | 9 ++--
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/log_unnormalized_pdf.hpp | 4 --
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/pdf.hpp | 9 ++--
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/quantile.hpp | 10 ++--
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/cdf.hpp | 4 +-
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/mean.hpp | 1
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/pdf.hpp | 3 +
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/quantile.hpp | 3 +
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/variance.hpp | 1
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/distribution_function.hpp | 5 ++
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/log_unnormalized_pdf.hpp | 2
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/log_unnormalized_pdf.hpp | 4 +-
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp | 6 +-
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/include.hpp | 3 +
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/log_unnormalized_pdf.hpp | 34 ++++------------
sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/os.hpp | 6 +-
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/doc/readme.txt | 38 +++++++++----------
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.cpp | 78 +++++++++++----------------------------
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.h | 2
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.cpp | 5 +-
sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/src/main.cpp | 4 ++
47 files changed, 165 insertions(+), 205 deletions(-)
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/aggregate/function_ptrs.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/aggregate/function_ptrs.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,38 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::aggregate::function_ptrs.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_AGGREGATE_FUNCTION_PTRS_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_AGGREGATE_FUNCTION_PTRS_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/cdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/quantile.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/function_ptr.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ template<typename D>
+ class FunctionPtrs :
+ FunctionPtr<D,fun_wrap::cdf_>,
+ FunctionPtr<D,fun_wrap::pdf_>,
+ FunctionPtr<D,fun_wrap::quantile_>,
+ FunctionPtr<D,fun_wrap::log_unnormalized_pdf_>
+ {
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/aggregate/normalized_functions.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/aggregate/normalized_functions.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,42 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::aggregate::normalized_functions.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_AGGREGATE_NORMALIZED_FUNCTIONS_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_AGGREGATE_NORMALIZED_FUNCTIONS_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/cdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/quantile.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, you need to bring its functions into the
+ // scope of distribution_toolkit by
+ // a) including (or if necessary creating) the file,
+ // distribution_toolkit/distributions/D/is_math_distribution.hpp
+ // where meta::is_math::distribution<D> specializes to mpl::bool_<true>
+ // b) including the relevant file in distribution_toolkit/fwd_math
+ template<typename D>
+ class NormalizedFunctions :
+ Cdf<D>,
+ Pdf<D>,
+ Quantile<D>
+ {
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/aggregate/unnormalized_functions.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/aggregate/unnormalized_functions.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,37 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::aggregate::unnormalized_functions.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_AGGREGATE_UNNORMALIZED_FUNCTIONS_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_AGGREGATE_UNNORMALIZED_FUNCTIONS_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/derivative_log_unnormalized_pdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, include (or if neccessary create)
+ // distribution_toolkit/distribution/D/is_math_distribution
+ // distribution_toolkit/distribution/D/log_unnormalized_pdf
+ template<typename D>
+ class UnnormalizedFunctions :
+ LogUnnormalizedPdf<D>,
+ DerivativeLogUnnormalizedPdf<D>
+ {
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/cdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/cdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,42 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::unary::concept::cdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_CDF_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_CDF_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ template<typename D>
+ class Cdf{
+ public:
+
+ BOOST_CONCEPT_USAGE(Cdf){
+ val = cdf(dist,x);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ value_ x;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/derivative_log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,42 @@
+//////////////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::unary::derivative_log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ template<typename D>
+ class DerivativeLogUnnormalizedPdf{
+ public:
+
+ BOOST_CONCEPT_USAGE(DerivativeLogUnnormalizedPdf){
+ val = derivative_log_unnormalized_pdf(dist,x);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ value_ x;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/function_ptr.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/function_ptr.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,40 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::unary::function_ptr.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_FUNCTION_PTR_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_FUNCTION_PTR_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/pointer.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ template<typename D,template<typename> class F>
+ class FunctionPtr{
+ public:
+
+ typedef meta::pointer<D> meta_;
+
+ BOOST_CONCEPT_USAGE(FunctionPtr){
+ ptr = meta_::template make<F>();
+ }
+
+ private:
+ typename meta_::type ptr;
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,46 @@
+///////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::unary::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, include (or if neccessary create)
+ // distribution_toolkit/distribution/D/is_math_distribution
+ // distribution_toolkit/distribution/D/log_unnormalized_pdf
+ template<typename D>
+ class LogUnnormalizedPdf{
+ public:
+
+ BOOST_CONCEPT_USAGE(LogUnnormalizedPdf){
+ val = log_unnormalized_pdf(dist,x);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ value_ x;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/mean.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/mean.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,40 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::unary::mean.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_MEAN_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_MEAN_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ template<typename D>
+ class Mean{
+ public:
+
+ BOOST_CONCEPT_USAGE(Mean){
+ val = mean(dist);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/normalizing_constant.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/normalizing_constant.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,41 @@
+///////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::unary::normalizing_constant.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_NORMALIZING_CONSTANT_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_NORMALIZING_CONSTANT_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ template<typename D>
+ class NormalizingConstant{
+ public:
+
+ BOOST_CONCEPT_USAGE(NormalizingConstant){
+ val = normalizing_constant(dist);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,42 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::unary::pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_PDF_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_PDF_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ template<typename D>
+ class Pdf{
+ public:
+
+ BOOST_CONCEPT_USAGE(Pdf){
+ val = pdf(dist,x);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ value_ x;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/quantile.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/quantile.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,42 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::unary::quantile.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_QUANTILE_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_QUANTILE_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ template<typename D>
+ class Quantile{
+ public:
+
+ BOOST_CONCEPT_USAGE(Quantile){
+ val = quantile(dist,p);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ value_ p;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/variance.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/unary/variance.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::unary::variance.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_VARIANCE_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_UNARY_VARIANCE_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, you need to bring the function below into the
+ // scope of distribution_toolkit by
+ // a) including (or if necessary creating) the file,
+ // distribution_toolkit/distributions/D/is_math_distribution.hpp
+ // where meta::is_math::distribution<D> specializes to mpl::bool_<true>
+ // b) including the relevant file in distribution_toolkit/fwd_math
+ template<typename D>
+ class Variance{
+ public:
+
+ BOOST_CONCEPT_USAGE(Variance){
+ val = variance(dist);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/derivative_log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/derivative_log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -30,7 +30,7 @@
T error_result;
static const char* function =
-"boost::math::log_unnormalized_pdf(const chi_squared_distribution<%1%>&, %1%)";
+ "log_unnormalized_pdf(const chi_squared_distribution<%1%>&, %1%)";
if(false == math::detail::check_df(
function, degrees_of_freedom, &error_result, P()))
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/include.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/include.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/include.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,11 +1,11 @@
-//////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::map_pdf::distributions::chi_squared::include.hpp //
-// //
-// (C) Copyright 2009 Erwann Rogard //
-// Use, modification and distribution are subject to 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) //
-//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::distributions::chi_squared::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_INCLUDE_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_INCLUDE_HPP_ER_2009
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -30,7 +30,7 @@
T error_result;
static const char* function =
-"boost::math::log_unnormalized_pdf(const chi_squared_distribution<%1%>&, %1%)";
+ "log_unnormalized_pdf(const chi_squared_distribution<%1%>&, %1%)";
if(false == math::detail::check_df(
function, degrees_of_freedom, &error_result, P()))
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/derivative_log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/derivative_log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -23,13 +23,13 @@
const boost::math::exponential_distribution<T,P>& d,
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::derivative_log_unnormalized_pdf(",
- "const exponential_distribution<%1%>&,%1%)"
- );
+ static const char* function = (
+ str_("derivative_log_unnormalized_pdf(")
+ +"const exponential_distribution<%1%>&,%1%)"
+ ).c_str();
T lambda = d.lambda();
T result;
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/include.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/include.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/include.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,11 +1,11 @@
-//////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::map_pdf::distributions::exponential::include.hpp //
-// //
-// (C) Copyright 2009 Erwann Rogard //
-// Use, modification and distribution are subject to 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) //
-//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::::distributions::exponential::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_EXPONENTIAL_INCLUDE_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_EXPONENTIAL_INCLUDE_HPP_ER_2009
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -26,13 +26,13 @@
typedef std::string str_;
BOOST_MATH_STD_USING // for ADL of std functions
- static const str_ function =
- str_("boost::math::log_unnormalized_pdf(")+
- "const exponential_distribution<%1%>&,%1%)"
- ;
+ static const char* function =
+ (str_("log_unnormalized_pdf(")+
+ "const exponential_distribution<%1%>&,%1%)").c_str();
T lambda = d.lambda();
T result;
+
if(0 == boost::math::detail::verify_lambda(
function, lambda, &result, P()))
return result;
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/derivative_log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/derivative_log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -26,7 +26,7 @@
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function
- = "boost::math::log_unnormalized_pdf(const gamma_distribution<%1%>&, %1%)";
+ = "log_unnormalized_pdf(const gamma_distribution<%1%>&, %1%)";
T shape = dist.shape();
T scale = dist.scale();
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/include.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/include.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/include.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::map_pdf::distributions::gamma::include.hpp //
+// distribution_toolkit::map_pdf::distributions::gamma::include.hpp //
// //
// (C) Copyright 2009 Erwann Rogard //
// Use, modification and distribution are subject to the //
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -26,7 +26,7 @@
BOOST_MATH_STD_USING // for ADL of std functions
static const char* function
- = "boost::math::log_unnormalized_pdf(const gamma_distribution<%1%>&, %1%)";
+ = "log_unnormalized_pdf(const gamma_distribution<%1%>&, %1%)";
T shape = dist.shape();
T scale = dist.scale();
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/include.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/include.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/include.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -9,12 +9,13 @@
#ifndef BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_INCLUDE_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_INCLUDE_HPP_ER_2009
-#include <boost/statistics/detail/distribution_toolkit/distributions/chi_squared.hpp>
-#include <boost/statistics/detail/distribution_toolkit/distributions/exponential.hpp>
-#include <boost/statistics/detail/distribution_toolkit/distributions/gamma.hpp>
-#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale.hpp>
-#include <boost/statistics/detail/distribution_toolkit/distributions/normal.hpp>
-#include <boost/statistics/detail/distribution_toolkit/distributions/students_t.hpp>
-#include <boost/statistics/detail/distribution_toolkit/distributions/uniform.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/chi_squared/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/exponential/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/gamma/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/uniform/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/include.hpp>
#endif
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/derivative_log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,44 @@
+///////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/derivative_log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename Z>
+ typename meta::value< location_scale_distribution<Z> >::type
+ derivative_log_unnormalized_pdf(
+ const location_scale_distribution<Z>& d,
+ const typename meta::value< location_scale_distribution<Z> >::type& x
+ ){
+ typedef typename
+ meta::value< location_scale_distribution<Z> >::type value_t;
+ value_t z = (x-d.mu())/d.sigma();
+ BOOST_CONCEPT_ASSERT((
+ concept::DerivativeLogUnnormalizedPdf<Z>
+ ));
+ value_t result = derivative_log_unnormalized_pdf(d.z(),z);
+ result /= d.sigma(); // = dz/dx
+ return result;
+ }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::map_pdf::distributions::normal::include.hpp //
+// distribution_toolkit::distributions::normal::include.hpp //
// //
// (C) Copyright 2009 Erwann Rogard //
// Use, modification and distribution are subject to the //
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////////////////////////
-// distributions::normal::log_unnormalized_pdf.hpp //
+// distribution_toolkit::distributions::::normal::log_unnormalized_pdf.hpp //
// //
// (C) Copyright 2009 Erwann Rogard //
// Use, modification and distribution are subject to the //
@@ -17,9 +17,6 @@
namespace detail{
namespace distribution_toolkit{
- // If only the unnormalized_pdf is required, this is supposed to
- // be faster than log(pdf(D,x))
-
template<typename T,typename P>
T
log_unnormalized_pdf(
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/normalizing_constant.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/normalizing_constant.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/normalizing_constant.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::detail::distributions::normal::normalizing_constant.hpp //
+// distribution_toolkit::distributions::normal::normalizing_constant.hpp //
// //
// (C) Copyright 2009 Erwann Rogard //
// Use, modification and distribution are subject to the //
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,11 +1,11 @@
-//////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::map_pdf::distributions::students_t::include.hpp //
-// //
-// (C) Copyright 2009 Erwann Rogard //
-// Use, modification and distribution are subject to 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) //
-//////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::students_t::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_INCLUDE_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_INCLUDE_HPP_ER_2009
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/is_math_distribution.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/is_math_distribution.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/is_math_distribution.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::distributions::students_t::is_math_distribution.hpp //
+// distribution_toolkit::distributions::students_t::is_math_distribution.hpp //
// //
// (C) Copyright 2009 Erwann Rogard //
// Use, modification and distribution are subject to the //
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/include.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/include.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/include.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,16 +1,17 @@
-//////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::map_pdf::distributions::uniform::include.hpp //
-// //
-// (C) Copyright 2009 Erwann Rogard //
-// Use, modification and distribution are subject to 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) //
-//////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::::distributions::uniform::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_INCLUDE_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_INCLUDE_HPP_ER_2009
#include <boost/math/distributions/uniform.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/uniform/is_math_distribution.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/uniform/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/uniform/derivative_log_unnormalized_pdf.hpp>
#endif
\ No newline at end of file
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/is_math_distribution.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/is_math_distribution.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/is_math_distribution.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::distributions::uniform::is_math_distribution.hpp //
+// distribution_toolkit::distributions::uniform::is_math_distribution.hpp //
// //
// (C) Copyright 2009 Erwann Rogard //
// Use, modification and distribution are subject to the //
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////////////////////////
-// distributions::unnormalized_pdf::uniform.hpp //
+// distribution_toolkit::distributions::::unnormalized_pdf::uniform.hpp //
// //
// (C) Copyright 2009 Erwann Rogard //
// Use, modification and distribution are subject to the //
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/cdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/cdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/cdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,7 +10,7 @@
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_CDF_HPP_ER_2009
#include <boost/concept/assert.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
-#include <boost/statistics/detail/distribution_toolkit/concept/cdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/cdf.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
namespace boost{
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/derivative_log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/derivative_log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,7 +10,7 @@
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
#include <boost/concept/assert.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
-#include <boost/statistics/detail/distribution_toolkit/concept/derivative_log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/derivative_log_unnormalized_pdf.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
namespace boost{
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,7 +10,7 @@
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_LOG_UNNORMALIZED_PDF_HPP_ER_2009
#include <boost/concept/assert.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
-#include <boost/statistics/detail/distribution_toolkit/concept/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/log_unnormalized_pdf.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
namespace boost{
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/mean.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/mean.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/mean.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,7 +10,7 @@
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_MEAN_HPP_ER_2009
#include <boost/concept/assert.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
-#include <boost/statistics/detail/distribution_toolkit/concept/mean.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/mean.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
namespace boost{
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/normalizing_constant.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/normalizing_constant.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/normalizing_constant.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,7 +10,7 @@
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_NORMALIZING_CONSTANT_HPP_ER_2009
#include <boost/concept/assert.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
-#include <boost/statistics/detail/distribution_toolkit/concept/normalizing_constant.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/normalizing_constant.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
namespace boost{
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,7 +10,7 @@
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_PDF_HPP_ER_2009
#include <boost/concept/assert.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
-#include <boost/statistics/detail/distribution_toolkit/concept/pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/pdf.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
namespace boost{
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/variance.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/variance.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/variance.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,7 +10,7 @@
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_VARIANCE_HPP_ER_2009
#include <boost/concept/assert.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
-#include <boost/statistics/detail/distribution_toolkit/concept/variance.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/variance.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
namespace boost{
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -24,7 +24,7 @@
// Useful for serializing or as a reference wrapper (D = const E&)
//
- // BUG : See example::distribution_function
+ // BUG : See function_ptrs.cpp
template<typename D>
class wrapper : meta::inherit_policy<
typename remove_cv<
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/cdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/cdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/cdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -9,19 +9,20 @@
#ifndef BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_CDF_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_CDF_HPP_ER_2009
#include <boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fwd_math/cdf.hpp>
namespace boost{
-namespace math{
- template<typename T,typename D> T cdf(const D& d,const T& x);
-}
+//namespace math{
+// template<typename T,typename D> T cdf(const D& d,const T& x);
+//}
namespace statistics{
namespace detail{
namespace distribution_toolkit{
namespace fun_wrap{
template<typename D> struct cdf_
- : impl<D,math::cdf>{};
+ : impl<D,cdf>{};
}
}
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -14,10 +14,6 @@
namespace statistics{
namespace detail{
namespace distribution_toolkit{
-
- template<typename T,typename D>
- T log_unnormalized_pdf(const D& d,const T& x);
-
namespace fun_wrap{
template<typename D>
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -9,19 +9,20 @@
#ifndef BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_PDF_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_PDF_HPP_ER_2009
#include <boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fwd_math/pdf.hpp>
namespace boost{
-namespace math{
- template<typename T,typename D> T pdf(const D& d,const T& x);
-}
+//namespace math{
+// template<typename T,typename D> T pdf(const D& d,const T& x);
+//}
namespace statistics{
namespace detail{
namespace distribution_toolkit{
namespace fun_wrap{
- template<typename D> struct pdf_ : impl<D,math::pdf>{};
+ template<typename D> struct pdf_ : impl<D,pdf>{};
}// fun_wrap
}// distribution_toolkit
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/quantile.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/quantile.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/quantile.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -9,13 +9,13 @@
#ifndef BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_QUANTILE_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_QUANTILE_HPP_ER_2009
#include <boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fwd_math/quantile.hpp>
namespace boost{
-namespace math{
- template<typename T,typename D> T quantile(const D& d,const T& x);
-
-}
+//namespace math{
+// template<typename T,typename D> T quantile(const D& d,const T& x);
+//}
namespace statistics{
namespace detail{
namespace distribution_toolkit{
@@ -23,7 +23,7 @@
template<typename D>
struct quantile_
- : impl<D,math::quantile>{};
+ : impl<D,quantile>{};
}// fun_wrap
}// distribution_toolkit
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/cdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/cdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/cdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,6 +10,7 @@
#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_CDF_HPP_ER_2009
#include <boost/utility/enable_if.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
namespace boost{
namespace statistics{
@@ -21,7 +22,7 @@
meta::is_math_distribution<D>,
meta::value<D>
>::type
- cdf(const D& dist,const typename meta::value<D>::type x)
+ cdf(const D& dist,const typename meta::value<D>::type& x)
{
return boost::math::cdf(dist,x);
}
@@ -32,5 +33,4 @@
}// statistics
}// boost
-
#endif
\ No newline at end of file
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/mean.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/mean.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/mean.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,6 +10,7 @@
#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_MEAN_HPP_ER_2009
#include <boost/utility/enable_if.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
namespace boost{
namespace statistics{
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,6 +10,7 @@
#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_PDF_HPP_ER_2009
#include <boost/utility/enable_if.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
namespace boost{
namespace statistics{
@@ -21,7 +22,7 @@
meta::is_math_distribution<D>,
meta::value<D>
>::type
- pdf(const D& dist,const typename meta::value<D>::type x)
+ pdf(const D& dist,const typename meta::value<D>::type& x)
{
return boost::math::pdf(dist,x);
}
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/quantile.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/quantile.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/quantile.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,6 +10,7 @@
#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_QUANTILE_HPP_ER_2009
#include <boost/utility/enable_if.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
namespace boost{
namespace statistics{
@@ -21,7 +22,7 @@
meta::is_math_distribution<D>,
meta::value<D>
>::type
- quantile(const D& dist,const typename meta::value<D>::type p)
+ quantile(const D& dist,const typename meta::value<D>::type& p)
{
return boost::math::quantile(dist,p);
}
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/variance.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/variance.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/variance.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -10,6 +10,7 @@
#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_VARIANCE_HPP_ER_2009
#include <boost/utility/enable_if.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
namespace boost{
namespace statistics{
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/distribution_function.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/distribution_function.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/distribution_function.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -41,7 +41,10 @@
};
-// TODO enable_if<has_pdf>
+// An iterator that transforms x to f(dist,x), f = F<D>::instance,
+// where F is defined in /fun_wrap
+//
+// TODO enable_if<is_pseudo_scalar_distribution>
template<template<typename> class F,typename D,typename ItX>
typename meta_distribution_function<D>::template apply<ItX>::type
make_distribution_function(
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -12,7 +12,7 @@
#include <boost/utility/enable_if.hpp>
#include <boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/inverse_pdf.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
-#include <boost/statistics/detail/distribution_toolkit/concept/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/log_unnormalized_pdf.hpp>
namespace boost{
namespace statistics{
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -12,7 +12,7 @@
#include <boost/utility/enable_if.hpp>
#include <boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/product_pdf.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
-#include <boost/statistics/detail/distribution_toolkit/concept/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/unary/log_unnormalized_pdf.hpp>
namespace boost{
namespace statistics{
@@ -30,7 +30,7 @@
concept::LogUnnormalizedPdf<A>
));
BOOST_CONCEPT_ASSERT((
- concept::LogUnnormalizedPdf<A>
+ concept::LogUnnormalizedPdf<B>
));
return
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,12 +1,12 @@
///////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::meta::is_pseudo_scalar_distribution.hpp //
+// distribution_toolkit::meta::is_pseudo_scalar_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_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_IS_PSEUDO_DISTRIBUTION_HPP_ER_2009
-#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_IS_PSEUDO_DISTRIBUTION_HPP_ER_2009
+#ifndef BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_IS_PSEUDO_SCALAR_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_IS_PSEUDO_SCALAR_DISTRIBUTION_HPP_ER_2009
#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
namespace boost{
Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/derivative_log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,30 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::unscope::derivative_log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+
+ template<typename D,typename T>
+ typename boost::lazy_enable_if<
+ statistics::detail::distribution_toolkit::meta
+ ::is_pseudo_scalar_distribution<D>,
+ statistics::detail::distribution_toolkit::meta::value<D>
+ >::type
+ derivative_log_unnormalized_pdf(const D& d,const T& x){
+ return statistics::detail::distribution_toolkit
+ ::derivative_log_unnormalized_pdf(d,x);
+ }
+
+}// boost
+
+#endif
\ No newline at end of file
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/include.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/include.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/include.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -9,7 +9,10 @@
#ifndef BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_INCLUDE_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_INCLUDE_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/unscope/derivative_log_unnormalized_pdf.hpp>
#include <boost/statistics/detail/distribution_toolkit/unscope/log_unnormalized_pdf.hpp>
#include <boost/statistics/detail/distribution_toolkit/unscope/os.hpp>
+// Add pdf, cdf etc. when need arises
+
#endif
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/log_unnormalized_pdf.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/log_unnormalized_pdf.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/log_unnormalized_pdf.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -9,36 +9,20 @@
#ifndef BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
#include <boost/utility/enable_if.hpp>
-#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
namespace boost{
-namespace statistics{
-namespace detail{
-namespace distribution_toolkit{
-
- template<typename D,typename T>
- T log_unnormalized_pdf(const D& d,const T& x);
-
-}// detail
-}// distribution_toolkit
-}// detail
-}// statistics
-
-
- // The reason for unscoping is to have a common interface for
- // distributions defined in distribution_toolkit and other
- // libraries, not necessarily restricted to scalars
-
template<typename D,typename T>
- typename boost::enable_if<
- statistics::detail::distribution_toolkit::meta
- ::is_pseudo_scalar_distribution_distribution<D>,
- T // TODO or perhaps meta::value<D>::type, using lazy_enable_if
- >
+ typename boost::lazy_enable_if<
+ boost::statistics::detail::distribution_toolkit::meta
+ ::is_pseudo_scalar_distribution<D>,
+ boost::statistics::detail::distribution_toolkit::meta::value<D>
+ >::type
log_unnormalized_pdf(const D& d,const T& x){
- return statistics::detail::distribution_toolkit
- ::log_unnormalized_pdf<D>(d,x);
+ return boost::statistics::detail::distribution_toolkit
+ ::log_unnormalized_pdf(d,x);
}
}// boost
Modified: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/os.hpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/os.hpp (original)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/os.hpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -1,13 +1,13 @@
//////////////////////////////////////////////////////////////////////////////
-// distribution_toolkit::unscope::log_unnormalized_pdf.hpp //
+// distribution_toolkit::unscope::os.hpp //
// //
// (C) Copyright 2009 Erwann Rogard //
// Use, modification and distribution are subject to 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_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
-#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#ifndef BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_OS_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_OS_HPP_ER_2009
#include <boost/utility/enable_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp>
Modified: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/doc/readme.txt
==============================================================================
--- sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/doc/readme.txt (original)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/doc/readme.txt 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -11,22 +11,33 @@
erwann.rogard_at_[hidden]
+Please report your experience (good or bad) if are you using MSVC or gcc on
+any platform other than Mac, from exectuting the examples in
+libs/statistics/detail/distribution_toolkit/example
+
[ Overview ]
These are C++ classes that extend boost/math/distributions. However, it is not
intrusive. Instead, the distributions in boost::math are brought into the scope
of distribution_toolkit with forwarding functions.
-[ Linux, Windows ]
+[ Related links ]
-Please report your experience (good or bad) if are you using MSVC or gcc on
-any platform other than Mac, from exectuting
-libs/statistics/detail/distribution_toolkit/example
+http://www.boost.org/doc/libs/1_40_0/libs/math/doc/sf_and_dist/html/index.html
+http://www.boost.org/doc/libs/1_40_0/libs/random/index.html
-[ Related links ]
+[ Platform/Compiler ]
-http://www.boost.org/doc/libs/1_39_0/libs/math/doc/sf_and_dist/html/index.html
-http://www.boost.org/doc/libs/1_39_0/libs/random/index.html
+Mac OS Leopard 10.5 gcc version 4.0.1
+ Intel C++ compiler 11.1
+
+[ Dependencies ]
+
+boost_1_40_0
+/sandbox/statistics/random/
+
+To use distributions/wrapper,
+libboost_serialization-xgcc42-mt-1_39.a
[ Directories ]
@@ -77,19 +88,6 @@
The rationale for this is to have a common interface for the distributions
in distribution_toolkit, and others defined throughout boost::statistics
-[ Platform/Compiler ]
-
-Mac OS Leopard 10.5 gcc version 4.0.1
-
-
-[ Dependencies ]
-
-boost_1_39_0
-/sandbox/statistics/random/
-
-To use distributions/wrapper,
-libboost_serialization-xgcc42-mt-1_39.a
-
[ Bugs ]
See distributions/wrapper/wrapper.hpp
Modified: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.cpp
==============================================================================
--- sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.cpp (original)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.cpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -23,18 +23,18 @@
#include <boost/random/variate_generator.hpp>
#include <boost/statistics/detail/distribution_toolkit/meta/include.hpp>
-#include <boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/map_pdf/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/iterator/include.hpp>
#include <boost/statistics/detail/distribution_toolkit/fun_wrap/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/unscope/include.hpp>
#include <libs/statistics/detail/distribution_toolkit/example/distribution_function.h>
void example_distribution_function(std::ostream& out){
- out << "-> example_math_location_scale->" << std::endl;
+ out << "-> example_math_location_scale" << std::endl;
// Examples of location_scale + fun_wrap + map_pdf + iterator
@@ -46,8 +46,6 @@
// Types
typedef double val_;
- typedef std::vector<val_> vals_;
- typedef std::string str_;
typedef boost::mt19937 urng_;
typedef boost::normal_distribution<val_> rnd_;
typedef math::students_t_distribution<val_> stud_;
@@ -61,10 +59,8 @@
const unsigned n = 1e1;
const val_ x = 2.132;
-
// Initialization
urng_ urng;
- vals_ range_x;
stud_ stud(df);
ls_stud_ ls_stud(mu, sigma, stud);
@@ -79,40 +75,7 @@
};
- { // fun_wrap
- typedef tk::meta::delegate<stud_> meta_deleg_;
- typedef meta_deleg_::type deleg_;
- deleg_ deleg
- = meta_deleg_::make<tk::fun_wrap::log_unnormalized_pdf_>();
- BOOST_ASSERT(
- float_::equal(
- deleg(stud,x),
- tk::log_unnormalized_pdf(stud,x)
- )
- );
-
- // test wrapper
- // BUG
- {
- typedef tk::wrapper<const stud_&> cref_stud_;
- cref_stud_ cref_stud(stud);
-
- typedef tk::meta::delegate<cref_stud_> meta_deleg2_;
- typedef meta_deleg2_::type deleg2_;
-
- // TODO compile error here:
- //deleg2_ deleg2
- // = meta_deleg2_::make<tk::fun_wrap::log_unnormalized_pdf_>();
-
- BOOST_ASSERT(
- float_::equal(
- tk::log_unnormalized_pdf(cref_stud,x),
- tk::log_unnormalized_pdf(stud,x)
- )
- );
- }
- }
- { // fun_wrap + location_scale_distribution
+ { // Create a delegate for log_unnormalized_pdf
typedef tk::meta::delegate<ls_stud_> meta_deleg_;
typedef meta_deleg_::type deleg_;
@@ -126,7 +89,9 @@
);
}
{ // make_distribution_function_iterator + fun_wrap
- // Arbitrary random sample
+ // Arbitrary random sample
+ typedef std::vector<val_> vals_;
+ vals_ range_x;
std::generate_n(
back_inserter(range_x),
n,
@@ -143,7 +108,7 @@
std::back_inserter(range_log_pdf)
);
}
- { // product_pdf + fun_wrap
+ { // product_pdf
typedef tk::product_pdf<stud_,ls_stud_> prod_dist_;
typedef tk::meta::delegate<prod_dist_> meta_deleg_;
@@ -157,41 +122,42 @@
BOOST_ASSERT(
float_::equal(
- deleg(prod_dist,x),
+ tk::log_unnormalized_pdf(prod_dist,x),
+ tk::log_unnormalized_pdf(prod_dist2,x)
+ )
+ );
+ BOOST_ASSERT(
+ float_::equal(
+ tk::log_unnormalized_pdf(prod_dist.first(),x)
+ + tk::log_unnormalized_pdf(prod_dist.second(),x),
tk::log_unnormalized_pdf(prod_dist,x)
)
);
}
- { // inverse_pdf + fun_wrap
+ { // inverse_pdf
typedef tk::inverse_pdf<stud_> inv_dist_;
- typedef tk::meta::delegate<inv_dist_> meta_deleg_;
- typedef meta_deleg_::type deleg_;
- deleg_ deleg
- = meta_deleg_::make<tk::fun_wrap::log_unnormalized_pdf_>();
inv_dist_ inv_dist(stud);
BOOST_ASSERT(
float_::equal(
- deleg(inv_dist,x),
+ -tk::log_unnormalized_pdf(inv_dist.distribution(),x),
tk::log_unnormalized_pdf(inv_dist,x)
)
);
}
{ // ratio_pdf + fun_wrap
- typedef tk::meta_ratio_pdf<stud_,ls_stud_> mf_;
+ typedef tk::meta_ratio_pdf<stud_,ls_stud_> mf_;
typedef mf_::type ratio_dist_;
ratio_dist_ ratio_dist = mf_::make(stud,ls_stud);
- typedef tk::meta::delegate<ratio_dist_> meta_deleg_;
- typedef meta_deleg_::type deleg_;
- deleg_ deleg
- = meta_deleg_::make<tk::fun_wrap::log_unnormalized_pdf_>();
-
+
BOOST_ASSERT(
float_::equal(
- deleg(ratio_dist,x),
+ // + sign because inherits from inverse
+ tk::log_unnormalized_pdf(ratio_dist.first(),x)
+ + tk::log_unnormalized_pdf(ratio_dist.second(),x),
tk::log_unnormalized_pdf(ratio_dist,x)
)
);
Modified: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.h
==============================================================================
--- sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.h (original)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.h 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -7,7 +7,7 @@
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
//////////////////////////////////////////////////////////////////////////////
#ifndef LIBS_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_EXAMPLE_DISTRIBUTION_FUNCTION_H_ER_2009
-#define LIBS_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_EXAMPLE_DISTRIBUTION_FUNCTION__H_ER_2009
+#define LIBS_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_EXAMPLE_DISTRIBUTION_FUNCTION_H_ER_2009
#include <ostream>
void example_distribution_function(std::ostream&);
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-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -91,8 +91,9 @@
}
{
typedef math::gamma_distribution<val_> dist_;
- const val_ shape = 1.0;
- dist_ dist( shape );
+ const val_ shape = 2.0;
+ const val_ scale = 3.0;
+ dist_ dist( shape, scale );
os << dist << std::endl;
unsigned i = 0;
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-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -9,11 +9,15 @@
#include <iostream>
#include <libs/statistics/detail/distribution_toolkit/example/distribution_function.h>
#include <libs/statistics/detail/distribution_toolkit/example/random.h>
+#include <libs/statistics/detail/distribution_toolkit/test/unnormalized_functions.cpp>
+#include <libs/statistics/detail/distribution_toolkit/test/function_ptrs.cpp>
int main(){
example_distribution_function(std::cout);
example_random(std::cout);
+ test_unnormalized_functions<double>();
+ test_function_ptrs<double>();
return 0;
}
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/test/function_ptrs.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/test/function_ptrs.cpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,86 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::test::function_ptrs.cpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 LIBS_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_TEST_FUNCTION_PTRS_H_ER_2009
+#define LIBS_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_TEST_FUNCTION_PTRS_H_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/aggregate/function_ptrs.hpp>
+
+
+template <typename T>
+void test_function_ptrs()
+{
+ using namespace boost;
+ using namespace math;
+
+ namespace tk = boost::statistics::detail::distribution_toolkit;
+ namespace tk_c = tk::concept;
+
+ typedef math::chi_squared_distribution<T> chi_squared_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::FunctionPtrs<chi_squared_>
+ ));
+
+ typedef math::exponential_distribution<T> exponential_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::FunctionPtrs<exponential_>
+ ));
+
+ typedef math::gamma_distribution<T> gamma_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::FunctionPtrs<gamma_>
+ ));
+
+ typedef math::normal_distribution<T> normal_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::FunctionPtrs<normal_>
+ ));
+
+ typedef math::uniform_distribution<T> uniform_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::FunctionPtrs<uniform_>
+ ));
+
+ typedef math::students_t_distribution<T> students_t_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::FunctionPtrs<students_t_>
+ ));
+
+ //typedef tk::wrapper< const normal_& > wrapper_;
+ //BOOST_CONCEPT_ASSERT((
+ // tk_c::FunctionPtrs<wrapper_>
+ //));
+
+ typedef tk::location_scale_distribution< normal_ > loc_scale_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::FunctionPtrs<loc_scale_>
+ ));
+
+ // Weaker requirements
+ typedef tk::inverse_pdf< normal_ > inv_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::LogUnnormalizedPdf<inv_>
+ ));
+
+ typedef tk::product_pdf< normal_,students_t_ > prod_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::LogUnnormalizedPdf<prod_>
+ ));
+
+ typedef typename
+ tk::meta_ratio_pdf< normal_,students_t_ >::type ratio_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::LogUnnormalizedPdf<ratio_>
+ ));
+
+}
+
+#endif
\ No newline at end of file
Added: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/test/unnormalized_functions.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/test/unnormalized_functions.cpp 2009-09-30 22:28:26 EDT (Wed, 30 Sep 2009)
@@ -0,0 +1,87 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::test::concept_unnormalized_functions.h //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 LIBS_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_TEST_UNNORMALIZED_FUNCTIONS_H_ER_2009
+#define LIBS_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_TEST_UNNORMALIZED_FUNCTIONS_H_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/include.hpp>
+
+#include <boost/statistics/detail/distribution_toolkit/concept/aggregate/unnormalized_functions.hpp>
+#include <libs/statistics/detail/distribution_toolkit/test/unnormalized_functions.cpp>
+
+template <typename T>
+void test_unnormalized_functions()
+{
+ using namespace boost;
+ using namespace math;
+
+ namespace tk = boost::statistics::detail::distribution_toolkit;
+ namespace tk_c = tk::concept;
+
+
+ typedef math::chi_squared_distribution<T> chi_squared_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::UnnormalizedFunctions<chi_squared_>
+ ));
+
+ typedef math::exponential_distribution<T> exponential_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::UnnormalizedFunctions<exponential_>
+ ));
+
+ typedef math::gamma_distribution<T> gamma_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::UnnormalizedFunctions<gamma_>
+ ));
+
+ typedef math::normal_distribution<T> normal_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::UnnormalizedFunctions<normal_>
+ ));
+
+ typedef math::uniform_distribution<T> uniform_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::UnnormalizedFunctions<uniform_>
+ ));
+
+ typedef math::students_t_distribution<T> students_t_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::UnnormalizedFunctions<students_t_>
+ ));
+
+ typedef tk::wrapper< const normal_& > wrapper_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::UnnormalizedFunctions<wrapper_>
+ ));
+
+ typedef tk::location_scale_distribution< normal_ > loc_scale_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::UnnormalizedFunctions<loc_scale_>
+ ));
+
+ // Weaker requirements (simply not implemented yet)
+ typedef tk::inverse_pdf< normal_ > inv_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::LogUnnormalizedPdf<inv_>
+ ));
+
+ typedef tk::product_pdf< normal_,students_t_ > prod_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::LogUnnormalizedPdf<prod_>
+ ));
+
+ typedef typename
+ tk::meta_ratio_pdf< normal_,students_t_ >::type ratio_;
+ BOOST_CONCEPT_ASSERT((
+ tk_c::LogUnnormalizedPdf<ratio_>
+ ));
+
+}
+
+#endif
\ No newline at end of file
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