Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58976 - sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational
From: rutger_at_[hidden]
Date: 2010-01-13 09:13:32


Author: rutger
Date: 2010-01-13 09:13:31 EST (Wed, 13 Jan 2010)
New Revision: 58976
URL: http://svn.boost.org/trac/boost/changeset/58976

Log:
improved uplo handling by various computational routines

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hecon.hpp | 63 ++++++++++++-----------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hpcon.hpp | 63 ++++++++++++-----------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptri.hpp | 61 +++++++++++----------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/spcon.hpp | 108 +++++++++++++++++++++------------------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sptri.hpp | 94 ++++++++++++++++++---------------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sptrs.hpp | 47 ++++++++++-------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sycon.hpp | 108 +++++++++++++++++++++------------------
   7 files changed, 292 insertions(+), 252 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hecon.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hecon.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hecon.hpp 2010-01-13 09:13:31 EST (Wed, 13 Jan 2010)
@@ -50,12 +50,14 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
-inline std::ptrdiff_t hecon( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t hecon( UpLo, const fortran_int_t n,
         const std::complex<float>* a, const fortran_int_t lda,
         const fortran_int_t* ipiv, const float anorm, float& rcond,
         std::complex<float>* work ) {
     fortran_int_t info(0);
- LAPACK_CHECON( &uplo, &n, a, &lda, ipiv, &anorm, &rcond, work, &info );
+ LAPACK_CHECON( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, &anorm,
+ &rcond, work, &info );
     return info;
 }
 
@@ -64,12 +66,14 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<double> value-type.
 //
-inline std::ptrdiff_t hecon( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t hecon( UpLo, const fortran_int_t n,
         const std::complex<double>* a, const fortran_int_t lda,
         const fortran_int_t* ipiv, const double anorm, double& rcond,
         std::complex<double>* work ) {
     fortran_int_t info(0);
- LAPACK_ZHECON( &uplo, &n, a, &lda, ipiv, &anorm, &rcond, work, &info );
+ LAPACK_ZHECON( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, &anorm,
+ &rcond, work, &info );
     return info;
 }
 
@@ -92,9 +96,10 @@
     // * Asserts that most arguments make sense.
     //
     template< typename MatrixA, typename VectorIPIV, typename WORK >
- static std::ptrdiff_t invoke( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- detail::workspace1< WORK > work ) {
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, detail::workspace1<
+ WORK > work ) {
+ typedef typename result_of::data_side< MatrixA >::type uplo;
         BOOST_ASSERT( size(ipiv) >= size_column(a) );
         BOOST_ASSERT( size(work.select(value_type())) >= min_size_work(
                 size_column(a) ));
@@ -102,7 +107,7 @@
         BOOST_ASSERT( size_minor(a) == 1 || stride_minor(a) == 1 );
         BOOST_ASSERT( stride_major(a) >= std::max< std::ptrdiff_t >(1,
                 size_column(a)) );
- return detail::hecon( uplo, size_column(a), begin_value(a),
+ return detail::hecon( uplo(), size_column(a), begin_value(a),
                 stride_major(a), begin_value(ipiv), anorm, rcond,
                 begin_value(work.select(value_type())) );
     }
@@ -115,12 +120,12 @@
     // * Enables the unblocked algorithm (BLAS level 2)
     //
     template< typename MatrixA, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- minimal_workspace work ) {
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, minimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixA >::type uplo;
         bindings::detail::array< value_type > tmp_work( min_size_work(
                 size_column(a) ) );
- return invoke( uplo, a, ipiv, anorm, rcond, workspace( tmp_work ) );
+ return invoke( a, ipiv, anorm, rcond, workspace( tmp_work ) );
     }
 
     //
@@ -131,10 +136,10 @@
     // * Enables the blocked algorithm (BLAS level 3)
     //
     template< typename MatrixA, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- optimal_workspace work ) {
- return invoke( uplo, a, ipiv, anorm, rcond, minimal_workspace() );
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, optimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixA >::type uplo;
+ return invoke( a, ipiv, anorm, rcond, minimal_workspace() );
     }
 
     //
@@ -161,13 +166,12 @@
 // * User-defined workspace
 //
 template< typename MatrixA, typename VectorIPIV, typename Workspace >
-inline std::ptrdiff_t hecon( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const typename remove_imaginary<
- typename value< MatrixA >::type >::type anorm,
- typename remove_imaginary< typename value<
- MatrixA >::type >::type& rcond, Workspace work ) {
- return hecon_impl< typename value< MatrixA >::type >::invoke( uplo,
- a, ipiv, anorm, rcond, work );
+inline std::ptrdiff_t hecon( const MatrixA& a, const VectorIPIV& ipiv,
+ const typename remove_imaginary< typename value<
+ MatrixA >::type >::type anorm, typename remove_imaginary<
+ typename value< MatrixA >::type >::type& rcond, Workspace work ) {
+ return hecon_impl< typename value< MatrixA >::type >::invoke( a,
+ ipiv, anorm, rcond, work );
 }
 
 //
@@ -175,13 +179,12 @@
 // * Default workspace-type (optimal)
 //
 template< typename MatrixA, typename VectorIPIV >
-inline std::ptrdiff_t hecon( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const typename remove_imaginary<
- typename value< MatrixA >::type >::type anorm,
- typename remove_imaginary< typename value<
- MatrixA >::type >::type& rcond ) {
- return hecon_impl< typename value< MatrixA >::type >::invoke( uplo,
- a, ipiv, anorm, rcond, optimal_workspace() );
+inline std::ptrdiff_t hecon( const MatrixA& a, const VectorIPIV& ipiv,
+ const typename remove_imaginary< typename value<
+ MatrixA >::type >::type anorm, typename remove_imaginary<
+ typename value< MatrixA >::type >::type& rcond ) {
+ return hecon_impl< typename value< MatrixA >::type >::invoke( a,
+ ipiv, anorm, rcond, optimal_workspace() );
 }
 
 } // namespace lapack

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hpcon.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hpcon.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hpcon.hpp 2010-01-13 09:13:31 EST (Wed, 13 Jan 2010)
@@ -50,11 +50,13 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
-inline std::ptrdiff_t hpcon( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t hpcon( UpLo, const fortran_int_t n,
         const std::complex<float>* ap, const fortran_int_t* ipiv,
         const float anorm, float& rcond, std::complex<float>* work ) {
     fortran_int_t info(0);
- LAPACK_CHPCON( &uplo, &n, ap, ipiv, &anorm, &rcond, work, &info );
+ LAPACK_CHPCON( &lapack_option< UpLo >::value, &n, ap, ipiv, &anorm,
+ &rcond, work, &info );
     return info;
 }
 
@@ -63,11 +65,13 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<double> value-type.
 //
-inline std::ptrdiff_t hpcon( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t hpcon( UpLo, const fortran_int_t n,
         const std::complex<double>* ap, const fortran_int_t* ipiv,
         const double anorm, double& rcond, std::complex<double>* work ) {
     fortran_int_t info(0);
- LAPACK_ZHPCON( &uplo, &n, ap, ipiv, &anorm, &rcond, work, &info );
+ LAPACK_ZHPCON( &lapack_option< UpLo >::value, &n, ap, ipiv, &anorm,
+ &rcond, work, &info );
     return info;
 }
 
@@ -90,14 +94,15 @@
     // * Asserts that most arguments make sense.
     //
     template< typename MatrixAP, typename VectorIPIV, typename WORK >
- static std::ptrdiff_t invoke( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- detail::workspace1< WORK > work ) {
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, detail::workspace1<
+ WORK > work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         BOOST_ASSERT( size(ipiv) >= size_column(ap) );
         BOOST_ASSERT( size(work.select(value_type())) >= min_size_work(
                 size_column(ap) ));
         BOOST_ASSERT( size_column(ap) >= 0 );
- return detail::hpcon( uplo, size_column(ap), begin_value(ap),
+ return detail::hpcon( uplo(), size_column(ap), begin_value(ap),
                 begin_value(ipiv), anorm, rcond,
                 begin_value(work.select(value_type())) );
     }
@@ -110,12 +115,12 @@
     // * Enables the unblocked algorithm (BLAS level 2)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- minimal_workspace work ) {
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, minimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         bindings::detail::array< value_type > tmp_work( min_size_work(
                 size_column(ap) ) );
- return invoke( uplo, ap, ipiv, anorm, rcond, workspace( tmp_work ) );
+ return invoke( ap, ipiv, anorm, rcond, workspace( tmp_work ) );
     }
 
     //
@@ -126,10 +131,10 @@
     // * Enables the blocked algorithm (BLAS level 3)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- optimal_workspace work ) {
- return invoke( uplo, ap, ipiv, anorm, rcond, minimal_workspace() );
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, optimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
+ return invoke( ap, ipiv, anorm, rcond, minimal_workspace() );
     }
 
     //
@@ -156,13 +161,12 @@
 // * User-defined workspace
 //
 template< typename MatrixAP, typename VectorIPIV, typename Workspace >
-inline std::ptrdiff_t hpcon( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const typename remove_imaginary<
- typename value< MatrixAP >::type >::type anorm,
- typename remove_imaginary< typename value<
- MatrixAP >::type >::type& rcond, Workspace work ) {
- return hpcon_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, anorm, rcond, work );
+inline std::ptrdiff_t hpcon( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const typename remove_imaginary< typename value<
+ MatrixAP >::type >::type anorm, typename remove_imaginary<
+ typename value< MatrixAP >::type >::type& rcond, Workspace work ) {
+ return hpcon_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, anorm, rcond, work );
 }
 
 //
@@ -170,13 +174,12 @@
 // * Default workspace-type (optimal)
 //
 template< typename MatrixAP, typename VectorIPIV >
-inline std::ptrdiff_t hpcon( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const typename remove_imaginary<
- typename value< MatrixAP >::type >::type anorm,
- typename remove_imaginary< typename value<
- MatrixAP >::type >::type& rcond ) {
- return hpcon_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, anorm, rcond, optimal_workspace() );
+inline std::ptrdiff_t hpcon( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const typename remove_imaginary< typename value<
+ MatrixAP >::type >::type anorm, typename remove_imaginary<
+ typename value< MatrixAP >::type >::type& rcond ) {
+ return hpcon_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, anorm, rcond, optimal_workspace() );
 }
 
 } // namespace lapack

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptri.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptri.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptri.hpp 2010-01-13 09:13:31 EST (Wed, 13 Jan 2010)
@@ -50,11 +50,12 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
-inline std::ptrdiff_t hptri( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t hptri( UpLo, const fortran_int_t n,
         std::complex<float>* ap, const fortran_int_t* ipiv,
         std::complex<float>* work ) {
     fortran_int_t info(0);
- LAPACK_CHPTRI( &uplo, &n, ap, ipiv, work, &info );
+ LAPACK_CHPTRI( &lapack_option< UpLo >::value, &n, ap, ipiv, work, &info );
     return info;
 }
 
@@ -63,11 +64,12 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<double> value-type.
 //
-inline std::ptrdiff_t hptri( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t hptri( UpLo, const fortran_int_t n,
         std::complex<double>* ap, const fortran_int_t* ipiv,
         std::complex<double>* work ) {
     fortran_int_t info(0);
- LAPACK_ZHPTRI( &uplo, &n, ap, ipiv, work, &info );
+ LAPACK_ZHPTRI( &lapack_option< UpLo >::value, &n, ap, ipiv, work, &info );
     return info;
 }
 
@@ -90,14 +92,15 @@
     // * Asserts that most arguments make sense.
     //
     template< typename MatrixAP, typename VectorIPIV, typename WORK >
- static std::ptrdiff_t invoke( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, detail::workspace1< WORK > work ) {
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ detail::workspace1< WORK > work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         BOOST_STATIC_ASSERT( (is_mutable< MatrixAP >::value) );
         BOOST_ASSERT( size(ipiv) >= size_column(ap) );
         BOOST_ASSERT( size(work.select(value_type())) >= min_size_work(
                 size_column(ap) ));
         BOOST_ASSERT( size_column(ap) >= 0 );
- return detail::hptri( uplo, size_column(ap), begin_value(ap),
+ return detail::hptri( uplo(), size_column(ap), begin_value(ap),
                 begin_value(ipiv), begin_value(work.select(value_type())) );
     }
 
@@ -109,11 +112,12 @@
     // * Enables the unblocked algorithm (BLAS level 2)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, minimal_workspace work ) {
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ minimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         bindings::detail::array< value_type > tmp_work( min_size_work(
                 size_column(ap) ) );
- return invoke( uplo, ap, ipiv, workspace( tmp_work ) );
+ return invoke( ap, ipiv, workspace( tmp_work ) );
     }
 
     //
@@ -124,9 +128,10 @@
     // * Enables the blocked algorithm (BLAS level 3)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, optimal_workspace work ) {
- return invoke( uplo, ap, ipiv, minimal_workspace() );
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ optimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
+ return invoke( ap, ipiv, minimal_workspace() );
     }
 
     //
@@ -154,10 +159,10 @@
 // * User-defined workspace
 //
 template< typename MatrixAP, typename VectorIPIV, typename Workspace >
-inline std::ptrdiff_t hptri( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, Workspace work ) {
- return hptri_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, work );
+inline std::ptrdiff_t hptri( MatrixAP& ap, const VectorIPIV& ipiv,
+ Workspace work ) {
+ return hptri_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, work );
 }
 
 //
