Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58700 - in sandbox/numeric_bindings/boost/numeric/bindings: . detail
From: rutger_at_[hidden]
Date: 2010-01-05 02:27:17


Author: rutger
Date: 2010-01-05 02:27:15 EST (Tue, 05 Jan 2010)
New Revision: 58700
URL: http://svn.boost.org/trac/boost/changeset/58700

Log:
added symm, herm, unit_upper, unit_lower

Added:
   sandbox/numeric_bindings/boost/numeric/bindings/detail/basic_wrapper.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/herm.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/symm.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/unit_lower.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/unit_upper.hpp (contents, props changed)
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lower.hpp | 38 ++++++++++----------------------------
   sandbox/numeric_bindings/boost/numeric/bindings/upper.hpp | 38 ++++++++++----------------------------
   2 files changed, 20 insertions(+), 56 deletions(-)

Added: sandbox/numeric_bindings/boost/numeric/bindings/detail/basic_wrapper.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/detail/basic_wrapper.hpp 2010-01-05 02:27:15 EST (Tue, 05 Jan 2010)
@@ -0,0 +1,41 @@
+//
+// Copyright (c) 2009 Rutger ter Borg
+//
+// 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_NUMERIC_BINDINGS_DETAIL_BASIC_WRAPPER_HPP
+#define BOOST_NUMERIC_BINDINGS_DETAIL_BASIC_WRAPPER_HPP
+
+#include <boost/ref.hpp>
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <boost/numeric/bindings/detail/basic_unwrapper.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace detail {
+
+template< typename T, typename P1 = mpl::void_, typename P2 = mpl::void_,
+ typename P3 = mpl::void_, typename P4 = mpl::void_ >
+struct basic_wrapper: reference_wrapper<T> {
+ basic_wrapper( T& t ): reference_wrapper<T>( t ) {}
+};
+
+template< typename T, typename P1, typename P2, typename P3, typename P4,
+ typename Id, typename Enable >
+struct adaptor< basic_wrapper<T, P1, P2, P3, P4>, Id, Enable >:
+ basic_unwrapper< T, Id > {
+
+ typedef typename property_insert< T, P1, P2, P3, P4 >::type property_map;
+
+};
+
+} // namespace detail
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/herm.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/herm.hpp 2010-01-05 02:27:15 EST (Tue, 05 Jan 2010)
@@ -0,0 +1,44 @@
+//
+// Copyright (c) 2009 Rutger ter Borg
+//
+// 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_NUMERIC_BINDINGS_HERM_HPP
+#define BOOST_NUMERIC_BINDINGS_HERM_HPP
+
+#include <boost/numeric/bindings/detail/basic_wrapper.hpp>
+#include <boost/numeric/bindings/tag.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace result_of {
+
+template< typename T >
+struct herm {
+ typedef detail::basic_wrapper<
+ T,
+ mpl::pair< tag::matrix_type, tag::hermitian >
+ > type;
+};
+
+} // namespace result_of
+
+template< typename T >
+typename result_of::herm< T >::type herm( T& underlying ) {
+ return typename result_of::herm< T >::type( underlying );
+}
+
+template< typename T >
+typename result_of::herm< const T >::type herm( const T& underlying ) {
+ return typename result_of::herm< const T >::type( underlying );
+}
+
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lower.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lower.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lower.hpp 2010-01-05 02:27:15 EST (Tue, 05 Jan 2010)
@@ -9,51 +9,33 @@
 #ifndef BOOST_NUMERIC_BINDINGS_LOWER_HPP
 #define BOOST_NUMERIC_BINDINGS_LOWER_HPP
 
