|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58688 - sandbox/numeric_bindings/boost/numeric/bindings
From: rutger_at_[hidden]
Date: 2010-01-04 15:43:38
Author: rutger
Date: 2010-01-04 15:43:38 EST (Mon, 04 Jan 2010)
New Revision: 58688
URL: http://svn.boost.org/trac/boost/changeset/58688
Log:
Added meta(function) for conjugate transpose, conj()
Added:
sandbox/numeric_bindings/boost/numeric/bindings/conj.hpp (contents, props changed)
Added: sandbox/numeric_bindings/boost/numeric/bindings/conj.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/conj.hpp 2010-01-04 15:43:38 EST (Mon, 04 Jan 2010)
@@ -0,0 +1,48 @@
+//
+// 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_CONJ_HPP
+#define BOOST_NUMERIC_BINDINGS_CONJ_HPP
+
+#include <boost/numeric/bindings/trans.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+
+namespace result_of {
+
+template< typename T >
+struct conj {
+ typedef detail::trans_wrapper<
+ T,
+ typename mpl::if_<
+ detail::is_same_at< T, tag::value_transform, tag::conjugate >,
+ mpl::pair< tag::value_transform, mpl::void_ >,
+ mpl::pair< tag::value_transform, tag::conjugate >
+ >::type
+ > type;
+};
+
+}
+
+template< typename T >
+typename result_of::conj< T >::type conj( T& t ) {
+ return typename result_of::conj< T >::type( t );
+}
+
+template< typename T >
+typename result_of::conj< const T >::type conj( const T& t ) {
+ return typename result_of::conj< const T >::type( t );
+}
+
+} // 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