|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59025 - in sandbox/numeric_bindings/boost/numeric/bindings/blas: . level1
From: rutger_at_[hidden]
Date: 2010-01-15 04:29:18
Author: rutger
Date: 2010-01-15 04:29:12 EST (Fri, 15 Jan 2010)
New Revision: 59025
URL: http://svn.boost.org/trac/boost/changeset/59025
Log:
Added blas level1 extension set, defaulting to a bindings C++ implementation. For compatibility with earlier ATLAS stuff.
Added:
sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/set.hpp (contents, props changed)
Text files modified:
sandbox/numeric_bindings/boost/numeric/bindings/blas/level1.hpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1.hpp 2010-01-15 04:29:12 EST (Fri, 15 Jan 2010)
@@ -23,7 +23,7 @@
#include <boost/numeric/bindings/blas/level1/rotm.hpp>
#include <boost/numeric/bindings/blas/level1/scal.hpp>
#include <boost/numeric/bindings/blas/level1/sdot.hpp>
-#include <boost/numeric/bindings/blas/level1/srot.hpp>
+#include <boost/numeric/bindings/blas/level1/set.hpp>
#include <boost/numeric/bindings/blas/level1/swap.hpp>
#endif
Added: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/set.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/set.hpp 2010-01-15 04:29:12 EST (Fri, 15 Jan 2010)
@@ -0,0 +1,62 @@
+//
+// Copyright (c) 2002--2010
+// Toon Knapen, Karl Meerbergen, Kresimir Fresl,
+// Thomas Klimpel and 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_BLAS_LEVEL1_EXT_SET_HPP
+#define BOOST_NUMERIC_BINDINGS_BLAS_LEVEL1_EXT_SET_HPP
+
+#include <boost/assert.hpp>
+#include <boost/numeric/bindings/begin.hpp>
+#include <boost/numeric/bindings/end.hpp>
+#include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/value.hpp>
+#include <boost/static_assert.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace blas {
+
+//
+// set is an extension, not part of the BLAS API.
+//
+// TODO implement ATLAS backend call(s)
+//
+// Functions for direct use. These functions are overloaded for temporaries,
+// so that wrapped types can still be passed and used for write-access.
+//
+
+//
+// Overloaded function for set. Its overload differs for
+// * VectorX&
+//
+template< typename VectorX >
+inline void
+set( typename value< VectorX >::type a, VectorX& x ) {
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorX >::value) );
+ std::fill( bindings::begin(x), bindings::end(x), a );
+}
+
+//
+// Overloaded function for set. Its overload differs for
+// * const VectorX&
+//
+template< typename VectorX >
+inline void
+set( typename value< VectorX >::type a, const VectorX& x ) {
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< const VectorX >::value) );
+ std::fill( bindings::begin(x), bindings::end(x), a );
+}
+
+} // namespace blas
+} // 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