-#include <boost/numeric/bindings/detail/adaptor.hpp>
-#include <boost/numeric/bindings/detail/basic_unwrapper.hpp>
+#include <boost/numeric/bindings/detail/basic_wrapper.hpp>
 #include <boost/numeric/bindings/tag.hpp>
 
 namespace boost {
 namespace numeric {
 namespace bindings {
-
-namespace detail {
-
-template< typename T >
-struct lower_wrapper: reference_wrapper<T> {
- lower_wrapper( T& t ): reference_wrapper<T>( t ) {}
-};
-
-template< typename T, typename Id, typename Enable >
-struct adaptor< lower_wrapper<T>, Id, Enable >
- basic_unwrapper< T, Id > {
-
- typedef typename property_insert< T,
- mpl::pair< tag::matrix_type, tag::triangular >,
- mpl::pair< tag::data_side, tag::lower >
- >::type property_map;
-
-};
-
-} // namespace detail
-
 namespace result_of {
 
 template< typename T >
 struct lower {
- typedef detail::lower_wrapper<T> type;
+ typedef detail::basic_wrapper<
+ T,
+ mpl::pair< tag::matrix_type, tag::triangular >,
+ mpl::pair< tag::data_side, tag::lower >
+ > type;
 };
 
 } // namespace result_of
 
 template< typename T >
-detail::lower_wrapper<T> lower( T& underlying ) {
- return detail::lower_wrapper<T>( underlying );
+typename result_of::lower< T >::type lower( T& underlying ) {
+ return typename result_of::lower< T >::type( underlying );
 }
 
 template< typename T >
-detail::lower_wrapper<const T> lower( const T& underlying ) {
- return detail::lower_wrapper<const T>( underlying );
+typename result_of::lower< const T >::type lower( const T& underlying ) {
+ return typename result_of::lower< const T >::type( underlying );
 }
 
 } // namespace bindings

Added: sandbox/numeric_bindings/boost/numeric/bindings/symm.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/symm.hpp 2010-01-05 02:27:15 EST (Tue, 05 Jan 2010)
@@ -0,0 +1,44 @@
+//
+// Copyright (c) 2009 Rutger ter Borg
+//
+// 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_NUMERIC_BINDINGS_SYMM_HPP
+#define BOOST_NUMERIC_BINDINGS_SYMM_HPP
+
+#include <boost/numeric/bindings/detail/basic_wrapper.hpp>
+#include <boost/numeric/bindings/tag.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace result_of {
+
+template< typename T >
+struct symm {
+ typedef detail::basic_wrapper<
+ T,
+ mpl::pair< tag::matrix_type, tag::symmetric >
+ > type;
+};
+
+} // namespace result_of
+
+template< typename T >
+typename result_of::symm< T >::type symm( T& underlying ) {
+ return typename result_of::symm< T >::type( underlying );
+}
+
+template< typename T >
+typename result_of::symm< const T >::type symm( const T& underlying ) {
+ return typename result_of::symm< const T >::type( underlying );
+}
+
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/unit_lower.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/unit_lower.hpp 2010-01-05 02:27:15 EST (Tue, 05 Jan 2010)
@@ -0,0 +1,45 @@
+//
+// Copyright (c) 2009 Rutger ter Borg
+//
+// 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_NUMERIC_BINDINGS_UNIT_LOWER_HPP
+#define BOOST_NUMERIC_BINDINGS_UNIT_LOWER_HPP
+
+#include <boost/numeric/bindings/detail/basic_wrapper.hpp>
+#include <boost/numeric/bindings/tag.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace result_of {
+
+template< typename T >
+struct unit_lower {
+ typedef detail::basic_wrapper<
+ T,
+ mpl::pair< tag::matrix_type, tag::unit_triangular >,
+ mpl::pair< tag::data_side, tag::lower >
+ > type;
+};
+
+} // namespace result_of
+
+template< typename T >
+typename result_of::unit_lower< T >::type unit_lower( T& underlying ) {
+ return typename result_of::unit_lower< T >::type( underlying );
+}
+
+template< typename T >
+typename result_of::unit_lower< const T >::type unit_lower( const T& underlying ) {
+ return typename result_of::unit_lower< const T >::type( underlying );
+}
+
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/unit_upper.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/unit_upper.hpp 2010-01-05 02:27:15 EST (Tue, 05 Jan 2010)
@@ -0,0 +1,45 @@
+//
+// Copyright (c) 2009 Rutger ter Borg
+//
+// 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_NUMERIC_BINDINGS_UNIT_UPPER_HPP
+#define BOOST_NUMERIC_BINDINGS_UNIT_UPPER_HPP
+
+#include <boost/numeric/bindings/detail/basic_wrapper.hpp>
+#include <boost/numeric/bindings/tag.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace result_of {
+
+template< typename T >
+struct unit_upper {
+ typedef detail::basic_wrapper<
+ T,
+ mpl::pair< tag::matrix_type, tag::unit_triangular >,
+ mpl::pair< tag::data_side, tag::upper >
+ > type;
+};
+
+} // namespace result_of
+
+template< typename T >
+typename result_of::unit_upper< T >::type unit_upper( T& underlying ) {
+ return typename result_of::unit_upper< T >::type( underlying );
+}
+
+template< typename T >
+typename result_of::unit_upper< const T >::type unit_upper( const T& underlying ) {
+ return typename result_of::unit_upper< const T >::type( underlying );
+}
+
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/upper.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/upper.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/upper.hpp 2010-01-05 02:27:15 EST (Tue, 05 Jan 2010)
@@ -9,51 +9,33 @@
 #ifndef BOOST_NUMERIC_BINDINGS_UPPER_HPP
 #define BOOST_NUMERIC_BINDINGS_UPPER_HPP
 
-#include <boost/numeric/bindings/detail/adaptor.hpp>
-#include <boost/numeric/bindings/detail/basic_unwrapper.hpp>
+#include <boost/numeric/bindings/detail/basic_wrapper.hpp>
 #include <boost/numeric/bindings/tag.hpp>
 
 namespace boost {
 namespace numeric {
 namespace bindings {
-
-namespace detail {
-
-template< typename T >
-struct upper_wrapper: reference_wrapper<T> {
- upper_wrapper( T& t ): reference_wrapper<T>( t ) {}
-};
-
-template< typename T, typename Id, typename Enable >
-struct adaptor< upper_wrapper<T>, Id, Enable >:
- basic_unwrapper< T, Id > {
-
- typedef typename property_insert< T,
- mpl::pair< tag::matrix_type, tag::triangular >,
- mpl::pair< tag::data_side, tag::upper >
- >::type property_map;
-
-};
-
-} // namespace detail
-
 namespace result_of {
 
 template< typename T >
 struct upper {
- typedef detail::upper_wrapper<T> type;
+ typedef detail::basic_wrapper<
+ T,
+ mpl::pair< tag::matrix_type, tag::triangular >,
+ mpl::pair< tag::data_side, tag::upper >
+ > type;
 };
 
 } // namespace result_of
 
 template< typename T >
-detail::upper_wrapper<T> upper( T& underlying ) {
- return detail::upper_wrapper<T>( underlying );
+typename result_of::upper< T >::type upper( T& underlying ) {
+ return typename result_of::upper< T >::type( underlying );
 }
 
 template< typename T >
-detail::upper_wrapper<const T> upper( const T& underlying ) {
- return detail::upper_wrapper<const T>( underlying );
+typename result_of::upper< const T >::type upper( const T& underlying ) {
+ return typename result_of::upper< const T >::type( underlying );
 }
 
 } // namespace bindings


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