@@ -166,10 +171,9 @@
 // * Default workspace-type (optimal)
 //
 template< typename MatrixAP, typename VectorIPIV >
-inline std::ptrdiff_t hptri( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv ) {
- return hptri_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, optimal_workspace() );
+inline std::ptrdiff_t hptri( MatrixAP& ap, const VectorIPIV& ipiv ) {
+ return hptri_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, optimal_workspace() );
 }
 
 //
@@ -178,10 +182,10 @@
 // * User-defined workspace
 //
 template< typename MatrixAP, typename VectorIPIV, typename Workspace >
-inline std::ptrdiff_t hptri( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, Workspace work ) {
- return hptri_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, work );
+inline std::ptrdiff_t hptri( const MatrixAP& ap, const VectorIPIV& ipiv,
+ Workspace work ) {
+ return hptri_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, work );
 }
 
 //
@@ -190,10 +194,9 @@
 // * Default workspace-type (optimal)
 //
 template< typename MatrixAP, typename VectorIPIV >
-inline std::ptrdiff_t hptri( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv ) {
- return hptri_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, optimal_workspace() );
+inline std::ptrdiff_t hptri( const MatrixAP& ap, const VectorIPIV& ipiv ) {
+ return hptri_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, optimal_workspace() );
 }
 
 } // namespace lapack

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/spcon.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/spcon.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/spcon.hpp 2010-01-13 09:13:31 EST (Wed, 13 Jan 2010)
@@ -53,11 +53,13 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * float value-type.
 //
