Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59216 - in sandbox/numeric_bindings: boost/numeric/bindings/blas/level1 libs/numeric/bindings/blas/test
From: thomas.klimpel_at_[hidden]
Date: 2010-01-21 19:52:03


Author: klimpel
Date: 2010-01-21 19:52:02 EST (Thu, 21 Jan 2010)
New Revision: 59216
URL: http://svn.boost.org/trac/boost/changeset/59216

Log:
updated blas regression tests for which the corresponding traits already existed (with cheating this time -> hand editing of asum.hpp and nrm2.hpp)
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/asum.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/nrm2.hpp | 2
   sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas1.cpp | 69 +++++++--------------------------
   sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas2.cpp | 27 +++++++-----
   sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas3.cpp | 81 ++++++++++++++++++---------------------
   5 files changed, 72 insertions(+), 109 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/asum.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/asum.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/asum.hpp 2010-01-21 19:52:02 EST (Thu, 21 Jan 2010)
@@ -186,7 +186,7 @@
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;
- typedef value_type return_type;
+ typedef real_type return_type;
 
     //
     // Static member function that

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/nrm2.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/nrm2.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/nrm2.hpp 2010-01-21 19:52:02 EST (Thu, 21 Jan 2010)
@@ -186,7 +186,7 @@
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;
- typedef value_type return_type;
+ typedef real_type return_type;
 
     //
     // Static member function that

Modified: sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas1.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas1.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas1.cpp 2010-01-21 19:52:02 EST (Thu, 21 Jan 2010)
@@ -8,12 +8,12 @@
 
 #include "random.hpp"
 
-#include <boost/numeric/ublas/vector_proxy.hpp>
-#include <boost/numeric/ublas/matrix_proxy.hpp>
+#include <boost/numeric/bindings/ublas/vector_proxy.hpp>
+#include <boost/numeric/bindings/ublas/matrix_proxy.hpp>
 #include <boost/numeric/ublas/blas.hpp>
-#include <boost/numeric/bindings/traits/ublas_vector.hpp>
-#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
-#include <boost/numeric/bindings/traits/std_vector.hpp>
+#include <boost/numeric/bindings/ublas/vector.hpp>
+#include <boost/numeric/bindings/ublas/matrix.hpp>
+#include <boost/numeric/bindings/std/vector.hpp>
 #include <boost/numeric/bindings/blas/level1/axpy.hpp>
 #include <boost/numeric/bindings/blas/level1/asum.hpp>
 #include <boost/numeric/bindings/blas/level1/copy.hpp>
@@ -31,43 +31,7 @@
 #include <limits>
 #include <cmath>
 
-namespace traits = boost::numeric::bindings::traits;
-
-struct apply_real {
- template< typename VectorX >
- static inline typename traits::type_traits< typename traits::vector_traits< VectorX >::value_type >::real_type
- asum( const VectorX& x ) {
- return boost::numeric::bindings::blas::asum( x );
- }
- template< typename VectorX >
- static inline typename traits::type_traits< typename traits::vector_traits< VectorX >::value_type >::real_type
- nrm2( const VectorX& x ) {
- return boost::numeric::bindings::blas::nrm2( x );
- }
-};
-
-struct apply_complex {
- template< typename VectorX >
- static inline typename traits::type_traits< typename traits::vector_traits< VectorX >::value_type >::real_type
- asum( const VectorX& x ) {
- return abs_sum( x );
- }
- template< typename VectorX >
- static inline typename traits::type_traits< typename traits::vector_traits< VectorX >::value_type >::real_type
- nrm2( const VectorX& x ) {
- using namespace std;
- typedef typename traits::vector_traits< VectorX >::value_type value_type;
- typedef typename traits::type_traits< value_type >::real_type real_type;
- real_type t = real_type();
- for (size_t i = 0, s = x.size(); i < s; ++ i) {
- real_type u = norm(x[i]);
- t += u;
- }
- return sqrt (t);
- }
-};
-
-
+namespace bindings = boost::numeric::bindings;
 
 // Randomize a vector (using functions from random.hpp)
 template <typename V>
