Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57317 - in sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common: distributions distributions/reference functor meta
From: erwann.rogard_at_[hidden]
Date: 2009-11-03 11:32:04


Author: e_r
Date: 2009-11-03 11:32:03 EST (Tue, 03 Nov 2009)
New Revision: 57317
URL: http://svn.boost.org/trac/boost/changeset/57317

Log:
m/a
Added:
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/reference/
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/reference/include.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/reference/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/reference/wrapper.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/functor/
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/functor/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/distribution.hpp (contents, props changed)
Text files modified:
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_distribution.hpp | 2 +-
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_probability.hpp | 2 +-
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_variable.hpp | 3 +--
   3 files changed, 3 insertions(+), 4 deletions(-)

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/reference/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/reference/include.hpp 2009-11-03 11:32:03 EST (Tue, 03 Nov 2009)
@@ -0,0 +1,15 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution::common::reference::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_COMMON_DISTRIBUTIONS_REFERENCE_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_DISTRIBUTIONS_REFERENCE_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_common/distributions/reference/wrapper.hpp>
+#include <boost/statistics/detail/distribution_common/distributions/reference/log_unnormalized_pdf.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/reference/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/reference/log_unnormalized_pdf.hpp 2009-11-03 11:32:03 EST (Tue, 03 Nov 2009)
@@ -0,0 +1,39 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution::common::reference::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_COMMON_DISTRIBUTIONS_REFERENCE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_DISTRIBUTIONS_REFERENCE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/mpl/empty_base.hpp>
+#include <boost/call_traits.hpp>
+#include <boost/statistics/detail/distribution_common/meta/value.hpp>
+#include <boost/statistics/detail/distribution_common/distributions/reference/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+
+ template<typename D,typename X>
+ typename distribution::common::meta::value<
+ distribution::common::reference::wrapper<D>
+ >::type
+ log_unnormalized_pdf(
+ const distribution::common::reference::wrapper<D>& rw,
+ const X& x
+ )
+ {
+ return boost::statistics::detail::log_unnormalized_pdf(
+ rw.distribution(),
+ x
+ );
+ }
+
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/reference/wrapper.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/distributions/reference/wrapper.hpp 2009-11-03 11:32:03 EST (Tue, 03 Nov 2009)
@@ -0,0 +1,64 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution::common::reference::wrapper.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_COMMON_DISTRIBUTIONS_REFERENCE_WRAPPER_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_DISTRIBUTIONS_REFERENCE_WRAPPER_HPP_ER_2009
+#include <boost/call_traits.hpp>
+#include <boost/statistics/detail/distribution_common/meta/value.hpp>
+#include <boost/statistics/detail/distribution_common/meta/distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace common{
+namespace reference{
+
+ template<typename D>
+ class wrapper{
+
+ public:
+
+ typedef typename remove_cv<
+ typename remove_reference<D>::type
+ >::type distribution_type;
+
+ typedef typename meta::value<distribution_type>::type value_type;
+
+ wrapper(){}
+ wrapper(typename call_traits<D>::param_type dist):dist_(dist){}
+ wrapper(const wrapper& that):dist_(that.dist_){}
+ wrapper& operator=(const wrapper& that)
+ {
+ if(&that!=this)
+ {
+ this->dist_ = that.dist_;
+ }
+ return (*this);
+ }
+
+
+ typename call_traits<D>::const_reference
+ distribution()const
+ {
+ return this->dist_;
+ }
+
+ private:
+ typename call_traits<D>::value_type dist_;
+
+ };
+
+}// reference
+}// common
+}// distribution
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/functor/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/functor/log_unnormalized_pdf.hpp 2009-11-03 11:32:03 EST (Tue, 03 Nov 2009)
@@ -0,0 +1,68 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution::common::functor::log_unnormalized_pdf.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_COMMON_FUNCTOR_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_FUNCTOR_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/statistics/detail/distribution_common/meta/value.hpp>
+#include <boost/statistics/detail/distribution_common/functor/log_unnormalized_pdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace common{
+namespace functor{
+
+ template<typename D>
+ class log_unnormalized_pdf
+ {
+
+ BOOST_MPL_ASSERT((
+ boost::mpl::not_< boost::is_reference<D> >
+ )); // use reference::wrapper if a ref is needed
+
+ public:
+ typedef D distribution_type;
+ typedef typename common::meta::value<D>::type result_type;
+
+ log_unnormalized_pdf(){}
+ log_unnormalized_pdf(const D& d):d_(d){}
+ log_unnormalized_pdf(const log_unnormalized_pdf& that)
+ :d_(that.d_){}
+ log_unnormalized_pdf& operator=(const log_unnormalized_pdf& that)
+ {
+ if(&that!=this)
+ {
+ d_ = that.d_;
+ }
+ return (*this);
+ }
+
+ template<typename X>
+ result_type
+ operator()(const X& x)const{
+ return boost::statistics::detail::log_unnormalized_pdf(
+ this->distribution(),
+ x
+ );
+ }
+
+ const D& distribution()const{ return this->d_; }
+
+ private:
+ D d_;
+
+ };
+
+}// accumulator
+}// common
+}// distribution
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/distribution.hpp 2009-11-03 11:32:03 EST (Tue, 03 Nov 2009)
@@ -0,0 +1,32 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution::common::meta::distribution.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_COMMON_META_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_META_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/identity.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace common{
+namespace meta{
+
+ template<typename D>
+ struct distribution : boost::mpl::identity<
+ typename D::distribution_type
+ >{};
+
+}// meta
+}// common
+}// distribution
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Modified: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_distribution.hpp
==============================================================================
--- sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_distribution.hpp (original)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_distribution.hpp 2009-11-03 11:32:03 EST (Tue, 03 Nov 2009)
@@ -17,7 +17,7 @@
 namespace common{
 namespace meta{
 
- template<typename D,typename B = mpl::empty_base>
+ template<typename D,typename B = boost::mpl::empty_base>
     struct wrapper_distribution : B{
         typedef D distribution_type;
     };

Modified: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_probability.hpp
==============================================================================
--- sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_probability.hpp (original)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_probability.hpp 2009-11-03 11:32:03 EST (Tue, 03 Nov 2009)
@@ -17,7 +17,7 @@
 namespace common{
 namespace meta{
 
- template<typename P,typename B = mpl::empty_base>
+ template<typename P,typename B = boost::mpl::empty_base>
     struct wrapper_probability : B{
         typedef P probability_type;
     };

Modified: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_variable.hpp
==============================================================================
--- sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_variable.hpp (original)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper_variable.hpp 2009-11-03 11:32:03 EST (Tue, 03 Nov 2009)
@@ -17,7 +17,7 @@
 namespace common{
 namespace meta{
 
- template<typename X,typename B = mpl::empty_base>
+ template<typename X,typename B = boost::mpl::empty_base>
     struct wrapper_variable : B{
         typedef X variable_type;
     };
@@ -25,7 +25,6 @@
 }// meta
 }// common
 }// distribution
-
 }// detail
 }// statistics
 }// boost


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