Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63071 - in sandbox/numeric_bindings/boost/numeric/bindings/lapack: . detail driver
From: thomas.klimpel_at_[hidden]
Date: 2010-06-17 20:06:10


Author: klimpel
Date: 2010-06-17 20:06:08 EDT (Thu, 17 Jun 2010)
New Revision: 63071
URL: http://svn.boost.org/trac/boost/changeset/63071

Log:
regenerated iter_gesv.hpp and iter_posv.hpp (swork still has the wrong precision type, so it's not yet functional)
Added:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/iter_gesv.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/iter_posv.hpp (contents, props changed)
Removed:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/cgesv.hpp
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/cposv.hpp
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/sgesv.hpp
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/sposv.hpp
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/detail/lapack.h | 52 ++++++++++++++++++---------------------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/detail/lapack_names.h | 20 ++++++---------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver.hpp | 6 +---
   3 files changed, 34 insertions(+), 44 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/detail/lapack.h
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/detail/lapack.h (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/detail/lapack.h 2010-06-17 20:06:08 EDT (Thu, 17 Jun 2010)
@@ -3011,20 +3011,6 @@
         const fortran_int_t* ldb, void* c, void* d, void* x, void* work,
         const fortran_int_t* lwork, fortran_int_t* info );
 
-// Value-type variants of cgesv
-void LAPACK_ZCGESV( const fortran_int_t* n, const fortran_int_t* nrhs,
- void* a, const fortran_int_t* lda, fortran_int_t* ipiv, const void* b,
- const fortran_int_t* ldb, void* x, const fortran_int_t* ldx,
- void* work, void* swork, double* rwork, fortran_int_t* iter,
- fortran_int_t* info );
-
-// Value-type variants of cposv
-void LAPACK_ZCPOSV( const char* uplo, const fortran_int_t* n,
- const fortran_int_t* nrhs, void* a, const fortran_int_t* lda,
- const void* b, const fortran_int_t* ldb, void* x,
- const fortran_int_t* ldx, void* work, void* swork, double* rwork,
- fortran_int_t* iter, fortran_int_t* info );
-
 // Value-type variants of gbsv
 void LAPACK_SGBSV( const fortran_int_t* n, const fortran_int_t* kl,
         const fortran_int_t* ku, const fortran_int_t* nrhs, float* ab,
@@ -3229,6 +3215,30 @@
         double* rcond, double* ferr, double* berr, void* work, double* rwork,
         fortran_int_t* info );
 
+// Value-type variants of iter_gesv
+void LAPACK_DSGESV( const fortran_int_t* n, const fortran_int_t* nrhs,
+ double* a, const fortran_int_t* lda, fortran_int_t* ipiv,
+ const double* b, const fortran_int_t* ldb, double* x,
+ const fortran_int_t* ldx, double* work, float* swork,
+ fortran_int_t* iter, fortran_int_t* info );
+void LAPACK_ZCGESV( const fortran_int_t* n, const fortran_int_t* nrhs,
+ void* a, const fortran_int_t* lda, fortran_int_t* ipiv, const void* b,
+ const fortran_int_t* ldb, void* x, const fortran_int_t* ldx,
+ void* work, void* swork, double* rwork, fortran_int_t* iter,
+ fortran_int_t* info );
+
+// Value-type variants of iter_posv
+void LAPACK_DSPOSV( const char* uplo, const fortran_int_t* n,
+ const fortran_int_t* nrhs, double* a, const fortran_int_t* lda,
+ const double* b, const fortran_int_t* ldb, double* x,
+ const fortran_int_t* ldx, double* work, float* swork,
+ fortran_int_t* iter, fortran_int_t* info );
+void LAPACK_ZCPOSV( const char* uplo, const fortran_int_t* n,
+ const fortran_int_t* nrhs, void* a, const fortran_int_t* lda,
+ const void* b, const fortran_int_t* ldb, void* x,
+ const fortran_int_t* ldx, void* work, void* swork, double* rwork,
+ fortran_int_t* iter, fortran_int_t* info );
+
 // Value-type variants of pbsv
 void LAPACK_SPBSV( const char* uplo, const fortran_int_t* n,
         const fortran_int_t* kd, const fortran_int_t* nrhs, float* ab,
@@ -3391,20 +3401,6 @@
         const fortran_int_t* ldx, double* rcond, double* ferr, double* berr,
         void* work, double* rwork, fortran_int_t* info );
 
-// Value-type variants of sgesv
-void LAPACK_DSGESV( const fortran_int_t* n, const fortran_int_t* nrhs,
- double* a, const fortran_int_t* lda, fortran_int_t* ipiv,
- const double* b, const fortran_int_t* ldb, double* x,
- const fortran_int_t* ldx, double* work, float* swork,
- fortran_int_t* iter, fortran_int_t* info );
-
-// Value-type variants of sposv
-void LAPACK_DSPOSV( const char* uplo, const fortran_int_t* n,
- const fortran_int_t* nrhs, double* a, const fortran_int_t* lda,
- const double* b, const fortran_int_t* ldb, double* x,
- const fortran_int_t* ldx, double* work, float* swork,
- fortran_int_t* iter, fortran_int_t* info );
-
 // Value-type variants of spsv
 void LAPACK_SSPSV( const char* uplo, const fortran_int_t* n,
         const fortran_int_t* nrhs, float* ap, fortran_int_t* ipiv, float* b,

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/detail/lapack_names.h
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/detail/lapack_names.h (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/detail/lapack_names.h 2010-06-17 20:06:08 EDT (Thu, 17 Jun 2010)
@@ -994,12 +994,6 @@
 #define LAPACK_CGGLSE FORTRAN_ID( cgglse )
 #define LAPACK_ZGGLSE FORTRAN_ID( zgglse )
 
-// Value-type variants of cgesv
-#define LAPACK_ZCGESV FORTRAN_ID( zcgesv )
-
-// Value-type variants of cposv
-#define LAPACK_ZCPOSV FORTRAN_ID( zcposv )
-
 // Value-type variants of gbsv
 #define LAPACK_SGBSV FORTRAN_ID( sgbsv )
 #define LAPACK_DGBSV FORTRAN_ID( dgbsv )
@@ -1056,6 +1050,14 @@
 #define LAPACK_CHPSVX FORTRAN_ID( chpsvx )
 #define LAPACK_ZHPSVX FORTRAN_ID( zhpsvx )
 
+// Value-type variants of iter_gesv
+#define LAPACK_DSGESV FORTRAN_ID( dsgesv )
+#define LAPACK_ZCGESV FORTRAN_ID( zcgesv )
+
+// Value-type variants of iter_posv
+#define LAPACK_DSPOSV FORTRAN_ID( dsposv )
+#define LAPACK_ZCPOSV FORTRAN_ID( zcposv )
+
 // Value-type variants of pbsv
 #define LAPACK_SPBSV FORTRAN_ID( spbsv )
 #define LAPACK_DPBSV FORTRAN_ID( dpbsv )
@@ -1104,12 +1106,6 @@
 #define LAPACK_CPTSVX FORTRAN_ID( cptsvx )
 #define LAPACK_ZPTSVX FORTRAN_ID( zptsvx )
 
-// Value-type variants of sgesv
-#define LAPACK_DSGESV FORTRAN_ID( dsgesv )
-
-// Value-type variants of sposv
-#define LAPACK_DSPOSV FORTRAN_ID( dsposv )
-
 // Value-type variants of spsv
 #define LAPACK_SSPSV FORTRAN_ID( sspsv )
 #define LAPACK_DSPSV FORTRAN_ID( dspsv )

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver.hpp 2010-06-17 20:06:08 EDT (Thu, 17 Jun 2010)
@@ -42,8 +42,6 @@
 #include <boost/numeric/bindings/lapack/driver/sygvx.hpp>
 #include <boost/numeric/bindings/lapack/driver/ggglm.hpp>
 #include <boost/numeric/bindings/lapack/driver/gglse.hpp>
-#include <boost/numeric/bindings/lapack/driver/cgesv.hpp>
-#include <boost/numeric/bindings/lapack/driver/cposv.hpp>
 #include <boost/numeric/bindings/lapack/driver/gbsv.hpp>
 #include <boost/numeric/bindings/lapack/driver/gbsvx.hpp>
 #include <boost/numeric/bindings/lapack/driver/gejsv.hpp>
@@ -55,6 +53,8 @@
 #include <boost/numeric/bindings/lapack/driver/hesvx.hpp>
 #include <boost/numeric/bindings/lapack/driver/hpsv.hpp>
 #include <boost/numeric/bindings/lapack/driver/hpsvx.hpp>
+#include <boost/numeric/bindings/lapack/driver/iter_gesv.hpp>
+#include <boost/numeric/bindings/lapack/driver/iter_posv.hpp>
 #include <boost/numeric/bindings/lapack/driver/pbsv.hpp>
 #include <boost/numeric/bindings/lapack/driver/pbsvx.hpp>
 #include <boost/numeric/bindings/lapack/driver/posv.hpp>
@@ -63,8 +63,6 @@
 #include <boost/numeric/bindings/lapack/driver/ppsvx.hpp>
 #include <boost/numeric/bindings/lapack/driver/ptsv.hpp>
 #include <boost/numeric/bindings/lapack/driver/ptsvx.hpp>
-#include <boost/numeric/bindings/lapack/driver/sgesv.hpp>
-#include <boost/numeric/bindings/lapack/driver/sposv.hpp>
 #include <boost/numeric/bindings/lapack/driver/spsv.hpp>
 #include <boost/numeric/bindings/lapack/driver/spsvx.hpp>
 #include <boost/numeric/bindings/lapack/driver/sysv.hpp>

Deleted: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/cgesv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/cgesv.hpp 2010-06-17 20:06:08 EDT (Thu, 17 Jun 2010)
+++ (empty file)
@@ -1,494 +0,0 @@
-//
-// 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)
-//
-// THIS FILE IS AUTOMATICALLY GENERATED
-// PLEASE DO NOT EDIT!
-//
-
-#ifndef BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_CGESV_HPP
-#define BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_CGESV_HPP
-
-#include <boost/assert.hpp>
-#include <boost/numeric/bindings/begin.hpp>
-#include <boost/numeric/bindings/detail/array.hpp>
-#include <boost/numeric/bindings/is_column_major.hpp>
-#include <boost/numeric/bindings/is_mutable.hpp>
-#include <boost/numeric/bindings/lapack/workspace.hpp>
-#include <boost/numeric/bindings/remove_imaginary.hpp>
-#include <boost/numeric/bindings/size.hpp>
-#include <boost/numeric/bindings/stride.hpp>
-#include <boost/numeric/bindings/value_type.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/remove_const.hpp>
-
-//
-// The LAPACK-backend for cgesv is the netlib-compatible backend.
-//
-#include <boost/numeric/bindings/lapack/detail/lapack.h>
-#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace lapack {
-
-//
-// The detail namespace contains value-type-overloaded functions that
-// dispatch to the appropriate back-end LAPACK-routine.
-//
-namespace detail {
-
-//
-// Overloaded function for dispatching to
-// * netlib-compatible LAPACK backend (the default), and
-// * complex<double> value-type.
-//
-inline std::ptrdiff_t cgesv( const fortran_int_t n, const fortran_int_t nrhs,
- std::complex<double>* a, const fortran_int_t lda, fortran_int_t* ipiv,
- const std::complex<double>* b, const fortran_int_t ldb,
- std::complex<double>* x, const fortran_int_t ldx,
- std::complex<double>* work, std::complex<float>* swork, double* rwork,
- fortran_int_t& iter ) {
- fortran_int_t info(0);
- LAPACK_ZCGESV( &n, &nrhs, a, &lda, ipiv, b, &ldb, x, &ldx, work, swork,
- rwork, &iter, &info );
- return info;
-}
-
-} // namespace detail
-
-//
-// Value-type based template class. Use this class if you need a type
-// for dispatching to cgesv.
-//
-template< typename Value >
-struct cgesv_impl {
-
- typedef Value value_type;
- typedef typename remove_imaginary< Value >::type real_type;
-
- //
- // Static member function for user-defined workspaces, that
- // * Deduces the required arguments for dispatching to LAPACK, and
- // * Asserts that most arguments make sense.
- //
- template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename WORK, typename SWORK, typename RWORK >
- static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
- const MatrixB& b, MatrixX& x, fortran_int_t& iter,
- detail::workspace3< WORK, SWORK, RWORK > work ) {
- namespace bindings = ::boost::numeric::bindings;
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
- BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
- typename bindings::value_type< MatrixA >::type >::type,
- typename remove_const< typename bindings::value_type<
- MatrixB >::type >::type >::value) );
- BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
- typename bindings::value_type< MatrixA >::type >::type,
- typename remove_const< typename bindings::value_type<
- MatrixX >::type >::type >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIPIV >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
- BOOST_ASSERT( bindings::size(ipiv) >= bindings::stride_major(work) );
- BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_rwork( bindings::stride_major(work) ));
- BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_swork( bindings::stride_major(work),
- bindings::size_column(b) ));
- BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
- BOOST_ASSERT( bindings::size_column(b) >= 0 );
- BOOST_ASSERT( bindings::size_minor(a) == 1 ||
- bindings::stride_minor(a) == 1 );
- BOOST_ASSERT( bindings::size_minor(b) == 1 ||
- bindings::stride_minor(b) == 1 );
- BOOST_ASSERT( bindings::size_minor(x) == 1 ||
- bindings::stride_minor(x) == 1 );
- BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- BOOST_ASSERT( bindings::stride_major(work) >= 0 );
- BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- return detail::cgesv( bindings::stride_major(work),
- bindings::size_column(b), bindings::begin_value(a),
- bindings::stride_major(a), bindings::begin_value(ipiv),
- bindings::begin_value(b), bindings::stride_major(b),
- bindings::begin_value(x), bindings::stride_major(x),
- bindings::begin_value(work),
- bindings::begin_value(work.select(value_type())),
- bindings::begin_value(work.select(real_type())), iter );
- }
-
- //
- // Static member function that
- // * Figures out the minimal workspace requirements, and passes
- // the results to the user-defined workspace overload of the
- // invoke static member function
- // * Enables the unblocked algorithm (BLAS level 2)
- //
- template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
- static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
- const MatrixB& b, MatrixX& x, fortran_int_t& iter,
- minimal_workspace work ) {
- namespace bindings = ::boost::numeric::bindings;
- bindings::detail::array< value_type > tmp_work( min_size_work(
- $CALL_MIN_SIZE ) );
- bindings::detail::array< value_type > tmp_swork( min_size_swork(
- bindings::stride_major(work), bindings::size_column(b) ) );
- bindings::detail::array< real_type > tmp_rwork( min_size_rwork(
- bindings::stride_major(work) ) );
- return invoke( a, ipiv, b, x, iter, workspace( tmp_work, tmp_swork,
- tmp_rwork ) );
- }
-
- //
- // Static member function that
- // * Figures out the optimal workspace requirements, and passes
- // the results to the user-defined workspace overload of the
- // invoke static member
- // * Enables the blocked algorithm (BLAS level 3)
- //
- template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
- static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
- const MatrixB& b, MatrixX& x, fortran_int_t& iter,
- optimal_workspace work ) {
- namespace bindings = ::boost::numeric::bindings;
- return invoke( a, ipiv, b, x, iter, minimal_workspace() );
- }
-
- //
- // Static member function that returns the minimum size of
- // workspace-array work.
- //
- template< $TYPES >
- static std::ptrdiff_t min_size_work( $ARGUMENTS ) {
- return n*nrhs;
- }
-
- //
- // Static member function that returns the minimum size of
- // workspace-array swork.
- //
- static std::ptrdiff_t min_size_swork( const std::ptrdiff_t n,
- const std::ptrdiff_t nrhs ) {
- return n*(n+nrhs);
- }
-
- //
- // Static member function that returns the minimum size of
- // workspace-array rwork.
- //
- static std::ptrdiff_t min_size_rwork( const std::ptrdiff_t n ) {
- return n;
- }
-};
-
-
-//
-// Functions for direct use. These functions are overloaded for temporaries,
-// so that wrapped types can still be passed and used for write-access. In
-// addition, if applicable, they are overloaded for user-defined workspaces.
-// Calls to these functions are passed to the cgesv_impl classes. In the
-// documentation, most overloads are collapsed to avoid a large number of
-// prototypes which are very similar.
-//
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * MatrixA&
-// * VectorIPIV&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cgesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * MatrixA&
-// * VectorIPIV&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cgesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * const MatrixA&
-// * VectorIPIV&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cgesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * const MatrixA&
-// * VectorIPIV&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cgesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * MatrixA&
-// * const VectorIPIV&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cgesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * MatrixA&
-// * const VectorIPIV&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cgesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * const MatrixA&
-// * const VectorIPIV&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cgesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- MatrixX& x, fortran_int_t& iter, Workspace work ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * const MatrixA&
-// * const VectorIPIV&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cgesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- MatrixX& x, fortran_int_t& iter ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * MatrixA&
-// * VectorIPIV&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cgesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * MatrixA&
-// * VectorIPIV&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cgesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * const MatrixA&
-// * VectorIPIV&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cgesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter, Workspace work ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * const MatrixA&
-// * VectorIPIV&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cgesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * MatrixA&
-// * const VectorIPIV&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cgesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter, Workspace work ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * MatrixA&
-// * const VectorIPIV&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cgesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * const MatrixA&
-// * const VectorIPIV&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cgesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter, Workspace work ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for cgesv. Its overload differs for
-// * const MatrixA&
-// * const VectorIPIV&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cgesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter ) {
- return cgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-} // namespace lapack
-} // namespace bindings
-} // namespace numeric
-} // namespace boost
-
-#endif