-inline std::ptrdiff_t spcon( const char uplo, const fortran_int_t n,
- const float* ap, const fortran_int_t* ipiv, const float anorm,
- float& rcond, float* work, fortran_int_t* iwork ) {
+template< typename UpLo >
+inline std::ptrdiff_t spcon( UpLo, const fortran_int_t n, const float* ap,
+ const fortran_int_t* ipiv, const float anorm, float& rcond,
+ float* work, fortran_int_t* iwork ) {
     fortran_int_t info(0);
- LAPACK_SSPCON( &uplo, &n, ap, ipiv, &anorm, &rcond, work, iwork, &info );
+ LAPACK_SSPCON( &lapack_option< UpLo >::value, &n, ap, ipiv, &anorm,
+ &rcond, work, iwork, &info );
     return info;
 }
 
@@ -66,11 +68,13 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * double value-type.
 //
-inline std::ptrdiff_t spcon( const char uplo, const fortran_int_t n,
- const double* ap, const fortran_int_t* ipiv, const double anorm,
- double& rcond, double* work, fortran_int_t* iwork ) {
+template< typename UpLo >
+inline std::ptrdiff_t spcon( UpLo, const fortran_int_t n, const double* ap,
+ const fortran_int_t* ipiv, const double anorm, double& rcond,
+ double* work, fortran_int_t* iwork ) {
     fortran_int_t info(0);
- LAPACK_DSPCON( &uplo, &n, ap, ipiv, &anorm, &rcond, work, iwork, &info );
+ LAPACK_DSPCON( &lapack_option< UpLo >::value, &n, ap, ipiv, &anorm,
+ &rcond, work, iwork, &info );
     return info;
 }
 
@@ -79,11 +83,13 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
-inline std::ptrdiff_t spcon( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t spcon( UpLo, const fortran_int_t n,
         const std::complex<float>* ap, const fortran_int_t* ipiv,
         const float anorm, float& rcond, std::complex<float>* work ) {
     fortran_int_t info(0);
- LAPACK_CSPCON( &uplo, &n, ap, ipiv, &anorm, &rcond, work, &info );
+ LAPACK_CSPCON( &lapack_option< UpLo >::value, &n, ap, ipiv, &anorm,
+ &rcond, work, &info );
     return info;
 }
 
@@ -92,11 +98,13 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<double> value-type.
 //
-inline std::ptrdiff_t spcon( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t spcon( UpLo, const fortran_int_t n,
         const std::complex<double>* ap, const fortran_int_t* ipiv,
         const double anorm, double& rcond, std::complex<double>* work ) {
     fortran_int_t info(0);
- LAPACK_ZSPCON( &uplo, &n, ap, ipiv, &anorm, &rcond, work, &info );
+ LAPACK_ZSPCON( &lapack_option< UpLo >::value, &n, ap, ipiv, &anorm,
+ &rcond, work, &info );
     return info;
 }
 
@@ -126,16 +134,17 @@
     //
     template< typename MatrixAP, typename VectorIPIV, typename WORK,
             typename IWORK >
- static std::ptrdiff_t invoke( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- detail::workspace2< WORK, IWORK > work ) {
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, detail::workspace2< WORK,
+ IWORK > work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         BOOST_ASSERT( size(ipiv) >= size_column(ap) );
         BOOST_ASSERT( size(work.select(fortran_int_t())) >=
                 min_size_iwork( size_column(ap) ));
         BOOST_ASSERT( size(work.select(real_type())) >= min_size_work(
                 size_column(ap) ));
         BOOST_ASSERT( size_column(ap) >= 0 );
- return detail::spcon( uplo, size_column(ap), begin_value(ap),
+ return detail::spcon( uplo(), size_column(ap), begin_value(ap),
                 begin_value(ipiv), anorm, rcond,
                 begin_value(work.select(real_type())),
                 begin_value(work.select(fortran_int_t())) );
@@ -149,14 +158,14 @@
     // * Enables the unblocked algorithm (BLAS level 2)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- minimal_workspace work ) {
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, minimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         bindings::detail::array< real_type > tmp_work( min_size_work(
                 size_column(ap) ) );
         bindings::detail::array< fortran_int_t > tmp_iwork(
                 min_size_iwork( size_column(ap) ) );
- return invoke( uplo, ap, ipiv, anorm, rcond, workspace( tmp_work,
+ return invoke( ap, ipiv, anorm, rcond, workspace( tmp_work,
                 tmp_iwork ) );
     }
 
@@ -168,10 +177,10 @@
     // * Enables the blocked algorithm (BLAS level 3)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- optimal_workspace work ) {
- return invoke( uplo, ap, ipiv, anorm, rcond, minimal_workspace() );
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, optimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
+ return invoke( ap, ipiv, anorm, rcond, minimal_workspace() );
     }
 
     //
@@ -207,14 +216,15 @@
     // * Asserts that most arguments make sense.
     //
     template< typename MatrixAP, typename VectorIPIV, typename WORK >
- static std::ptrdiff_t invoke( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- detail::workspace1< WORK > work ) {
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, detail::workspace1<
+ WORK > work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         BOOST_ASSERT( size(ipiv) >= size_column(ap) );
         BOOST_ASSERT( size(work.select(value_type())) >= min_size_work(
                 size_column(ap) ));
         BOOST_ASSERT( size_column(ap) >= 0 );
- return detail::spcon( uplo, size_column(ap), begin_value(ap),
+ return detail::spcon( uplo(), size_column(ap), begin_value(ap),
                 begin_value(ipiv), anorm, rcond,
                 begin_value(work.select(value_type())) );
     }
@@ -227,12 +237,12 @@
     // * Enables the unblocked algorithm (BLAS level 2)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- minimal_workspace work ) {
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, minimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         bindings::detail::array< value_type > tmp_work( min_size_work(
                 size_column(ap) ) );
- return invoke( uplo, ap, ipiv, anorm, rcond, workspace( tmp_work ) );
+ return invoke( ap, ipiv, anorm, rcond, workspace( tmp_work ) );
     }
 
     //
@@ -243,10 +253,10 @@
     // * Enables the blocked algorithm (BLAS level 3)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- optimal_workspace work ) {
- return invoke( uplo, ap, ipiv, anorm, rcond, minimal_workspace() );
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, optimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
+ return invoke( ap, ipiv, anorm, rcond, minimal_workspace() );
     }
 
     //
@@ -273,13 +283,12 @@
 // * User-defined workspace
 //
 template< typename MatrixAP, typename VectorIPIV, typename Workspace >
-inline std::ptrdiff_t spcon( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const typename remove_imaginary<
- typename value< MatrixAP >::type >::type anorm,
- typename remove_imaginary< typename value<
- MatrixAP >::type >::type& rcond, Workspace work ) {
- return spcon_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, anorm, rcond, work );
+inline std::ptrdiff_t spcon( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const typename remove_imaginary< typename value<
+ MatrixAP >::type >::type anorm, typename remove_imaginary<
+ typename value< MatrixAP >::type >::type& rcond, Workspace work ) {
+ return spcon_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, anorm, rcond, work );
 }
 
 //
@@ -287,13 +296,12 @@
 // * Default workspace-type (optimal)
 //
 template< typename MatrixAP, typename VectorIPIV >
-inline std::ptrdiff_t spcon( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const typename remove_imaginary<
- typename value< MatrixAP >::type >::type anorm,
- typename remove_imaginary< typename value<
- MatrixAP >::type >::type& rcond ) {
- return spcon_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, anorm, rcond, optimal_workspace() );
+inline std::ptrdiff_t spcon( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const typename remove_imaginary< typename value<
+ MatrixAP >::type >::type anorm, typename remove_imaginary<
+ typename value< MatrixAP >::type >::type& rcond ) {
+ return spcon_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, anorm, rcond, optimal_workspace() );
 }
 
 } // namespace lapack

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sptri.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sptri.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sptri.hpp 2010-01-13 09:13:31 EST (Wed, 13 Jan 2010)
@@ -53,10 +53,11 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * float value-type.
 //
-inline std::ptrdiff_t sptri( const char uplo, const fortran_int_t n, float* ap,
+template< typename UpLo >
+inline std::ptrdiff_t sptri( UpLo, const fortran_int_t n, float* ap,
         const fortran_int_t* ipiv, float* work ) {
     fortran_int_t info(0);
- LAPACK_SSPTRI( &uplo, &n, ap, ipiv, work, &info );
+ LAPACK_SSPTRI( &lapack_option< UpLo >::value, &n, ap, ipiv, work, &info );
     return info;
 }
 
@@ -65,10 +66,11 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * double value-type.
 //
-inline std::ptrdiff_t sptri( const char uplo, const fortran_int_t n,
- double* ap, const fortran_int_t* ipiv, double* work ) {
+template< typename UpLo >
+inline std::ptrdiff_t sptri( UpLo, const fortran_int_t n, double* ap,
+ const fortran_int_t* ipiv, double* work ) {
     fortran_int_t info(0);
- LAPACK_DSPTRI( &uplo, &n, ap, ipiv, work, &info );
+ LAPACK_DSPTRI( &lapack_option< UpLo >::value, &n, ap, ipiv, work, &info );
     return info;
 }
 
@@ -77,11 +79,12 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
-inline std::ptrdiff_t sptri( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t sptri( UpLo, const fortran_int_t n,
         std::complex<float>* ap, const fortran_int_t* ipiv,
         std::complex<float>* work ) {
     fortran_int_t info(0);
- LAPACK_CSPTRI( &uplo, &n, ap, ipiv, work, &info );
+ LAPACK_CSPTRI( &lapack_option< UpLo >::value, &n, ap, ipiv, work, &info );
     return info;
 }
 
@@ -90,11 +93,12 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<double> value-type.
 //
-inline std::ptrdiff_t sptri( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t sptri( UpLo, const fortran_int_t n,
         std::complex<double>* ap, const fortran_int_t* ipiv,
         std::complex<double>* work ) {
     fortran_int_t info(0);
- LAPACK_ZSPTRI( &uplo, &n, ap, ipiv, work, &info );
+ LAPACK_ZSPTRI( &lapack_option< UpLo >::value, &n, ap, ipiv, work, &info );
     return info;
 }
 
@@ -123,14 +127,15 @@
     // * Asserts that most arguments make sense.
     //
     template< typename MatrixAP, typename VectorIPIV, typename WORK >
- static std::ptrdiff_t invoke( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, detail::workspace1< WORK > work ) {
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ detail::workspace1< WORK > work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         BOOST_STATIC_ASSERT( (is_mutable< MatrixAP >::value) );
         BOOST_ASSERT( size(ipiv) >= size_column(ap) );
         BOOST_ASSERT( size(work.select(real_type())) >= min_size_work(
                 size_column(ap) ));
         BOOST_ASSERT( size_column(ap) >= 0 );
- return detail::sptri( uplo, size_column(ap), begin_value(ap),
+ return detail::sptri( uplo(), size_column(ap), begin_value(ap),
                 begin_value(ipiv), begin_value(work.select(real_type())) );
     }
 
@@ -142,11 +147,12 @@
     // * Enables the unblocked algorithm (BLAS level 2)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, minimal_workspace work ) {
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ minimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         bindings::detail::array< real_type > tmp_work( min_size_work(
                 size_column(ap) ) );
- return invoke( uplo, ap, ipiv, workspace( tmp_work ) );
+ return invoke( ap, ipiv, workspace( tmp_work ) );
     }
 
     //
@@ -157,9 +163,10 @@
     // * Enables the blocked algorithm (BLAS level 3)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, optimal_workspace work ) {
- return invoke( uplo, ap, ipiv, minimal_workspace() );
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ optimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
+ return invoke( ap, ipiv, minimal_workspace() );
     }
 
     //
@@ -187,14 +194,15 @@
     // * Asserts that most arguments make sense.
     //
     template< typename MatrixAP, typename VectorIPIV, typename WORK >
- static std::ptrdiff_t invoke( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, detail::workspace1< WORK > work ) {
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ detail::workspace1< WORK > work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         BOOST_STATIC_ASSERT( (is_mutable< MatrixAP >::value) );
         BOOST_ASSERT( size(ipiv) >= size_column(ap) );
         BOOST_ASSERT( size(work.select(value_type())) >= min_size_work(
                 size_column(ap) ));
         BOOST_ASSERT( size_column(ap) >= 0 );
- return detail::sptri( uplo, size_column(ap), begin_value(ap),
+ return detail::sptri( uplo(), size_column(ap), begin_value(ap),
                 begin_value(ipiv), begin_value(work.select(value_type())) );
     }
 
@@ -206,11 +214,12 @@
     // * Enables the unblocked algorithm (BLAS level 2)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, minimal_workspace work ) {
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ minimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         bindings::detail::array< value_type > tmp_work( min_size_work(
                 size_column(ap) ) );
- return invoke( uplo, ap, ipiv, workspace( tmp_work ) );
+ return invoke( ap, ipiv, workspace( tmp_work ) );
     }
 
     //
@@ -221,9 +230,10 @@
     // * Enables the blocked algorithm (BLAS level 3)
     //
     template< typename MatrixAP, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, optimal_workspace work ) {
- return invoke( uplo, ap, ipiv, minimal_workspace() );
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ optimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
+ return invoke( ap, ipiv, minimal_workspace() );
     }
 
     //
@@ -251,10 +261,10 @@
 // * User-defined workspace
 //
 template< typename MatrixAP, typename VectorIPIV, typename Workspace >
-inline std::ptrdiff_t sptri( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv, Workspace work ) {
- return sptri_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, work );
+inline std::ptrdiff_t sptri( MatrixAP& ap, const VectorIPIV& ipiv,
+ Workspace work ) {
+ return sptri_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, work );
 }
 
 //
@@ -263,10 +273,9 @@
 // * Default workspace-type (optimal)
 //
 template< typename MatrixAP, typename VectorIPIV >
-inline std::ptrdiff_t sptri( const char uplo, MatrixAP& ap,
- const VectorIPIV& ipiv ) {
- return sptri_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, optimal_workspace() );
+inline std::ptrdiff_t sptri( MatrixAP& ap, const VectorIPIV& ipiv ) {
+ return sptri_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, optimal_workspace() );
 }
 
 //
@@ -275,10 +284,10 @@
 // * User-defined workspace
 //
 template< typename MatrixAP, typename VectorIPIV, typename Workspace >
-inline std::ptrdiff_t sptri( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, Workspace work ) {
- return sptri_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, work );
+inline std::ptrdiff_t sptri( const MatrixAP& ap, const VectorIPIV& ipiv,
+ Workspace work ) {
+ return sptri_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, work );
 }
 
 //
@@ -287,10 +296,9 @@
 // * Default workspace-type (optimal)
 //
 template< typename MatrixAP, typename VectorIPIV >
-inline std::ptrdiff_t sptri( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv ) {
- return sptri_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, optimal_workspace() );
+inline std::ptrdiff_t sptri( const MatrixAP& ap, const VectorIPIV& ipiv ) {
+ return sptri_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, optimal_workspace() );
 }
 
 } // namespace lapack

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sptrs.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sptrs.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sptrs.hpp 2010-01-13 09:13:31 EST (Wed, 13 Jan 2010)
@@ -48,11 +48,13 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * float value-type.
 //
