Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58161 - in sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common: concept/unary meta/inherit meta/random meta/wrapper
From: erwann.rogard_at_[hidden]
Date: 2009-12-05 20:03:48


Author: e_r
Date: 2009-12-05 20:03:46 EST (Sat, 05 Dec 2009)
New Revision: 58161
URL: http://svn.boost.org/trac/boost/changeset/58161

Log:
a
Added:
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/concept/unary/description.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/concept/unary/os.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/inherit/
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/inherit/policy.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/inherit/value.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/random/
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/random/distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/random/generator.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper/
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper/distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper/probability.hpp (contents, props changed)
   sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper/variable.hpp (contents, props changed)

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/concept/unary/description.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/concept/unary/description.hpp 2009-12-05 20:03:46 EST (Sat, 05 Dec 2009)
@@ -0,0 +1,40 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution::common::concept::concept::unary::description.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_CONCEPT_UNARY_DESCRIPTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_CONCEPT_UNARY_DESCRIPTION_HPP_ER_2009
+#include <string>
+#include <boost/concept_check.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace concept{
+
+ template<typename B>
+ class Description : public B{
+ typedef typename B::distribution_type d_;
+
+ public:
+ BOOST_CONCEPT_USAGE(Description){
+ str = description(d);
+ }
+
+ private:
+ d_ d;
+ std::string str;
+ };
+
+}// concept
+}// distribution
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/concept/unary/os.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/concept/unary/os.hpp 2009-12-05 20:03:46 EST (Sat, 05 Dec 2009)
@@ -0,0 +1,40 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution::common::concept::concept::unary::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_COMMON_CONCEPT_UNARY_OS_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_CONCEPT_UNARY_OS_HPP_ER_2009
+#include <ostream>
+#include <boost/concept_check.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace concept{
+
+ template<typename B>
+ class Os : public B{
+ typedef typename B::distribution_type d_;
+
+ public:
+ BOOST_CONCEPT_USAGE(Os){
+ os << d;
+ }
+
+ private:
+ std::ostream os;
+ d_ d;
+ };
+
+}// concept
+}// distribution
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/inherit/policy.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/inherit/policy.hpp 2009-12-05 20:03:46 EST (Sat, 05 Dec 2009)
@@ -0,0 +1,38 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution::common::meta::inherit_policy.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_META_INHERIT_POLICY_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_META_INHERIT_POLICY_HPP_ER_2009
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/mpl/empty_base.hpp>
+#include <boost/statistics/detail/distribution_common/meta/policy.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace meta{
+
+ template<typename D,typename B = mpl::empty_base>
+ struct inherit_policy : B{
+ BOOST_MPL_ASSERT((
+ mpl::not_<
+ is_reference<D>
+ >
+ ));
+ typedef typename meta::policy<D>::type policy_type;
+ };
+
+}// meta
+}// distribution
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/inherit/value.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/inherit/value.hpp 2009-12-05 20:03:46 EST (Sat, 05 Dec 2009)
@@ -0,0 +1,40 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution::common::meta::inherit_value.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_META_INHERIT_VALUE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_META_INHERIT_VALUE_HPP_ER_2009
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/mpl/empty_base.hpp>
+#include <boost/statistics/detail/distribution_common/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace meta{
+
+ template<typename D,typename B = mpl::empty_base>
+ struct inherit_value : B{
+ BOOST_MPL_ASSERT((
+ mpl::not_<
+ is_reference<D>
+ >
+ ));
+
+ typedef typename value<D>::type value_type;
+
+ };
+
+}// meta
+}// common
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/random/distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/random/distribution.hpp 2009-12-05 20:03:46 EST (Sat, 05 Dec 2009)
@@ -0,0 +1,40 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution::common::meta::random::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_COMMON_META_RANDOM_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_META_RANDOM_DISTRIBUTION_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace meta{
+
+ template<typename D>
+ struct random_distribution{};
+
+ // Provide a specialization for each D that models RandomDistribution
+ // http://www.boost.org/doc/libs/1_40_0/libs/random/random-concepts.html
+ // and provide static type call(const D& )
+
+}// meta
+
+ template<typename D>
+ typename meta::random_distribution<D>::type
+ make_random_distribution(const D& d){
+ typedef meta::random_distribution<D> meta_;
+ return meta_::call(d);
+ }
+
+}// distribution
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/random/generator.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/random/generator.hpp 2009-12-05 20:03:46 EST (Sat, 05 Dec 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution::common::meta::random::generator.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_RANDOM_GENERATOR_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_META_RANDOM_GENERATOR_HPP_ER_2009
+#include <boost/random/variate_generator.hpp>
+#include <boost/statistics/detail/distribution_common/meta/random/distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace meta{
+
+ // U = V or U = V& allowed where V models UniformRandomNumberGenerator
+ template<typename D,typename U>
+ struct random_generator{
+ typedef meta::random_distribution<D> meta_;
+ typedef typename meta_::type r_;
+ typedef boost::variate_generator<U,r_> type;
+
+ static type call(U urng,const D& d){
+ return type(urng,make_random_distribution(d));
+ }
+ };
+
+}// meta
+
+ template<typename D,typename U>
+ typename meta::random_generator<D,U&>::type
+ make_random_generator(U& urng,const D& dist){
+ typedef meta::random_generator<D,U&> meta_;
+ return meta_::call(urng,dist);
+ }
+
+}// distribution
+}// detail
+}// statistics
+}// boost
+
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper/distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper/distribution.hpp 2009-12-05 20:03:46 EST (Sat, 05 Dec 2009)
@@ -0,0 +1,30 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution::common::meta::wrapper_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_WRAPPER_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_META_WRAPPER_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/empty_base.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace meta{
+
+ template<typename D,typename B = boost::mpl::empty_base>
+ struct wrapper_distribution : B{
+ typedef D distribution_type;
+ };
+
+}// meta
+}// distribution
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper/probability.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper/probability.hpp 2009-12-05 20:03:46 EST (Sat, 05 Dec 2009)
@@ -0,0 +1,30 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution::common::meta::wrapper_probability.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_WRAPPER_PROBABILITY_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_META_WRAPPER_PROBABILITY_HPP_ER_2009
+#include <boost/mpl/empty_base.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace meta{
+
+ template<typename P,typename B = boost::mpl::empty_base>
+ struct wrapper_probability : B{
+ typedef P probability_type;
+ };
+
+}// meta
+}// distribution
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper/variable.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_common/boost/statistics/detail/distribution_common/meta/wrapper/variable.hpp 2009-12-05 20:03:46 EST (Sat, 05 Dec 2009)
@@ -0,0 +1,30 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution::common::meta::wrapper_variable.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_WRAPPER_INPUT_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_COMMON_META_WRAPPER_INPUT_HPP_ER_2009
+#include <boost/mpl/empty_base.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution{
+namespace meta{
+
+ template<typename X,typename B = boost::mpl::empty_base>
+ struct wrapper_variable : B{
+ typedef X variable_type;
+ };
+
+}// meta
+}// distribution
+}// detail
+}// statistics
+}// boost
+
+#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