Deleted: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/cposv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/cposv.hpp 2010-06-17 20:06:08 EDT (Thu, 17 Jun 2010)
+++ (empty file)
@@ -1,336 +0,0 @@
-//
-// 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)
-//
-// THIS FILE IS AUTOMATICALLY GENERATED
-// PLEASE DO NOT EDIT!
-//
-
-#ifndef BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_CPOSV_HPP
-#define BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_CPOSV_HPP
-
-#include <boost/assert.hpp>
-#include <boost/numeric/bindings/begin.hpp>
-#include <boost/numeric/bindings/detail/array.hpp>
-#include <boost/numeric/bindings/is_column_major.hpp>
-#include <boost/numeric/bindings/is_mutable.hpp>
-#include <boost/numeric/bindings/lapack/workspace.hpp>
-#include <boost/numeric/bindings/remove_imaginary.hpp>
-#include <boost/numeric/bindings/size.hpp>
-#include <boost/numeric/bindings/stride.hpp>
-#include <boost/numeric/bindings/uplo_tag.hpp>
-#include <boost/numeric/bindings/value_type.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/remove_const.hpp>
-
-//
-// The LAPACK-backend for cposv is the netlib-compatible backend.
-//
-#include <boost/numeric/bindings/lapack/detail/lapack.h>
-#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace lapack {
-
-//
-// The detail namespace contains value-type-overloaded functions that
-// dispatch to the appropriate back-end LAPACK-routine.
-//
-namespace detail {
-
-//
-// Overloaded function for dispatching to
-// * netlib-compatible LAPACK backend (the default), and
-// * complex<double> value-type.
-//
-template< typename UpLo >
-inline std::ptrdiff_t cposv( const UpLo uplo, const fortran_int_t n,
- const fortran_int_t nrhs, std::complex<double>* a,
- const fortran_int_t lda, const std::complex<double>* b,
- const fortran_int_t ldb, std::complex<double>* x,
- const fortran_int_t ldx, std::complex<double>* work,
- std::complex<float>* swork, double* rwork, fortran_int_t& iter ) {
- fortran_int_t info(0);
- LAPACK_ZCPOSV( &lapack_option< UpLo >::value, &n, &nrhs, a, &lda, b, &ldb,
- x, &ldx, work, swork, rwork, &iter, &info );
- return info;
-}
-
-} // namespace detail
-
-//
-// Value-type based template class. Use this class if you need a type
-// for dispatching to cposv.
-//
-template< typename Value >
-struct cposv_impl {
-
- typedef Value value_type;
- typedef typename remove_imaginary< Value >::type real_type;
-
- //
- // Static member function for user-defined workspaces, that
- // * Deduces the required arguments for dispatching to LAPACK, and
- // * Asserts that most arguments make sense.
- //
- template< typename MatrixA, typename MatrixB, typename MatrixX,
- typename WORK, typename SWORK, typename RWORK >
- static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, detail::workspace3< WORK, SWORK,
- RWORK > work ) {
- namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::uplo_tag< MatrixA >::type uplo;
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
- BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
- typename bindings::value_type< MatrixA >::type >::type,
- typename remove_const< typename bindings::value_type<
- MatrixB >::type >::type >::value) );
- BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
- typename bindings::value_type< MatrixA >::type >::type,
- typename remove_const< typename bindings::value_type<
- MatrixX >::type >::type >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
- BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_rwork( bindings::stride_major(work) ));
- BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_swork( bindings::stride_major(work),
- bindings::size_column(b) ));
- BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
- BOOST_ASSERT( bindings::size_column(b) >= 0 );
- BOOST_ASSERT( bindings::size_minor(a) == 1 ||
- bindings::stride_minor(a) == 1 );
- BOOST_ASSERT( bindings::size_minor(b) == 1 ||
- bindings::stride_minor(b) == 1 );
- BOOST_ASSERT( bindings::size_minor(x) == 1 ||
- bindings::stride_minor(x) == 1 );
- BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- BOOST_ASSERT( bindings::stride_major(work) >= 0 );
- BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- return detail::cposv( uplo(), bindings::stride_major(work),
- bindings::size_column(b), bindings::begin_value(a),
- bindings::stride_major(a), bindings::begin_value(b),
- bindings::stride_major(b), bindings::begin_value(x),
- bindings::stride_major(x), bindings::begin_value(work),
- bindings::begin_value(work.select(value_type())),
- bindings::begin_value(work.select(real_type())), iter );
- }
-
- //
- // Static member function that
- // * Figures out the minimal workspace requirements, and passes
- // the results to the user-defined workspace overload of the
- // invoke static member function
- // * Enables the unblocked algorithm (BLAS level 2)
- //
- template< typename MatrixA, typename MatrixB, typename MatrixX >
- static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, minimal_workspace work ) {
- namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::uplo_tag< MatrixA >::type uplo;
- bindings::detail::array< value_type > tmp_work( min_size_work(
- $CALL_MIN_SIZE ) );
- bindings::detail::array< value_type > tmp_swork( min_size_swork(
- bindings::stride_major(work), bindings::size_column(b) ) );
- bindings::detail::array< real_type > tmp_rwork( min_size_rwork(
- bindings::stride_major(work) ) );
- return invoke( a, b, x, iter, workspace( tmp_work, tmp_swork,
- tmp_rwork ) );
- }
-
- //
- // Static member function that
- // * Figures out the optimal workspace requirements, and passes
- // the results to the user-defined workspace overload of the
- // invoke static member
- // * Enables the blocked algorithm (BLAS level 3)
- //
- template< typename MatrixA, typename MatrixB, typename MatrixX >
- static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, optimal_workspace work ) {
- namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::uplo_tag< MatrixA >::type uplo;
- return invoke( a, b, x, iter, minimal_workspace() );
- }
-
- //
- // Static member function that returns the minimum size of
- // workspace-array work.
- //
- template< $TYPES >
- static std::ptrdiff_t min_size_work( $ARGUMENTS ) {
- $MIN_SIZE_IMPLEMENTATION
- }
-
- //
- // Static member function that returns the minimum size of
- // workspace-array swork.
- //
- static std::ptrdiff_t min_size_swork( const std::ptrdiff_t n,
- const std::ptrdiff_t nrhs ) {
- return n*(n+nrhs);
- }
-
- //
- // Static member function that returns the minimum size of
- // workspace-array rwork.
- //
- static std::ptrdiff_t min_size_rwork( const std::ptrdiff_t n ) {
- return n;
- }
-};
-
-
-//
-// Functions for direct use. These functions are overloaded for temporaries,
-// so that wrapped types can still be passed and used for write-access. In
-// addition, if applicable, they are overloaded for user-defined workspaces.
-// Calls to these functions are passed to the cposv_impl classes. In the
-// documentation, most overloads are collapsed to avoid a large number of
-// prototypes which are very similar.
-//
-
-//
-// Overloaded function for cposv. Its overload differs for
-// * MatrixA&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX,
- typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cposv( MatrixA& a, const MatrixB& b, MatrixX& x, fortran_int_t& iter,
- Workspace work ) {
- return cposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, work );
-}
-
-//
-// Overloaded function for cposv. Its overload differs for
-// * MatrixA&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cposv( MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter ) {
- return cposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
-}
-
-//
-// Overloaded function for cposv. Its overload differs for
-// * const MatrixA&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX,
- typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cposv( const MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return cposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, work );
-}
-
-//
-// Overloaded function for cposv. Its overload differs for
-// * const MatrixA&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cposv( const MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter ) {
- return cposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
-}
-
-//
-// Overloaded function for cposv. Its overload differs for
-// * MatrixA&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX,
- typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cposv( MatrixA& a, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return cposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, work );
-}
-
-//
-// Overloaded function for cposv. Its overload differs for
-// * MatrixA&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cposv( MatrixA& a, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter ) {
- return cposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
-}
-
-//
-// Overloaded function for cposv. Its overload differs for
-// * const MatrixA&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX,
- typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-cposv( const MatrixA& a, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return cposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, work );
-}
-
-//
-// Overloaded function for cposv. Its overload differs for
-// * const MatrixA&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-cposv( const MatrixA& a, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter ) {
- return cposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
-}
-
-} // namespace lapack
-} // namespace bindings
-} // namespace numeric
-} // namespace boost
-
-#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/iter_gesv.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/iter_gesv.hpp 2010-06-17 20:06:08 EDT (Thu, 17 Jun 2010)
@@ -0,0 +1,639 @@
+//
+// 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)
+//
+// THIS FILE IS AUTOMATICALLY GENERATED
+// PLEASE DO NOT EDIT!
+//
+
+#ifndef BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_ITER_GESV_HPP
+#define BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_ITER_GESV_HPP
+
+#include <boost/assert.hpp>
+#include <boost/numeric/bindings/begin.hpp>
+#include <boost/numeric/bindings/detail/array.hpp>
+#include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
+#include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
+#include <boost/numeric/bindings/lapack/workspace.hpp>
+#include <boost/numeric/bindings/remove_imaginary.hpp>
+#include <boost/numeric/bindings/size.hpp>
+#include <boost/numeric/bindings/stride.hpp>
+#include <boost/numeric/bindings/value_type.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
+
+//
+// The LAPACK-backend for iter_gesv is the netlib-compatible backend.
+//
+#include <boost/numeric/bindings/lapack/detail/lapack.h>
+#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace lapack {
+
+//
+// The detail namespace contains value-type-overloaded functions that
+// dispatch to the appropriate back-end LAPACK-routine.
+//
+namespace detail {
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+inline std::ptrdiff_t iter_gesv( const fortran_int_t n,
+ const fortran_int_t nrhs, double* a, const fortran_int_t lda,
+ fortran_int_t* ipiv, const double* b, const fortran_int_t ldb,
+ double* x, const fortran_int_t ldx, double* work, float* swork,
+ fortran_int_t& iter ) {
+ fortran_int_t info(0);
+ LAPACK_DSGESV( &n, &nrhs, a, &lda, ipiv, b, &ldb, x, &ldx, work, swork,
+ &iter, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * complex<double> value-type.
+//
+inline std::ptrdiff_t iter_gesv( const fortran_int_t n,
+ const fortran_int_t nrhs, std::complex<double>* a,
+ const fortran_int_t lda, fortran_int_t* ipiv,
+ const std::complex<double>* b, const fortran_int_t ldb,
+ std::complex<double>* x, const fortran_int_t ldx,
+ std::complex<double>* work, std::complex<float>* swork, double* rwork,
+ fortran_int_t& iter ) {
+ fortran_int_t info(0);
+ LAPACK_ZCGESV( &n, &nrhs, a, &lda, ipiv, b, &ldb, x, &ldx, work, swork,
+ rwork, &iter, &info );
+ return info;
+}
+
+} // namespace detail
+
+//
+// Value-type based template class. Use this class if you need a type
+// for dispatching to iter_gesv.
+//
+template< typename Value, typename Enable = void >
+struct iter_gesv_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct iter_gesv_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX, typename WORK, typename SWORK >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
+ const MatrixB& b, MatrixX& x, fortran_int_t& iter,
+ detail::workspace2< WORK, SWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixX >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIPIV >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
+ BOOST_ASSERT( bindings::size(ipiv) >= bindings::size_column(a) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_swork( bindings::size_column(a),
+ bindings::size_column(b) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(a),
+ bindings::size_column(b) ));
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_column(b) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::size_minor(x) == 1 ||
+ bindings::stride_minor(x) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ return detail::iter_gesv( bindings::size_column(a),
+ bindings::size_column(b), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(ipiv),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(x), bindings::stride_major(x),
+ bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(real_type())), iter );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
+ const MatrixB& b, MatrixX& x, fortran_int_t& iter,
+ minimal_workspace work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a), bindings::size_column(b) ) );
+ bindings::detail::array< real_type > tmp_swork( min_size_swork(
+ bindings::size_column(a), bindings::size_column(b) ) );
+ return invoke( a, ipiv, b, x, iter, workspace( tmp_work, tmp_swork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
+ const MatrixB& b, MatrixX& x, fortran_int_t& iter,
+ optimal_workspace work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ return invoke( a, ipiv, b, x, iter, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n,
+ const std::ptrdiff_t nrhs ) {
+ return n*nrhs;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array swork.
+ //
+ static std::ptrdiff_t min_size_swork( const std::ptrdiff_t n,
+ const std::ptrdiff_t nrhs ) {
+ return n*(n+nrhs);
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
+template< typename Value >
+struct iter_gesv_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX, typename WORK, typename SWORK, typename RWORK >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
+ const MatrixB& b, MatrixX& x, fortran_int_t& iter,
+ detail::workspace3< WORK, SWORK, RWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixX >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIPIV >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
+ BOOST_ASSERT( bindings::size(ipiv) >= bindings::size_column(a) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_rwork( bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size(work.select(value_type())) >=
+ min_size_swork( bindings::size_column(a),
+ bindings::size_column(b) ));
+ BOOST_ASSERT( bindings::size(work.select(value_type())) >=
+ min_size_work( bindings::size_column(a),
+ bindings::size_column(b) ));
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_column(b) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::size_minor(x) == 1 ||
+ bindings::stride_minor(x) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ return detail::iter_gesv( bindings::size_column(a),
+ bindings::size_column(b), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(ipiv),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(x), bindings::stride_major(x),
+ bindings::begin_value(work.select(value_type())),
+ bindings::begin_value(work.select(value_type())),
+ bindings::begin_value(work.select(real_type())), iter );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
+ const MatrixB& b, MatrixX& x, fortran_int_t& iter,
+ minimal_workspace work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ bindings::detail::array< value_type > tmp_work( min_size_work(
+ bindings::size_column(a), bindings::size_column(b) ) );
+ bindings::detail::array< value_type > tmp_swork( min_size_swork(
+ bindings::size_column(a), bindings::size_column(b) ) );
+ bindings::detail::array< real_type > tmp_rwork( min_size_rwork(
+ bindings::size_column(a) ) );
+ return invoke( a, ipiv, b, x, iter, workspace( tmp_work, tmp_swork,
+ tmp_rwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
+ const MatrixB& b, MatrixX& x, fortran_int_t& iter,
+ optimal_workspace work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ return invoke( a, ipiv, b, x, iter, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n,
+ const std::ptrdiff_t nrhs ) {
+ return n*nrhs;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array swork.
+ //
+ static std::ptrdiff_t min_size_swork( const std::ptrdiff_t n,
+ const std::ptrdiff_t nrhs ) {
+ return n*(n+nrhs);
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array rwork.
+ //
+ static std::ptrdiff_t min_size_rwork( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+
+//
+// Functions for direct use. These functions are overloaded for temporaries,
+// so that wrapped types can still be passed and used for write-access. In
+// addition, if applicable, they are overloaded for user-defined workspaces.
+// Calls to these functions are passed to the iter_gesv_impl classes. In the
+// documentation, most overloads are collapsed to avoid a large number of
+// prototypes which are very similar.
+//
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * MatrixA&
+// * VectorIPIV&
+// * MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_gesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter, Workspace work ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * MatrixA&
+// * VectorIPIV&
+// * MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_gesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter,
+ optimal_workspace() );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * const MatrixA&
+// * VectorIPIV&
+// * MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_gesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter, Workspace work ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * const MatrixA&
+// * VectorIPIV&
+// * MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_gesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter,
+ optimal_workspace() );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * MatrixA&
+// * const VectorIPIV&
+// * MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_gesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter, Workspace work ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * MatrixA&
+// * const VectorIPIV&
+// * MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_gesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter,
+ optimal_workspace() );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * const MatrixA&
+// * const VectorIPIV&
+// * MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_gesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
+ MatrixX& x, fortran_int_t& iter, Workspace work ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * const MatrixA&
+// * const VectorIPIV&
+// * MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_gesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
+ MatrixX& x, fortran_int_t& iter ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter,
+ optimal_workspace() );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * MatrixA&
+// * VectorIPIV&
+// * const MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_gesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, const MatrixX& x,
+ fortran_int_t& iter, Workspace work ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * MatrixA&
+// * VectorIPIV&
+// * const MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_gesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, const MatrixX& x,
+ fortran_int_t& iter ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter,
+ optimal_workspace() );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * const MatrixA&
+// * VectorIPIV&
+// * const MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_gesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b,
+ const MatrixX& x, fortran_int_t& iter, Workspace work ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * const MatrixA&
+// * VectorIPIV&
+// * const MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_gesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b,
+ const MatrixX& x, fortran_int_t& iter ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter,
+ optimal_workspace() );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * MatrixA&
+// * const VectorIPIV&
+// * const MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_gesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
+ const MatrixX& x, fortran_int_t& iter, Workspace work ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * MatrixA&
+// * const VectorIPIV&
+// * const MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_gesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
+ const MatrixX& x, fortran_int_t& iter ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter,
+ optimal_workspace() );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * const MatrixA&
+// * const VectorIPIV&
+// * const MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_gesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
+ const MatrixX& x, fortran_int_t& iter, Workspace work ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_gesv. Its overload differs for
+// * const MatrixA&
+// * const VectorIPIV&
+// * const MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_gesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
+ const MatrixX& x, fortran_int_t& iter ) {
+ return iter_gesv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, ipiv, b, x, iter,
+ optimal_workspace() );
+}
+
+} // namespace lapack
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/iter_posv.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/iter_posv.hpp 2010-06-17 20:06:08 EDT (Thu, 17 Jun 2010)
@@ -0,0 +1,478 @@
+//
+// 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)
+//
+// THIS FILE IS AUTOMATICALLY GENERATED
+// PLEASE DO NOT EDIT!
+//
+
+#ifndef BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_ITER_POSV_HPP
+#define BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_ITER_POSV_HPP
+
+#include <boost/assert.hpp>
+#include <boost/numeric/bindings/begin.hpp>
+#include <boost/numeric/bindings/detail/array.hpp>
+#include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
+#include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
+#include <boost/numeric/bindings/lapack/workspace.hpp>
+#include <boost/numeric/bindings/remove_imaginary.hpp>
+#include <boost/numeric/bindings/size.hpp>
+#include <boost/numeric/bindings/stride.hpp>
+#include <boost/numeric/bindings/uplo_tag.hpp>
+#include <boost/numeric/bindings/value_type.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
+
+//
+// The LAPACK-backend for iter_posv is the netlib-compatible backend.
+//
+#include <boost/numeric/bindings/lapack/detail/lapack.h>
+#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace lapack {
+
+//
+// The detail namespace contains value-type-overloaded functions that
+// dispatch to the appropriate back-end LAPACK-routine.
+//
+namespace detail {
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t iter_posv( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, double* a, const fortran_int_t lda,
+ const double* b, const fortran_int_t ldb, double* x,
+ const fortran_int_t ldx, double* work, float* swork,
+ fortran_int_t& iter ) {
+ fortran_int_t info(0);
+ LAPACK_DSPOSV( &lapack_option< UpLo >::value, &n, &nrhs, a, &lda, b, &ldb,
+ x, &ldx, work, swork, &iter, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * complex<double> value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t iter_posv( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, std::complex<double>* a,
+ const fortran_int_t lda, const std::complex<double>* b,
+ const fortran_int_t ldb, std::complex<double>* x,
+ const fortran_int_t ldx, std::complex<double>* work,
+ std::complex<float>* swork, double* rwork, fortran_int_t& iter ) {
+ fortran_int_t info(0);
+ LAPACK_ZCPOSV( &lapack_option< UpLo >::value, &n, &nrhs, a, &lda, b, &ldb,
+ x, &ldx, work, swork, rwork, &iter, &info );
+ return info;
+}
+
+} // namespace detail
+
+//
+// Value-type based template class. Use this class if you need a type
+// for dispatching to iter_posv.
+//
+template< typename Value, typename Enable = void >
+struct iter_posv_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct iter_posv_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename MatrixB, typename MatrixX,
+ typename WORK, typename SWORK >
+ static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter, detail::workspace2< WORK, SWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixX >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_swork( bindings::size_column(a),
+ bindings::size_column(b) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(a),
+ bindings::size_column(b) ));
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_column(b) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::size_minor(x) == 1 ||
+ bindings::stride_minor(x) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ return detail::iter_posv( uplo(), bindings::size_column(a),
+ bindings::size_column(b), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(b),
+ bindings::stride_major(b), bindings::begin_value(x),
+ bindings::stride_major(x),
+ bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(real_type())), iter );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename MatrixB, typename MatrixX >
+ static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter, minimal_workspace work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a), bindings::size_column(b) ) );
+ bindings::detail::array< real_type > tmp_swork( min_size_swork(
+ bindings::size_column(a), bindings::size_column(b) ) );
+ return invoke( a, b, x, iter, workspace( tmp_work, tmp_swork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename MatrixB, typename MatrixX >
+ static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter, optimal_workspace work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ return invoke( a, b, x, iter, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n,
+ const std::ptrdiff_t nrhs ) {
+ return n*nrhs;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array swork.
+ //
+ static std::ptrdiff_t min_size_swork( const std::ptrdiff_t n,
+ const std::ptrdiff_t nrhs ) {
+ return n*(n+nrhs);
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
+template< typename Value >
+struct iter_posv_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename MatrixB, typename MatrixX,
+ typename WORK, typename SWORK, typename RWORK >
+ static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter, detail::workspace3< WORK, SWORK,
+ RWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixX >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_rwork( bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size(work.select(value_type())) >=
+ min_size_swork( bindings::size_column(a),
+ bindings::size_column(b) ));
+ BOOST_ASSERT( bindings::size(work.select(value_type())) >=
+ min_size_work( bindings::size_column(a),
+ bindings::size_column(b) ));
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_column(b) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::size_minor(x) == 1 ||
+ bindings::stride_minor(x) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ return detail::iter_posv( uplo(), bindings::size_column(a),
+ bindings::size_column(b), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(b),
+ bindings::stride_major(b), bindings::begin_value(x),
+ bindings::stride_major(x),
+ bindings::begin_value(work.select(value_type())),
+ bindings::begin_value(work.select(value_type())),
+ bindings::begin_value(work.select(real_type())), iter );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename MatrixB, typename MatrixX >
+ static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter, minimal_workspace work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< value_type > tmp_work( min_size_work(
+ bindings::size_column(a), bindings::size_column(b) ) );
+ bindings::detail::array< value_type > tmp_swork( min_size_swork(
+ bindings::size_column(a), bindings::size_column(b) ) );
+ bindings::detail::array< real_type > tmp_rwork( min_size_rwork(
+ bindings::size_column(a) ) );
+ return invoke( a, b, x, iter, workspace( tmp_work, tmp_swork,
+ tmp_rwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename MatrixB, typename MatrixX >
+ static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter, optimal_workspace work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ return invoke( a, b, x, iter, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n,
+ const std::ptrdiff_t nrhs ) {
+ return n*nrhs;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array swork.
+ //
+ static std::ptrdiff_t min_size_swork( const std::ptrdiff_t n,
+ const std::ptrdiff_t nrhs ) {
+ return n*(n+nrhs);
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array rwork.
+ //
+ static std::ptrdiff_t min_size_rwork( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+
+//
+// Functions for direct use. These functions are overloaded for temporaries,
+// so that wrapped types can still be passed and used for write-access. In
+// addition, if applicable, they are overloaded for user-defined workspaces.
+// Calls to these functions are passed to the iter_posv_impl classes. In the
+// documentation, most overloads are collapsed to avoid a large number of
+// prototypes which are very similar.
+//
+
+//
+// Overloaded function for iter_posv. Its overload differs for
+// * MatrixA&
+// * MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename MatrixX,
+ typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_posv( MatrixA& a, const MatrixB& b, MatrixX& x, fortran_int_t& iter,
+ Workspace work ) {
+ return iter_posv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_posv. Its overload differs for
+// * MatrixA&
+// * MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_posv( MatrixA& a, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter ) {
+ return iter_posv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
+}
+
+//
+// Overloaded function for iter_posv. Its overload differs for
+// * const MatrixA&
+// * MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename MatrixX,
+ typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_posv( const MatrixA& a, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter, Workspace work ) {
+ return iter_posv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_posv. Its overload differs for
+// * const MatrixA&
+// * MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_posv( const MatrixA& a, const MatrixB& b, MatrixX& x,
+ fortran_int_t& iter ) {
+ return iter_posv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
+}
+
+//
+// Overloaded function for iter_posv. Its overload differs for
+// * MatrixA&
+// * const MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename MatrixX,
+ typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_posv( MatrixA& a, const MatrixB& b, const MatrixX& x,
+ fortran_int_t& iter, Workspace work ) {
+ return iter_posv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_posv. Its overload differs for
+// * MatrixA&
+// * const MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_posv( MatrixA& a, const MatrixB& b, const MatrixX& x,
+ fortran_int_t& iter ) {
+ return iter_posv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
+}
+
+//
+// Overloaded function for iter_posv. Its overload differs for
+// * const MatrixA&
+// * const MatrixX&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename MatrixX,
+ typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+iter_posv( const MatrixA& a, const MatrixB& b, const MatrixX& x,
+ fortran_int_t& iter, Workspace work ) {
+ return iter_posv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, b, x, iter, work );
+}
+
+//
+// Overloaded function for iter_posv. Its overload differs for
+// * const MatrixA&
+// * const MatrixX&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename MatrixX >
+inline typename boost::disable_if< detail::is_workspace< MatrixX >,
+ std::ptrdiff_t >::type
+iter_posv( const MatrixA& a, const MatrixB& b, const MatrixX& x,
+ fortran_int_t& iter ) {
+ return iter_posv_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
+}
+
+} // namespace lapack
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Deleted: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/sgesv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/sgesv.hpp 2010-06-17 20:06:08 EDT (Thu, 17 Jun 2010)
+++ (empty file)
@@ -1,479 +0,0 @@
-//
-// 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)
-//
-// THIS FILE IS AUTOMATICALLY GENERATED
-// PLEASE DO NOT EDIT!
-//
-
-#ifndef BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_SGESV_HPP
-#define BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_SGESV_HPP
-
-#include <boost/assert.hpp>
-#include <boost/numeric/bindings/begin.hpp>
-#include <boost/numeric/bindings/detail/array.hpp>
-#include <boost/numeric/bindings/is_column_major.hpp>
-#include <boost/numeric/bindings/is_mutable.hpp>
-#include <boost/numeric/bindings/lapack/workspace.hpp>
-#include <boost/numeric/bindings/remove_imaginary.hpp>
-#include <boost/numeric/bindings/size.hpp>
-#include <boost/numeric/bindings/stride.hpp>
-#include <boost/numeric/bindings/value_type.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/remove_const.hpp>
-
-//
-// The LAPACK-backend for sgesv is the netlib-compatible backend.
-//
-#include <boost/numeric/bindings/lapack/detail/lapack.h>
-#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace lapack {
-
-//
-// The detail namespace contains value-type-overloaded functions that
-// dispatch to the appropriate back-end LAPACK-routine.
-//
-namespace detail {
-
-//
-// Overloaded function for dispatching to
-// * netlib-compatible LAPACK backend (the default), and
-// * double value-type.
-//
-inline std::ptrdiff_t sgesv( const fortran_int_t n, const fortran_int_t nrhs,
- double* a, const fortran_int_t lda, fortran_int_t* ipiv,
- const double* b, const fortran_int_t ldb, double* x,
- const fortran_int_t ldx, double* work, float* swork,
- fortran_int_t& iter ) {
- fortran_int_t info(0);
- LAPACK_DSGESV( &n, &nrhs, a, &lda, ipiv, b, &ldb, x, &ldx, work, swork,
- &iter, &info );
- return info;
-}
-
-} // namespace detail
-
-//
-// Value-type based template class. Use this class if you need a type
-// for dispatching to sgesv.
-//
-template< typename Value >
-struct sgesv_impl {
-
- typedef Value value_type;
- typedef typename remove_imaginary< Value >::type real_type;
-
- //
- // Static member function for user-defined workspaces, that
- // * Deduces the required arguments for dispatching to LAPACK, and
- // * Asserts that most arguments make sense.
- //
- template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename WORK, typename SWORK >
- static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
- const MatrixB& b, MatrixX& x, fortran_int_t& iter,
- detail::workspace2< WORK, SWORK > work ) {
- namespace bindings = ::boost::numeric::bindings;
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
- BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
- typename bindings::value_type< MatrixA >::type >::type,
- typename remove_const< typename bindings::value_type<
- MatrixB >::type >::type >::value) );
- BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
- typename bindings::value_type< MatrixA >::type >::type,
- typename remove_const< typename bindings::value_type<
- MatrixX >::type >::type >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIPIV >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
- BOOST_ASSERT( bindings::size(ipiv) >= bindings::stride_major(work) );
- BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_swork( bindings::stride_major(work),
- bindings::size_column(b) ));
- BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
- BOOST_ASSERT( bindings::size_column(b) >= 0 );
- BOOST_ASSERT( bindings::size_minor(a) == 1 ||
- bindings::stride_minor(a) == 1 );
- BOOST_ASSERT( bindings::size_minor(b) == 1 ||
- bindings::stride_minor(b) == 1 );
- BOOST_ASSERT( bindings::size_minor(x) == 1 ||
- bindings::stride_minor(x) == 1 );
- BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- BOOST_ASSERT( bindings::stride_major(work) >= 0 );
- BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- return detail::sgesv( bindings::stride_major(work),
- bindings::size_column(b), bindings::begin_value(a),
- bindings::stride_major(a), bindings::begin_value(ipiv),
- bindings::begin_value(b), bindings::stride_major(b),
- bindings::begin_value(x), bindings::stride_major(x),
- bindings::begin_value(work),
- bindings::begin_value(work.select(real_type())), iter );
- }
-
- //
- // Static member function that
- // * Figures out the minimal workspace requirements, and passes
- // the results to the user-defined workspace overload of the
- // invoke static member function
- // * Enables the unblocked algorithm (BLAS level 2)
- //
- template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
- static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
- const MatrixB& b, MatrixX& x, fortran_int_t& iter,
- minimal_workspace work ) {
- namespace bindings = ::boost::numeric::bindings;
- bindings::detail::array< real_type > tmp_work( min_size_work(
- $CALL_MIN_SIZE ) );
- bindings::detail::array< real_type > tmp_swork( min_size_swork(
- bindings::stride_major(work), bindings::size_column(b) ) );
- return invoke( a, ipiv, b, x, iter, workspace( tmp_work, tmp_swork ) );
- }
-
- //
- // Static member function that
- // * Figures out the optimal workspace requirements, and passes
- // the results to the user-defined workspace overload of the
- // invoke static member
- // * Enables the blocked algorithm (BLAS level 3)
- //
- template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
- static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
- const MatrixB& b, MatrixX& x, fortran_int_t& iter,
- optimal_workspace work ) {
- namespace bindings = ::boost::numeric::bindings;
- return invoke( a, ipiv, b, x, iter, minimal_workspace() );
- }
-
- //
- // Static member function that returns the minimum size of
- // workspace-array work.
- //
- template< $TYPES >
- static std::ptrdiff_t min_size_work( $ARGUMENTS ) {
- $MIN_SIZE_IMPLEMENTATION
- }
-
- //
- // Static member function that returns the minimum size of
- // workspace-array swork.
- //
- static std::ptrdiff_t min_size_swork( const std::ptrdiff_t n,
- const std::ptrdiff_t nrhs ) {
- return n*(n+nrhs);
- }
-};
-
-
-//
-// Functions for direct use. These functions are overloaded for temporaries,
-// so that wrapped types can still be passed and used for write-access. In
-// addition, if applicable, they are overloaded for user-defined workspaces.
-// Calls to these functions are passed to the sgesv_impl classes. In the
-// documentation, most overloads are collapsed to avoid a large number of
-// prototypes which are very similar.
-//
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * MatrixA&
-// * VectorIPIV&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sgesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * MatrixA&
-// * VectorIPIV&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sgesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * const MatrixA&
-// * VectorIPIV&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sgesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * const MatrixA&
-// * VectorIPIV&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sgesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * MatrixA&
-// * const VectorIPIV&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sgesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * MatrixA&
-// * const VectorIPIV&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sgesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * const MatrixA&
-// * const VectorIPIV&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sgesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- MatrixX& x, fortran_int_t& iter, Workspace work ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * const MatrixA&
-// * const VectorIPIV&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sgesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- MatrixX& x, fortran_int_t& iter ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * MatrixA&
-// * VectorIPIV&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sgesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * MatrixA&
-// * VectorIPIV&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sgesv( MatrixA& a, VectorIPIV& ipiv, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * const MatrixA&
-// * VectorIPIV&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sgesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter, Workspace work ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * const MatrixA&
-// * VectorIPIV&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sgesv( const MatrixA& a, VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * MatrixA&
-// * const VectorIPIV&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sgesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter, Workspace work ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * MatrixA&
-// * const VectorIPIV&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sgesv( MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * const MatrixA&
-// * const VectorIPIV&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX, typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sgesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter, Workspace work ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter, work );
-}
-
-//
-// Overloaded function for sgesv. Its overload differs for
-// * const MatrixA&
-// * const VectorIPIV&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename VectorIPIV, typename MatrixB,
- typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sgesv( const MatrixA& a, const VectorIPIV& ipiv, const MatrixB& b,
- const MatrixX& x, fortran_int_t& iter ) {
- return sgesv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, ipiv, b, x, iter,
- optimal_workspace() );
-}
-
-} // namespace lapack
-} // namespace bindings
-} // namespace numeric
-} // namespace boost
-
-#endif