-inline std::ptrdiff_t sptrs( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t sptrs( UpLo, const fortran_int_t n,
         const fortran_int_t nrhs, const float* ap, const fortran_int_t* ipiv,
         float* b, const fortran_int_t ldb ) {
     fortran_int_t info(0);
- LAPACK_SSPTRS( &uplo, &n, &nrhs, ap, ipiv, b, &ldb, &info );
+ LAPACK_SSPTRS( &lapack_option< UpLo >::value, &n, &nrhs, ap, ipiv, b,
+ &ldb, &info );
     return info;
 }
 
@@ -61,11 +63,13 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * double value-type.
 //
-inline std::ptrdiff_t sptrs( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t sptrs( UpLo, const fortran_int_t n,
         const fortran_int_t nrhs, const double* ap, const fortran_int_t* ipiv,
         double* b, const fortran_int_t ldb ) {
     fortran_int_t info(0);
- LAPACK_DSPTRS( &uplo, &n, &nrhs, ap, ipiv, b, &ldb, &info );
+ LAPACK_DSPTRS( &lapack_option< UpLo >::value, &n, &nrhs, ap, ipiv, b,
+ &ldb, &info );
     return info;
 }
 
@@ -74,12 +78,14 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
-inline std::ptrdiff_t sptrs( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t sptrs( UpLo, const fortran_int_t n,
         const fortran_int_t nrhs, const std::complex<float>* ap,
         const fortran_int_t* ipiv, std::complex<float>* b,
         const fortran_int_t ldb ) {
     fortran_int_t info(0);
- LAPACK_CSPTRS( &uplo, &n, &nrhs, ap, ipiv, b, &ldb, &info );
+ LAPACK_CSPTRS( &lapack_option< UpLo >::value, &n, &nrhs, ap, ipiv, b,
+ &ldb, &info );
     return info;
 }
 
@@ -88,12 +94,14 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<double> value-type.
 //
-inline std::ptrdiff_t sptrs( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t sptrs( UpLo, const fortran_int_t n,
         const fortran_int_t nrhs, const std::complex<double>* ap,
         const fortran_int_t* ipiv, std::complex<double>* b,
         const fortran_int_t ldb ) {
     fortran_int_t info(0);
- LAPACK_ZSPTRS( &uplo, &n, &nrhs, ap, ipiv, b, &ldb, &info );
+ LAPACK_ZSPTRS( &lapack_option< UpLo >::value, &n, &nrhs, ap, ipiv, b,
+ &ldb, &info );
     return info;
 }
 
@@ -116,8 +124,9 @@
     // * Asserts that most arguments make sense.
     //
     template< typename MatrixAP, typename VectorIPIV, typename MatrixB >
- static std::ptrdiff_t invoke( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, MatrixB& b ) {
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ MatrixB& b ) {
+ typedef typename result_of::data_side< MatrixAP >::type uplo;
         BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
                 typename value< MatrixAP >::type >::type,
                 typename remove_const< typename value<
@@ -129,7 +138,7 @@
         BOOST_ASSERT( size_minor(b) == 1 || stride_minor(b) == 1 );
         BOOST_ASSERT( stride_major(b) >= std::max< std::ptrdiff_t >(1,
                 size_column(ap)) );
- return detail::sptrs( uplo, size_column(ap), size_column(b),
+ return detail::sptrs( uplo(), size_column(ap), size_column(b),
                 begin_value(ap), begin_value(ipiv), begin_value(b),
                 stride_major(b) );
     }
@@ -151,10 +160,10 @@
 // * MatrixB&
 //
 template< typename MatrixAP, typename VectorIPIV, typename MatrixB >
-inline std::ptrdiff_t sptrs( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, MatrixB& b ) {
- return sptrs_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, b );
+inline std::ptrdiff_t sptrs( const MatrixAP& ap, const VectorIPIV& ipiv,
+ MatrixB& b ) {
+ return sptrs_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, b );
 }
 
 //
@@ -162,10 +171,10 @@
 // * const MatrixB&
 //
 template< typename MatrixAP, typename VectorIPIV, typename MatrixB >
-inline std::ptrdiff_t sptrs( const char uplo, const MatrixAP& ap,
- const VectorIPIV& ipiv, const MatrixB& b ) {
- return sptrs_impl< typename value< MatrixAP >::type >::invoke( uplo,
- ap, ipiv, b );
+inline std::ptrdiff_t sptrs( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const MatrixB& b ) {
+ return sptrs_impl< typename value< MatrixAP >::type >::invoke( ap,
+ ipiv, b );
 }
 
 } // namespace lapack

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sycon.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sycon.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/sycon.hpp 2010-01-13 09:13:31 EST (Wed, 13 Jan 2010)
@@ -53,12 +53,13 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * float value-type.
 //
-inline std::ptrdiff_t sycon( const char uplo, const fortran_int_t n,
- const float* a, const fortran_int_t lda, const fortran_int_t* ipiv,
- const float anorm, float& rcond, float* work, fortran_int_t* iwork ) {
+template< typename UpLo >
+inline std::ptrdiff_t sycon( UpLo, const fortran_int_t n, const float* a,
+ const fortran_int_t lda, const fortran_int_t* ipiv, const float anorm,
+ float& rcond, float* work, fortran_int_t* iwork ) {
     fortran_int_t info(0);
- LAPACK_SSYCON( &uplo, &n, a, &lda, ipiv, &anorm, &rcond, work, iwork,
- &info );
+ LAPACK_SSYCON( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, &anorm,
+ &rcond, work, iwork, &info );
     return info;
 }
 
@@ -67,13 +68,14 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * double value-type.
 //
-inline std::ptrdiff_t sycon( const char uplo, const fortran_int_t n,
- const double* a, const fortran_int_t lda, const fortran_int_t* ipiv,
+template< typename UpLo >
+inline std::ptrdiff_t sycon( UpLo, const fortran_int_t n, const double* a,
+ const fortran_int_t lda, const fortran_int_t* ipiv,
         const double anorm, double& rcond, double* work,
         fortran_int_t* iwork ) {
     fortran_int_t info(0);
- LAPACK_DSYCON( &uplo, &n, a, &lda, ipiv, &anorm, &rcond, work, iwork,
- &info );
+ LAPACK_DSYCON( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, &anorm,
+ &rcond, work, iwork, &info );
     return info;
 }
 
@@ -82,12 +84,14 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
-inline std::ptrdiff_t sycon( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t sycon( UpLo, const fortran_int_t n,
         const std::complex<float>* a, const fortran_int_t lda,
         const fortran_int_t* ipiv, const float anorm, float& rcond,
         std::complex<float>* work ) {
     fortran_int_t info(0);
- LAPACK_CSYCON( &uplo, &n, a, &lda, ipiv, &anorm, &rcond, work, &info );
+ LAPACK_CSYCON( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, &anorm,
+ &rcond, work, &info );
     return info;
 }
 
@@ -96,12 +100,14 @@
 // * netlib-compatible LAPACK backend (the default), and
 // * complex<double> value-type.
 //
-inline std::ptrdiff_t sycon( const char uplo, const fortran_int_t n,
+template< typename UpLo >
+inline std::ptrdiff_t sycon( UpLo, const fortran_int_t n,
         const std::complex<double>* a, const fortran_int_t lda,
         const fortran_int_t* ipiv, const double anorm, double& rcond,
         std::complex<double>* work ) {
     fortran_int_t info(0);
- LAPACK_ZSYCON( &uplo, &n, a, &lda, ipiv, &anorm, &rcond, work, &info );
+ LAPACK_ZSYCON( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, &anorm,
+ &rcond, work, &info );
     return info;
 }
 
@@ -131,9 +137,10 @@
     //
     template< typename MatrixA, typename VectorIPIV, typename WORK,
             typename IWORK >
- static std::ptrdiff_t invoke( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- detail::workspace2< WORK, IWORK > work ) {
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, detail::workspace2< WORK,
+ IWORK > work ) {
+ typedef typename result_of::data_side< MatrixA >::type uplo;
         BOOST_ASSERT( size(ipiv) >= size_column(a) );
         BOOST_ASSERT( size(work.select(fortran_int_t())) >=
                 min_size_iwork( size_column(a) ));
@@ -143,7 +150,7 @@
         BOOST_ASSERT( size_minor(a) == 1 || stride_minor(a) == 1 );
         BOOST_ASSERT( stride_major(a) >= std::max< std::ptrdiff_t >(1,
                 size_column(a)) );
- return detail::sycon( uplo, size_column(a), begin_value(a),
+ return detail::sycon( uplo(), size_column(a), begin_value(a),
                 stride_major(a), begin_value(ipiv), anorm, rcond,
                 begin_value(work.select(real_type())),
                 begin_value(work.select(fortran_int_t())) );
@@ -157,14 +164,14 @@
     // * Enables the unblocked algorithm (BLAS level 2)
     //
     template< typename MatrixA, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- minimal_workspace work ) {
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, minimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixA >::type uplo;
         bindings::detail::array< real_type > tmp_work( min_size_work(
                 size_column(a) ) );
         bindings::detail::array< fortran_int_t > tmp_iwork(
                 min_size_iwork( size_column(a) ) );
- return invoke( uplo, a, ipiv, anorm, rcond, workspace( tmp_work,
+ return invoke( a, ipiv, anorm, rcond, workspace( tmp_work,
                 tmp_iwork ) );
     }
 
@@ -176,10 +183,10 @@
     // * Enables the blocked algorithm (BLAS level 3)
     //
     template< typename MatrixA, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- optimal_workspace work ) {
- return invoke( uplo, a, ipiv, anorm, rcond, minimal_workspace() );
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, optimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixA >::type uplo;
+ return invoke( a, ipiv, anorm, rcond, minimal_workspace() );
     }
 
     //
@@ -215,9 +222,10 @@
     // * Asserts that most arguments make sense.
     //
     template< typename MatrixA, typename VectorIPIV, typename WORK >
- static std::ptrdiff_t invoke( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- detail::workspace1< WORK > work ) {
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, detail::workspace1<
+ WORK > work ) {
+ typedef typename result_of::data_side< MatrixA >::type uplo;
         BOOST_ASSERT( size(ipiv) >= size_column(a) );
         BOOST_ASSERT( size(work.select(value_type())) >= min_size_work(
                 size_column(a) ));
@@ -225,7 +233,7 @@
         BOOST_ASSERT( size_minor(a) == 1 || stride_minor(a) == 1 );
         BOOST_ASSERT( stride_major(a) >= std::max< std::ptrdiff_t >(1,
                 size_column(a)) );
- return detail::sycon( uplo, size_column(a), begin_value(a),
+ return detail::sycon( uplo(), size_column(a), begin_value(a),
                 stride_major(a), begin_value(ipiv), anorm, rcond,
                 begin_value(work.select(value_type())) );
     }
@@ -238,12 +246,12 @@
     // * Enables the unblocked algorithm (BLAS level 2)
     //
     template< typename MatrixA, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- minimal_workspace work ) {
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, minimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixA >::type uplo;
         bindings::detail::array< value_type > tmp_work( min_size_work(
                 size_column(a) ) );
- return invoke( uplo, a, ipiv, anorm, rcond, workspace( tmp_work ) );
+ return invoke( a, ipiv, anorm, rcond, workspace( tmp_work ) );
     }
 
     //
@@ -254,10 +262,10 @@
     // * Enables the blocked algorithm (BLAS level 3)
     //
     template< typename MatrixA, typename VectorIPIV >
- static std::ptrdiff_t invoke( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const real_type anorm, real_type& rcond,
- optimal_workspace work ) {
- return invoke( uplo, a, ipiv, anorm, rcond, minimal_workspace() );
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, optimal_workspace work ) {
+ typedef typename result_of::data_side< MatrixA >::type uplo;
+ return invoke( a, ipiv, anorm, rcond, minimal_workspace() );
     }
 
     //
@@ -284,13 +292,12 @@
 // * User-defined workspace
 //
 template< typename MatrixA, typename VectorIPIV, typename Workspace >
-inline std::ptrdiff_t sycon( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const typename remove_imaginary<
- typename value< MatrixA >::type >::type anorm,
- typename remove_imaginary< typename value<
- MatrixA >::type >::type& rcond, Workspace work ) {
- return sycon_impl< typename value< MatrixA >::type >::invoke( uplo,
- a, ipiv, anorm, rcond, work );
+inline std::ptrdiff_t sycon( const MatrixA& a, const VectorIPIV& ipiv,
+ const typename remove_imaginary< typename value<
+ MatrixA >::type >::type anorm, typename remove_imaginary<
+ typename value< MatrixA >::type >::type& rcond, Workspace work ) {
+ return sycon_impl< typename value< MatrixA >::type >::invoke( a,
+ ipiv, anorm, rcond, work );
 }
 
 //
@@ -298,13 +305,12 @@
 // * Default workspace-type (optimal)
 //
 template< typename MatrixA, typename VectorIPIV >
-inline std::ptrdiff_t sycon( const char uplo, const MatrixA& a,
- const VectorIPIV& ipiv, const typename remove_imaginary<
- typename value< MatrixA >::type >::type anorm,
- typename remove_imaginary< typename value<
- MatrixA >::type >::type& rcond ) {
- return sycon_impl< typename value< MatrixA >::type >::invoke( uplo,
- a, ipiv, anorm, rcond, optimal_workspace() );
+inline std::ptrdiff_t sycon( const MatrixA& a, const VectorIPIV& ipiv,
+ const typename remove_imaginary< typename value<
+ MatrixA >::type >::type anorm, typename remove_imaginary<
+ typename value< MatrixA >::type >::type& rcond ) {
+ return sycon_impl< typename value< MatrixA >::type >::invoke( a,
+ ipiv, anorm, rcond, optimal_workspace() );
 }
 
 } // namespace lapack


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