@@ -98,8 +62,8 @@
 }
 
 template <typename V>
-typename boost::numeric::bindings::traits::type_traits<typename V::value_type>::real_type abs_sum( V const& v) {
- typedef typename boost::numeric::bindings::traits::type_traits<typename V::value_type>::real_type real_type ;
+typename bindings::remove_imaginary<typename V::value_type>::type abs_sum( V const& v) {
+ typedef typename bindings::remove_imaginary<typename V::value_type>::type real_type ;
 
   real_type sum( 0.0 ) ;
   for ( typename V::size_type i=0; i<v.size(); ++i ) {
@@ -123,24 +87,23 @@
 
   template <typename V>
   int operator()(V& v) const {
- typedef typename boost::mpl::if_<boost::is_complex<T>, apply_complex, apply_real>::type apply_t;
      using namespace boost::numeric::bindings::blas ;
 
      typedef typename V::value_type value_type ;
- typedef typename boost::numeric::bindings::traits::type_traits<value_type>::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
 
      // Copy vector from reference
      for (typename V::size_type i=0; i<v_ref_.size(); ++i)
         v[i] = v_ref_(i);
 
      // Test blas routines and compare with reference
- real_type nrm = apply_t::nrm2( v );
+ real_type nrm = nrm2( v );
      if ( std::abs(nrm - norm_2(v_ref_)) > std::numeric_limits< real_type >::epsilon() * norm_2(v_ref_)) {
        std::cout << "nrm2 : " << std::abs(nrm - norm_2(v_ref_)) << " > " << std::numeric_limits< real_type >::epsilon() * norm_2(v_ref_) << std::endl ;
        return 255 ;
      }
 
- nrm = apply_t::asum( v );
+ nrm = asum( v );
      if ( std::abs(nrm - abs_sum(v_ref_)) > std::numeric_limits< real_type >::epsilon() * abs_sum(v_ref_)) {
        std::cout << "asum : " << std::abs(nrm - abs_sum(v_ref_)) << " > " << std::numeric_limits< real_type >::epsilon() * abs_sum(v_ref_) << std::endl ;
        return 255 ;
@@ -162,7 +125,7 @@
 template <typename T, typename V>
 struct BaseTwoVectorOperations {
   typedef T value_type ;
- typedef typename boost::numeric::bindings::traits::type_traits<value_type>::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
   typedef boost::numeric::ublas::vector<T> ref_vector_type ;
 
   // Initialize: select the first vector and set the reference vectors (ublas)
@@ -197,7 +160,7 @@
 struct TwoVectorOperations< float, V>
 : BaseTwoVectorOperations<float,V> {
   typedef typename V::value_type value_type ;
- typedef typename boost::numeric::bindings::traits::type_traits<value_type>::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
   typedef typename BaseTwoVectorOperations<float,V>::ref_vector_type ref_vector_type ;
 
   TwoVectorOperations(V& v, const ref_vector_type& v1_ref, const ref_vector_type& v2_ref)
@@ -237,7 +200,7 @@
 struct TwoVectorOperations< double, V>
 : BaseTwoVectorOperations<double,V> {
   typedef typename V::value_type value_type ;
- typedef typename boost::numeric::bindings::traits::type_traits<value_type>::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
   typedef typename BaseTwoVectorOperations<double,V>::ref_vector_type ref_vector_type ;
 
   TwoVectorOperations(V& v, const ref_vector_type& v1_ref, const ref_vector_type& v2_ref)
@@ -278,7 +241,7 @@
 : BaseTwoVectorOperations< std::complex<float>, V>
 {
   typedef typename V::value_type value_type ;
- typedef typename boost::numeric::bindings::traits::type_traits<value_type>::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
   typedef typename BaseTwoVectorOperations<std::complex<float>,V>::ref_vector_type ref_vector_type ;
 
   TwoVectorOperations(V& v, const ref_vector_type& v1_ref, const ref_vector_type& v2_ref)
@@ -323,7 +286,7 @@
 : BaseTwoVectorOperations< std::complex<double>, V>
 {
   typedef typename V::value_type value_type ;
- typedef typename boost::numeric::bindings::traits::type_traits<value_type>::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
   typedef typename BaseTwoVectorOperations<std::complex<double>,V>::ref_vector_type ref_vector_type ;
 
   TwoVectorOperations(V& v, const ref_vector_type& v1_ref, const ref_vector_type& v2_ref)

Modified: sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas2.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas2.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas2.cpp 2010-01-21 19:52:02 EST (Thu, 21 Jan 2010)
@@ -14,25 +14,30 @@
 
 #include "blas.hpp"
 #include <boost/numeric/bindings/blas/level2/gemv.hpp>
-#include <boost/numeric/bindings/traits/transpose.hpp>
-#include <boost/numeric/bindings/traits/ublas_vector.hpp>
-#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
+#include <boost/numeric/bindings/trans.hpp>
+#include <boost/numeric/bindings/conj.hpp>
+#include <boost/numeric/bindings/ublas/vector.hpp>
+#include <boost/numeric/bindings/ublas/matrix.hpp>
+#include <boost/numeric/bindings/ublas/matrix_proxy.hpp>
 
 template < typename ValueType, typename MatrixType, typename VectorType >
 void test_gemv(std::ostream& os, int runs, int runs_i, int size, int size_i, char c, ValueType alpha, ValueType beta, MatrixType &a, VectorType& x, VectorType &y_native, VectorType &y_toblas)
 {
+ namespace bindings = boost::numeric::bindings;
   typedef typename VectorType::value_type value_type ;
 
   boost::timer t ;
- if ( c == boost::numeric::bindings::traits::NO_TRANSPOSE ) for(int i = 0 ; i < runs_i ; ++i ) y_native += alpha * numerics::prod( a, x) ;
- else if ( c == boost::numeric::bindings::traits::TRANSPOSE ) for(int i = 0 ; i < runs_i ; ++i ) y_native += alpha * numerics::prod( trans(a), x) ;
- else if ( c == boost::numeric::bindings::traits::CONJUGATE ) for(int i = 0 ; i < runs_i ; ++i ) y_native += alpha * numerics::prod( herm(a), x) ;
+ if ( c == 'N' ) for(int i = 0 ; i < runs_i ; ++i ) y_native += alpha * numerics::prod( a, x) ;
+ else if ( c == 'T' ) for(int i = 0 ; i < runs_i ; ++i ) y_native += alpha * numerics::prod( trans(a), x) ;
+ else if ( c == 'C' ) for(int i = 0 ; i < runs_i ; ++i ) y_native += alpha * numerics::prod( herm(a), x) ;
   else assert( 0 ) ;
   
   report< value_type >( os, runs, runs_i, size_i, t.elapsed() );
   
   t.restart() ;
- for(int i = 0 ; i < runs_i ; ++i ) boost::numeric::bindings::blas::gemv( c, alpha, a, x, beta, y_toblas ) ;
+ if ( c == 'N' ) for(int i = 0 ; i < runs_i ; ++i ) boost::numeric::bindings::blas::gemv( alpha, a, x, beta, y_toblas ) ;
+ else if ( c == 'T' ) for(int i = 0 ; i < runs_i ; ++i ) boost::numeric::bindings::blas::gemv( alpha, bindings::trans(a), x, beta, y_toblas ) ;
+ else if ( c == 'C' ) for(int i = 0 ; i < runs_i ; ++i ) boost::numeric::bindings::blas::gemv( alpha, bindings::conj(a), x, beta, y_toblas ) ;
   
   report< value_type >( os, runs, runs_i, size_i, t.elapsed() );
   
@@ -55,7 +60,7 @@
     numerics::vector< T > y_native( x ) ;
     numerics::vector< T > y_toblas( x ) ;
       
- test_gemv( os, runs, runs_i, size, size_i, boost::numeric::bindings::traits::NO_TRANSPOSE, alpha, beta, a, x, y_native, y_toblas );
+ test_gemv( os, runs, runs_i, size, size_i, 'N', alpha, beta, a, x, y_native, y_toblas );
   }
 };
 
@@ -75,7 +80,7 @@
     numerics::vector< T > y_native( x ) ;
     numerics::vector< T > y_toblas( x ) ;
       
- test_gemv( os, runs, runs_i, size, size_i, boost::numeric::bindings::traits::TRANSPOSE, alpha, beta, a, x, y_native, y_toblas );
+ test_gemv( os, runs, runs_i, size, size_i, 'T', alpha, beta, a, x, y_native, y_toblas );
   }
 };
 
@@ -95,7 +100,7 @@
     numerics::vector< T > y_native( x ) ;
     numerics::vector< T > y_toblas( x ) ;
       
- test_gemv( os, runs, runs_i, size, size_i, boost::numeric::bindings::traits::CONJUGATE, alpha, beta, a, x, y_native, y_toblas );
+ test_gemv( os, runs, runs_i, size, size_i, 'C', alpha, beta, a, x, y_native, y_toblas );
   }
 };
 
@@ -118,7 +123,7 @@
     numerics::vector< T > y_native( x ) ;
     numerics::vector< T > y_toblas( x ) ;
       
- test_gemv( os, runs, runs_i, size, size_i, boost::numeric::bindings::traits::NO_TRANSPOSE, alpha, beta, mr, x, y_native, y_toblas );
+ test_gemv( os, runs, runs_i, size, size_i, 'N', alpha, beta, mr, x, y_native, y_toblas );
   }
 };
 

Modified: sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas3.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas3.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/blas/test/blas3.cpp 2010-01-21 19:52:02 EST (Thu, 21 Jan 2010)
@@ -8,19 +8,16 @@
 
 #include "random.hpp"
 
-#include <boost/numeric/bindings/traits/transpose.hpp>
-#include <boost/numeric/bindings/traits/ublas_vector.hpp>
-#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
-#include <boost/numeric/bindings/traits/ublas_symmetric.hpp>
-#include <boost/numeric/bindings/traits/ublas_hermitian.hpp>
+#include <boost/numeric/bindings/trans.hpp>
+#include <boost/numeric/bindings/unit_upper.hpp>
 #include <boost/numeric/bindings/blas/level3/gemm.hpp>
 #include <boost/numeric/bindings/blas/level3/herk.hpp>
 #include <boost/numeric/bindings/blas/level3/syrk.hpp>
 #include <boost/numeric/bindings/blas/level3/trsm.hpp>
-#include <boost/numeric/ublas/matrix.hpp>
-#include <boost/numeric/ublas/matrix_proxy.hpp>
-#include <boost/numeric/ublas/symmetric.hpp>
-#include <boost/numeric/ublas/hermitian.hpp>
+#include <boost/numeric/bindings/ublas/matrix.hpp>
+#include <boost/numeric/bindings/ublas/matrix_proxy.hpp>
+#include <boost/numeric/bindings/ublas/symmetric.hpp>
+#include <boost/numeric/bindings/ublas/hermitian.hpp>
 #include <boost/numeric/ublas/triangular.hpp>
 #include <boost/numeric/ublas/io.hpp>
 #include <boost/type_traits/is_complex.hpp>
@@ -29,31 +26,29 @@
 #include <iostream>
 #include <complex>
 
-namespace traits = boost::numeric::bindings::traits;
+namespace bindings = boost::numeric::bindings;
 
 struct apply_real {
   template< typename MatrixA, typename MatrixC >
- static inline typename boost::numeric::bindings::blas::herk_impl< typename traits::matrix_traits<
- MatrixA >::value_type >::return_type
- herk( const char trans, const typename traits::type_traits<
- typename traits::matrix_traits<
- MatrixA >::value_type >::real_type alpha, const MatrixA& a,
- const typename traits::type_traits< typename traits::matrix_traits<
- MatrixA >::value_type >::real_type beta, MatrixC& c ) {
- return boost::numeric::bindings::blas::syrk( trans, alpha, a, beta, c );
+ static inline typename bindings::blas::herk_impl< typename bindings::value_type<
+ MatrixA >::type >::return_type
+ herk( const typename bindings::remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type alpha, const MatrixA& a,
+ const typename bindings::remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type beta, MatrixC& c ) {
+ return bindings::blas::syrk( alpha, a, beta, c );
   }
 };
 
 struct apply_complex {
   template< typename MatrixA, typename MatrixC >
- static inline typename boost::numeric::bindings::blas::herk_impl< typename traits::matrix_traits<
- MatrixA >::value_type >::return_type
- herk( const char trans, const typename traits::type_traits<
- typename traits::matrix_traits<
- MatrixA >::value_type >::real_type alpha, const MatrixA& a,
- const typename traits::type_traits< typename traits::matrix_traits<
- MatrixA >::value_type >::real_type beta, MatrixC& c ) {
- return boost::numeric::bindings::blas::herk( trans, alpha, a, beta, c );
+ static inline typename bindings::blas::herk_impl< typename bindings::value_type<
+ MatrixA >::type >::return_type
+ herk( const typename bindings::remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type alpha, const MatrixA& a,
+ const typename bindings::remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type beta, MatrixC& c ) {
+ return bindings::blas::herk( alpha, a, beta, c );
   }
 };
 
@@ -135,7 +130,7 @@
 struct Syrk2 {
    typedef typename M1::value_type value_type ;
    typedef boost::numeric::ublas::matrix<value_type, boost::numeric::ublas::column_major> ref_matrix_type ;
- typedef typename boost::numeric::bindings::traits::type_traits< value_type >::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
    typedef typename ref_matrix_type::size_type size_type ;
    typedef typename boost::mpl::if_<boost::is_complex<value_type>, apply_complex, apply_real>::type apply_t;
 
@@ -158,28 +153,28 @@
       c.assign( c_ref_ );
       //boost::numeric::bindings::blas::syrk( 'U', 'N', value_type(alpha), a_, value_type(beta), c ) ;
       symmetric_adaptor<M, upper> sc( c );
- boost::numeric::bindings::blas::syrk( 'N', value_type(alpha), a_, value_type(beta), sc ) ;
+ boost::numeric::bindings::blas::syrk( value_type(alpha), a_, value_type(beta), sc ) ;
       if ( norm_frobenius( upper_part( c - (beta*c_ref_ + alpha * prod( a_ref_, trans( a_ref_ ) ) ) ) )
> std::numeric_limits< real_type >::epsilon() * norm_frobenius( upper_part(c) ) ) return 255;
 
       c.assign( c_ref_ );
       symmetric_adaptor<M, upper> c_s( c );
       //boost::numeric::bindings::blas::syrk( 'U', 'N', value_type(alpha), a_, value_type(beta), c_s ) ;
- boost::numeric::bindings::blas::syrk( 'N', value_type(alpha), a_, value_type(beta), c_s ) ;
+ boost::numeric::bindings::blas::syrk( value_type(alpha), a_, value_type(beta), c_s ) ;
       if ( norm_frobenius( upper_part( c_s - (beta*c_ref_ + alpha * prod( a_ref_, trans( a_ref_ ) ) ) ) )
> std::numeric_limits< real_type >::epsilon() * norm_frobenius( upper_part(c_s) ) ) return 255;
 
       c.assign( c_ref_ );
       //boost::numeric::bindings::blas::herk( 'U', 'N', alpha, a_, beta, c ) ;
       hermitian_adaptor<M, upper> hc( c );
- apply_t::herk( 'N', alpha, a_, beta, hc ) ;
+ apply_t::herk( alpha, a_, beta, hc ) ;
       if ( norm_frobenius( upper_part( c - (beta*c_ref_ + alpha * prod( a_ref_, herm( a_ref_ ) ) ) ) )
> std::numeric_limits< real_type >::epsilon() * norm_frobenius( upper_part(c) ) ) return 255;
 
       c.assign( c_ref_ );
       hermitian_adaptor<M, upper> c_h( c );
       //boost::numeric::bindings::blas::herk( 'U', 'N', alpha, a_, beta, c_h ) ;
- apply_t::herk( 'N', alpha, a_, beta, c_h ) ;
+ apply_t::herk( alpha, a_, beta, c_h ) ;
       if ( norm_frobenius( upper_part( c_h - (beta*c_ref_ + alpha * prod( a_ref_, herm( a_ref_ ) ) ) ) )
> std::numeric_limits< real_type >::epsilon() * norm_frobenius( upper_part(c_h) ) ) return 255;
 
@@ -199,7 +194,7 @@
 struct Syrk1 {
    typedef T value_type ;
    typedef boost::numeric::ublas::matrix<value_type, boost::numeric::ublas::column_major> ref_matrix_type ;
- typedef typename boost::numeric::bindings::traits::type_traits< value_type >::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
    typedef typename ref_matrix_type::size_type size_type ;
 
    Syrk1()
@@ -227,7 +222,7 @@
 struct Gemm3 {
    typedef typename M1::value_type value_type ;
    typedef boost::numeric::ublas::matrix<value_type, boost::numeric::ublas::column_major> ref_matrix_type ;
- typedef typename boost::numeric::bindings::traits::type_traits< value_type >::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
    typedef typename ref_matrix_type::size_type size_type ;
 
    Gemm3(const M1& a, const M2& b,
@@ -245,7 +240,7 @@
       value_type alpha = 2.0 ;
       value_type beta = -3.0 ;
 
- boost::numeric::bindings::blas::gemm( 'N', 'N', alpha, a_, b_, beta, c ) ;
+ boost::numeric::bindings::blas::gemm( alpha, a_, b_, beta, c ) ;
       double safety_factor (1.5);
       if ( norm_frobenius( c - (beta*c_ref_ + alpha * prod( a_ref_, b_ref_ ) ) )
> safety_factor*std::numeric_limits< real_type >::epsilon() * norm_frobenius( c ) ) return 255;
@@ -267,7 +262,7 @@
 struct Gemm2 {
    typedef typename M1::value_type value_type ;
    typedef boost::numeric::ublas::matrix<value_type, boost::numeric::ublas::column_major> ref_matrix_type ;
- typedef typename boost::numeric::bindings::traits::type_traits< value_type >::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
    typedef typename ref_matrix_type::size_type size_type ;
 
    Gemm2(const M1& a, const ref_matrix_type& a_ref)
@@ -298,7 +293,7 @@
 struct Gemm1 {
    typedef T value_type ;
    typedef boost::numeric::ublas::matrix<value_type, boost::numeric::ublas::column_major> ref_matrix_type ;
- typedef typename boost::numeric::bindings::traits::type_traits< value_type >::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
    typedef typename ref_matrix_type::size_type size_type ;
 
    Gemm1()
@@ -326,7 +321,7 @@
 struct Trsm2 {
    typedef typename M1::value_type value_type ;
    typedef boost::numeric::ublas::matrix<value_type, boost::numeric::ublas::column_major> ref_matrix_type ;
- typedef typename boost::numeric::bindings::traits::type_traits< value_type >::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
    typedef typename ref_matrix_type::size_type size_type ;
 
    Trsm2(M1& c,
@@ -346,33 +341,33 @@
       a.assign( a_ref_ );
       //boost::numeric::bindings::blas::trsm( 'L', 'U', 'N', 'N', value_type(alpha), b_ref_, a ) ;
       symmetric_adaptor<const ref_matrix_type, upper> sb_ref( b_ref_ );
- boost::numeric::bindings::blas::trsm( 'L', 'N', 'N', value_type(alpha), sb_ref, a ) ;
+ boost::numeric::bindings::blas::trsm( bindings::tag::left(), value_type(alpha), sb_ref, a ) ;
       if ( norm_frobenius( alpha * a_ref_ - prod( upper_part(b_ref_), a ) )
> std::numeric_limits< real_type >::epsilon() * norm_frobenius( upper_part(b_ref_) ) * norm_frobenius( a) ) return 255;
 
       a.assign( a_ref_ );
       //boost::numeric::bindings::blas::trsm( 'R', 'U', 'N', 'N', value_type(alpha), c_, a ) ;
       symmetric_adaptor<const M1, upper> suc( c_ );
- boost::numeric::bindings::blas::trsm( 'R', 'N', 'N', value_type(alpha), suc, a ) ;
+ boost::numeric::bindings::blas::trsm( bindings::tag::right(), value_type(alpha), suc, a ) ;
       if ( norm_frobenius( alpha * a_ref_ - prod( a, upper_part(c_) ) )
> std::numeric_limits< real_type >::epsilon() * norm_frobenius( upper_part(c_) ) * norm_frobenius( a ) ) return 255;
 
       a.assign( a_ref_ );
       //boost::numeric::bindings::blas::trsm( 'R', 'L', 'N', 'N', value_type(alpha), c_, a ) ;
       symmetric_adaptor<const M1, lower> slc( c_ );
- boost::numeric::bindings::blas::trsm( 'R', 'N', 'N', value_type(alpha), slc, a ) ;
+ boost::numeric::bindings::blas::trsm( bindings::tag::right(), value_type(alpha), slc, a ) ;
       if ( norm_frobenius( alpha * a_ref_ - prod( a, lower_part(c_) ) )
> std::numeric_limits< real_type >::epsilon() * norm_frobenius( lower_part(c_) ) * norm_frobenius( a ) ) return 255;
 
       a.assign( a_ref_ );
       //boost::numeric::bindings::blas::trsm( 'L', 'U', 'T', 'N', value_type(alpha), b_ref_, a ) ;
- boost::numeric::bindings::blas::trsm( 'L', 'T', 'N', value_type(alpha), sb_ref, a ) ;
+ boost::numeric::bindings::blas::trsm( bindings::tag::left(), value_type(alpha), bindings::trans(sb_ref), a ) ;
       if ( norm_frobenius( alpha * a_ref_ - prod( trans(upper_part(b_ref_)), a ) )
> std::numeric_limits< real_type >::epsilon() * norm_frobenius( upper_part(b_ref_) ) * norm_frobenius( a) ) return 255;
 
       a.assign( a_ref_ );
       //boost::numeric::bindings::blas::trsm( 'L', 'U', 'N', 'U', value_type(alpha), b_ref_, a ) ;
- boost::numeric::bindings::blas::trsm( 'L', 'N', 'U', value_type(alpha), sb_ref, a ) ;
+ boost::numeric::bindings::blas::trsm( bindings::tag::left(), value_type(alpha), bindings::unit_upper(sb_ref), a ) ;
       if ( norm_frobenius( alpha * a_ref_ - prod( unit_upper_part(b_ref_), a ) )
> std::numeric_limits< real_type >::epsilon() * norm_frobenius( unit_upper_part(b_ref_) ) * norm_frobenius( a) ) return 255;
 
@@ -393,7 +388,7 @@
 struct Trsm1 {
    typedef T value_type ;
    typedef boost::numeric::ublas::matrix<value_type, boost::numeric::ublas::column_major> ref_matrix_type ;
- typedef typename boost::numeric::bindings::traits::type_traits< value_type >::real_type real_type ;
+ typedef typename bindings::remove_imaginary<value_type>::type real_type ;
    typedef typename ref_matrix_type::size_type size_type ;
 
    Trsm1()


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