Deleted: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/sposv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/sposv.hpp 2010-06-17 20:06:08 EDT (Thu, 17 Jun 2010)
+++ (empty file)
@@ -1,320 +0,0 @@
-//
-// 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)
-//
-// THIS FILE IS AUTOMATICALLY GENERATED
-// PLEASE DO NOT EDIT!
-//
-
-#ifndef BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_SPOSV_HPP
-#define BOOST_NUMERIC_BINDINGS_LAPACK_DRIVER_SPOSV_HPP
-
-#include <boost/assert.hpp>
-#include <boost/numeric/bindings/begin.hpp>
-#include <boost/numeric/bindings/detail/array.hpp>
-#include <boost/numeric/bindings/is_column_major.hpp>
-#include <boost/numeric/bindings/is_mutable.hpp>
-#include <boost/numeric/bindings/lapack/workspace.hpp>
-#include <boost/numeric/bindings/remove_imaginary.hpp>
-#include <boost/numeric/bindings/size.hpp>
-#include <boost/numeric/bindings/stride.hpp>
-#include <boost/numeric/bindings/uplo_tag.hpp>
-#include <boost/numeric/bindings/value_type.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/remove_const.hpp>
-
-//
-// The LAPACK-backend for sposv is the netlib-compatible backend.
-//
-#include <boost/numeric/bindings/lapack/detail/lapack.h>
-#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace lapack {
-
-//
-// The detail namespace contains value-type-overloaded functions that
-// dispatch to the appropriate back-end LAPACK-routine.
-//
-namespace detail {
-
-//
-// Overloaded function for dispatching to
-// * netlib-compatible LAPACK backend (the default), and
-// * double value-type.
-//
-template< typename UpLo >
-inline std::ptrdiff_t sposv( const UpLo uplo, const fortran_int_t n,
- const fortran_int_t nrhs, double* a, const fortran_int_t lda,
- const double* b, const fortran_int_t ldb, double* x,
- const fortran_int_t ldx, double* work, float* swork,
- fortran_int_t& iter ) {
- fortran_int_t info(0);
- LAPACK_DSPOSV( &lapack_option< UpLo >::value, &n, &nrhs, a, &lda, b, &ldb,
- x, &ldx, work, swork, &iter, &info );
- return info;
-}
-
-} // namespace detail
-
-//
-// Value-type based template class. Use this class if you need a type
-// for dispatching to sposv.
-//
-template< typename Value >
-struct sposv_impl {
-
- typedef Value value_type;
- typedef typename remove_imaginary< Value >::type real_type;
-
- //
- // Static member function for user-defined workspaces, that
- // * Deduces the required arguments for dispatching to LAPACK, and
- // * Asserts that most arguments make sense.
- //
- template< typename MatrixA, typename MatrixB, typename MatrixX,
- typename WORK, typename SWORK >
- static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, detail::workspace2< WORK, SWORK > work ) {
- namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::uplo_tag< MatrixA >::type uplo;
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
- BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
- typename bindings::value_type< MatrixA >::type >::type,
- typename remove_const< typename bindings::value_type<
- MatrixB >::type >::type >::value) );
- BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
- typename bindings::value_type< MatrixA >::type >::type,
- typename remove_const< typename bindings::value_type<
- MatrixX >::type >::type >::value) );
- BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
- BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_swork( bindings::stride_major(work),
- bindings::size_column(b) ));
- BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
- BOOST_ASSERT( bindings::size_column(b) >= 0 );
- BOOST_ASSERT( bindings::size_minor(a) == 1 ||
- bindings::stride_minor(a) == 1 );
- BOOST_ASSERT( bindings::size_minor(b) == 1 ||
- bindings::stride_minor(b) == 1 );
- BOOST_ASSERT( bindings::size_minor(x) == 1 ||
- bindings::stride_minor(x) == 1 );
- BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- BOOST_ASSERT( bindings::stride_major(work) >= 0 );
- BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
- bindings::stride_major(work)) );
- return detail::sposv( uplo(), bindings::stride_major(work),
- bindings::size_column(b), bindings::begin_value(a),
- bindings::stride_major(a), bindings::begin_value(b),
- bindings::stride_major(b), bindings::begin_value(x),
- bindings::stride_major(x), bindings::begin_value(work),
- bindings::begin_value(work.select(real_type())), iter );
- }
-
- //
- // Static member function that
- // * Figures out the minimal workspace requirements, and passes
- // the results to the user-defined workspace overload of the
- // invoke static member function
- // * Enables the unblocked algorithm (BLAS level 2)
- //
- template< typename MatrixA, typename MatrixB, typename MatrixX >
- static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, minimal_workspace work ) {
- namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::uplo_tag< MatrixA >::type uplo;
- bindings::detail::array< real_type > tmp_work( min_size_work(
- $CALL_MIN_SIZE ) );
- bindings::detail::array< real_type > tmp_swork( min_size_swork(
- bindings::stride_major(work), bindings::size_column(b) ) );
- return invoke( a, b, x, iter, workspace( tmp_work, tmp_swork ) );
- }
-
- //
- // Static member function that
- // * Figures out the optimal workspace requirements, and passes
- // the results to the user-defined workspace overload of the
- // invoke static member
- // * Enables the blocked algorithm (BLAS level 3)
- //
- template< typename MatrixA, typename MatrixB, typename MatrixX >
- static std::ptrdiff_t invoke( MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, optimal_workspace work ) {
- namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::uplo_tag< MatrixA >::type uplo;
- return invoke( a, b, x, iter, minimal_workspace() );
- }
-
- //
- // Static member function that returns the minimum size of
- // workspace-array work.
- //
- template< $TYPES >
- static std::ptrdiff_t min_size_work( $ARGUMENTS ) {
- $MIN_SIZE_IMPLEMENTATION
- }
-
- //
- // Static member function that returns the minimum size of
- // workspace-array swork.
- //
- static std::ptrdiff_t min_size_swork( const std::ptrdiff_t n,
- const std::ptrdiff_t nrhs ) {
- return n*(n+nrhs);
- }
-};
-
-
-//
-// Functions for direct use. These functions are overloaded for temporaries,
-// so that wrapped types can still be passed and used for write-access. In
-// addition, if applicable, they are overloaded for user-defined workspaces.
-// Calls to these functions are passed to the sposv_impl classes. In the
-// documentation, most overloads are collapsed to avoid a large number of
-// prototypes which are very similar.
-//
-
-//
-// Overloaded function for sposv. Its overload differs for
-// * MatrixA&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX,
- typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sposv( MatrixA& a, const MatrixB& b, MatrixX& x, fortran_int_t& iter,
- Workspace work ) {
- return sposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, work );
-}
-
-//
-// Overloaded function for sposv. Its overload differs for
-// * MatrixA&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sposv( MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter ) {
- return sposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
-}
-
-//
-// Overloaded function for sposv. Its overload differs for
-// * const MatrixA&
-// * MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX,
- typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sposv( const MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return sposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, work );
-}
-
-//
-// Overloaded function for sposv. Its overload differs for
-// * const MatrixA&
-// * MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sposv( const MatrixA& a, const MatrixB& b, MatrixX& x,
- fortran_int_t& iter ) {
- return sposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
-}
-
-//
-// Overloaded function for sposv. Its overload differs for
-// * MatrixA&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX,
- typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sposv( MatrixA& a, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return sposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, work );
-}
-
-//
-// Overloaded function for sposv. Its overload differs for
-// * MatrixA&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sposv( MatrixA& a, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter ) {
- return sposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
-}
-
-//
-// Overloaded function for sposv. Its overload differs for
-// * const MatrixA&
-// * const MatrixX&
-// * User-defined workspace
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX,
- typename Workspace >
-inline typename boost::enable_if< detail::is_workspace< Workspace >,
- std::ptrdiff_t >::type
-sposv( const MatrixA& a, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter, Workspace work ) {
- return sposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, work );
-}
-
-//
-// Overloaded function for sposv. Its overload differs for
-// * const MatrixA&
-// * const MatrixX&
-// * Default workspace-type (optimal)
-//
-template< typename MatrixA, typename MatrixB, typename MatrixX >
-inline typename boost::disable_if< detail::is_workspace< MatrixX >,
- std::ptrdiff_t >::type
-sposv( const MatrixA& a, const MatrixB& b, const MatrixX& x,
- fortran_int_t& iter ) {
- return sposv_impl< typename bindings::value_type<
- MatrixA >::type >::invoke( a, b, x, iter, optimal_workspace() );
-}
-
-} // namespace lapack
-} // 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