Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58514 - sandbox/numeric_bindings/boost/numeric/bindings
From: rutger_at_[hidden]
Date: 2009-12-23 10:03:18


Author: rutger
Date: 2009-12-23 10:03:16 EST (Wed, 23 Dec 2009)
New Revision: 58514
URL: http://svn.boost.org/trac/boost/changeset/58514

Log:
added data_side and diag_tag (meta) functions

Added:
   sandbox/numeric_bindings/boost/numeric/bindings/data_side.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/diag_tag.hpp (contents, props changed)

Added: sandbox/numeric_bindings/boost/numeric/bindings/data_side.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/data_side.hpp 2009-12-23 10:03:16 EST (Wed, 23 Dec 2009)
@@ -0,0 +1,35 @@
+//
+// Copyright (c) 2009 by 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_DATA_SIDE_HPP
+#define BOOST_NUMERIC_BINDINGS_DATA_SIDE_HPP
+
+#include <boost/numeric/bindings/detail/property_map.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace result_of {
+
+template< typename T >
+struct data_side {
+ typedef typename detail::property_at< T, tag::data_side >::type type;
+};
+
+} // namespace result_of
+
+template< typename T >
+typename result_of::data_side<T>::type data_side( const T& ) {
+ return result_of::data_side<T>::type();
+}
+
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/diag_tag.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/diag_tag.hpp 2009-12-23 10:03:16 EST (Wed, 23 Dec 2009)
@@ -0,0 +1,70 @@
+//
+// 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_DIAG_TAG_HPP
+#define BOOST_NUMERIC_BINDINGS_DIAG_TAG_HPP
+
+#include <boost/numeric/bindings/tag.hpp>
+#include <boost/numeric/bindings/detail/property_map.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+
+namespace detail {
+
+template< typename T >
+struct diag_tag_impl {
+};
+
+template<>
+struct diag_tag_impl< tag::upper > {
+ typedef tag::non_unit type;
+};
+
+template<>
+struct diag_tag_impl< tag::lower > {
+ typedef tag::non_unit type;
+};
+
+template<>
+struct diag_tag_impl< tag::unit_upper > {
+ typedef tag::unit type;
+};
+
+template<>
+struct diag_tag_impl< tag::unit_lower > {
+ typedef tag::unit type;
+};
+
+} // namespace detail
+
+namespace result_of {
+
+template< typename T >
+struct diag_tag {
+ typedef typename detail::diag_tag_impl<
+ typename detail::property_at< T, tag::matrix_side >::type
+ >::type type;
+};
+
+} // namespace result_of
+
+//
+// diag_tag will output tags that are compatible with BLAS and LAPACK
+//
+template< typename T, typename Order >
+typename result_of::diag_tag< T >::type diag_tag( const T& t ) {
+ return result_of::diag_tag< T >::type();
+}
+
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif


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