Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54051 - sandbox/numeric_bindings/boost/numeric/bindings/atlas
From: j.ungermann_at_[hidden]
Date: 2009-06-18 03:07:29


Author: joernu76
Date: 2009-06-18 03:07:28 EDT (Thu, 18 Jun 2009)
New Revision: 54051
URL: http://svn.boost.org/trac/boost/changeset/54051

Log:
Added trsm function.

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/atlas/cblas3.hpp | 992 +++++++++++++++++++++------------------
   sandbox/numeric_bindings/boost/numeric/bindings/atlas/cblas3_overloads.hpp | 438 +++++++++-------
   2 files changed, 773 insertions(+), 657 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/atlas/cblas3.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/atlas/cblas3.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/atlas/cblas3.hpp 2009-06-18 03:07:28 EDT (Thu, 18 Jun 2009)
@@ -1,12 +1,12 @@
 /*
- *
- * Copyright (c) Kresimir Fresl 2002
+ *
+ * Copyright (c) Kresimir Fresl 2002
  *
  * 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)
  *
- * Author acknowledges the support of the Faculty of Civil Engineering,
+ * Author acknowledges the support of the Faculty of Civil Engineering,
  * University of Zagreb, Croatia.
  *
  */
@@ -23,53 +23,53 @@
 #include <boost/type_traits/same_traits.hpp>
 #include <boost/mpl/if.hpp>
 
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
 # include <boost/static_assert.hpp>
 #endif
 
-namespace boost { namespace numeric { namespace bindings {
+namespace boost { namespace numeric { namespace bindings {
 
   namespace atlas {
 
- // C <- alpha * op (A) * op (B) + beta * C
+ // C <- alpha * op (A) * op (B) + beta * C
     // op (A) == A || A^T || A^H
     template <typename T, typename MatrA, typename MatrB, typename MatrC>
     inline
- void gemm (CBLAS_TRANSPOSE const TransA, CBLAS_TRANSPOSE const TransB,
- T const& alpha, MatrA const& a, MatrB const& b,
+ void gemm (CBLAS_TRANSPOSE const TransA, CBLAS_TRANSPOSE const TransB,
+ T const& alpha, MatrA const& a, MatrB const& b,
                T const& beta, MatrC& c
                )
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrA>::matrix_structure,
+ typename traits::matrix_traits<MatrA>::matrix_structure,
         traits::general_t
- >::value));
+ >::value));
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrB>::matrix_structure,
+ typename traits::matrix_traits<MatrB>::matrix_structure,
         traits::general_t
- >::value));
+ >::value));
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrC>::matrix_structure,
+ typename traits::matrix_traits<MatrC>::matrix_structure,
         traits::general_t
- >::value));
+ >::value));
 
       BOOST_STATIC_ASSERT((boost::is_same<
         typename traits::matrix_traits<MatrA>::ordering_type,
         typename traits::matrix_traits<MatrB>::ordering_type
- >::value));
+ >::value));
       BOOST_STATIC_ASSERT((boost::is_same<
         typename traits::matrix_traits<MatrA>::ordering_type,
         typename traits::matrix_traits<MatrC>::ordering_type
- >::value));
-#endif
+ >::value));
+#endif
 
- assert (TransA == CblasNoTrans
- || TransA == CblasTrans
- || TransA == CblasConjTrans);
- assert (TransB == CblasNoTrans
- || TransB == CblasTrans
- || TransB == CblasConjTrans);
+ assert (TransA == CblasNoTrans
+ || TransA == CblasTrans
+ || TransA == CblasConjTrans);
+ assert (TransB == CblasNoTrans
+ || TransB == CblasTrans
+ || TransB == CblasConjTrans);
 
       int const m = TransA == CblasNoTrans
         ? traits::matrix_size1 (a)
@@ -79,16 +79,16 @@
         : traits::matrix_size1 (b);
       int const k = TransA == CblasNoTrans
         ? traits::matrix_size2 (a)
- : traits::matrix_size1 (a);
- assert (m == traits::matrix_size1 (c));
- assert (n == traits::matrix_size2 (c));
+ : traits::matrix_size1 (a);
+ assert (m == traits::matrix_size1 (c));
+ assert (n == traits::matrix_size2 (c));
 #ifndef NDEBUG
       int const k1 = TransB == CblasNoTrans
         ? traits::matrix_size1 (b)
         : traits::matrix_size2 (b);
- assert (k == k1);
+ assert (k == k1);
 #endif
- // .. what about AtlasConj?
+ // .. what about AtlasConj?
 
       CBLAS_ORDER const stor_ord
         = enum_cast<CBLAS_ORDER const>
@@ -96,98 +96,98 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
            typename traits::matrix_traits<MatrA>::ordering_type
 #else
- typename MatrA::orientation_category
-#endif
- >::value);
+ typename MatrA::orientation_category
+#endif
+ >::value);
 
- detail::gemm (stor_ord, TransA, TransB, m, n, k, alpha,
+ detail::gemm (stor_ord, TransA, TransB, m, n, k, alpha,
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (a),
+ traits::matrix_storage (a),
 #else
- traits::matrix_storage_const (a),
+ traits::matrix_storage_const (a),
 #endif
                     traits::leading_dimension (a),
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (b),
+ traits::matrix_storage (b),
 #else
- traits::matrix_storage_const (b),
+ traits::matrix_storage_const (b),
 #endif
                     traits::leading_dimension (b),
- beta,
- traits::matrix_storage (c),
- traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c),
+ traits::leading_dimension (c));
     }
 
 
- // C <- alpha * A * B + beta * C
+ // C <- alpha * A * B + beta * C
     template <typename T, typename MatrA, typename MatrB, typename MatrC>
     inline
- void gemm (T const& alpha, MatrA const& a, MatrB const& b,
- T const& beta, MatrC& c)
+ void gemm (T const& alpha, MatrA const& a, MatrB const& b,
+ T const& beta, MatrC& c)
     {
       gemm (CblasNoTrans, CblasNoTrans, alpha, a, b, beta, c) ;
     }
-
 
- // C <- A * B
+
+ // C <- A * B
     template <typename MatrA, typename MatrB, typename MatrC>
     inline
     void gemm (MatrA const& a, MatrB const& b, MatrC& c) {
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
- typedef typename traits::matrix_traits<MatrC>::value_type val_t;
+ typedef typename traits::matrix_traits<MatrC>::value_type val_t;
 #else
- typedef typename MatrC::value_type val_t;
-#endif
+ typedef typename MatrC::value_type val_t;
+#endif
       gemm (CblasNoTrans, CblasNoTrans, (val_t) 1, a, b, (val_t) 0, c);
     }
 
 
 
- // C <- alpha * A * B + beta * C
- // C <- alpha * B * A + beta * C
+ // C <- alpha * A * B + beta * C
+ // C <- alpha * B * A + beta * C
     // A == A^T
 
     namespace detail {
 
       template <typename T, typename SymmA, typename MatrB, typename MatrC>
       inline
- void symm (CBLAS_SIDE const side, CBLAS_UPLO const uplo,
- T const& alpha, SymmA const& a, MatrB const& b,
+ void symm (CBLAS_SIDE const side, CBLAS_UPLO const uplo,
+ T const& alpha, SymmA const& a, MatrB const& b,
                  T const& beta, MatrC& c)
       {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
         BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrB>::matrix_structure,
+ typename traits::matrix_traits<MatrB>::matrix_structure,
           traits::general_t
>::value));
         BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrC>::matrix_structure,
+ typename traits::matrix_traits<MatrC>::matrix_structure,
           traits::general_t
- >::value));
+ >::value));
 
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<SymmA>::ordering_type,
           typename traits::matrix_traits<MatrB>::ordering_type
- >::value));
+ >::value));
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<SymmA>::ordering_type,
           typename traits::matrix_traits<MatrC>::ordering_type
- >::value));
-#endif
+ >::value));
+#endif
 
         assert (side == CblasLeft || side == CblasRight);
- assert (uplo == CblasUpper || uplo == CblasLower);
+ assert (uplo == CblasUpper || uplo == CblasLower);
 
         int const m = traits::matrix_size1 (c);
         int const n = traits::matrix_size2 (c);
 
- assert (side == CblasLeft
- ? m == traits::matrix_size1 (a)
+ assert (side == CblasLeft
+ ? m == traits::matrix_size1 (a)
                   && m == traits::matrix_size2 (a)
- : n == traits::matrix_size1 (a)
- && n == traits::matrix_size2 (a));
- assert (m == traits::matrix_size1 (b)
- && n == traits::matrix_size2 (b));
+ : n == traits::matrix_size1 (a)
+ && n == traits::matrix_size2 (a));
+ assert (m == traits::matrix_size1 (b)
+ && n == traits::matrix_size2 (b));
 
         CBLAS_ORDER const stor_ord
           = enum_cast<CBLAS_ORDER const>
@@ -195,62 +195,62 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
             typename traits::matrix_traits<SymmA>::ordering_type
 #else
- typename SymmA::orientation_category
-#endif
- >::value);
+ typename SymmA::orientation_category
+#endif
+ >::value);
 
- symm (stor_ord, side, uplo,
- m, n, alpha,
+ symm (stor_ord, side, uplo,
+ m, n, alpha,
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (a),
+ traits::matrix_storage (a),
 #else
- traits::matrix_storage_const (a),
+ traits::matrix_storage_const (a),
 #endif
               traits::leading_dimension (a),
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (b),
+ traits::matrix_storage (b),
 #else
- traits::matrix_storage_const (b),
+ traits::matrix_storage_const (b),
 #endif
               traits::leading_dimension (b),
- beta,
- traits::matrix_storage (c),
- traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c),
+ traits::leading_dimension (c));
       }
 
- } // detail
-
- // C <- alpha * A * B + beta * C
- // C <- alpha * B * A + beta * C
+ } // detail
+
+ // C <- alpha * A * B + beta * C
+ // C <- alpha * B * A + beta * C
     // A == A^T
     template <typename T, typename SymmA, typename MatrB, typename MatrC>
     inline
- void symm (CBLAS_SIDE const side, CBLAS_UPLO const uplo,
- T const& alpha, SymmA const& a, MatrB const& b,
+ void symm (CBLAS_SIDE const side, CBLAS_UPLO const uplo,
+ T const& alpha, SymmA const& a, MatrB const& b,
                T const& beta, MatrC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<SymmA>::matrix_structure,
+ typename traits::matrix_traits<SymmA>::matrix_structure,
         traits::general_t
- >::value));
-#endif
+ >::value));
+#endif
 
- detail::symm (side, uplo, alpha, a, b, beta, c);
+ detail::symm (side, uplo, alpha, a, b, beta, c);
     }
 
     template <typename T, typename SymmA, typename MatrB, typename MatrC>
     inline
- void symm (CBLAS_SIDE const side,
- T const& alpha, SymmA const& a, MatrB const& b,
+ void symm (CBLAS_SIDE const side,
+ T const& alpha, SymmA const& a, MatrB const& b,
                T const& beta, MatrC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<SymmA>::matrix_structure,
+ typename traits::matrix_traits<SymmA>::matrix_structure,
         traits::symmetric_t
- >::value));
-#endif
+ >::value));
+#endif
 
       CBLAS_UPLO const uplo
         = enum_cast<CBLAS_UPLO const>
@@ -258,11 +258,11 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
           typename traits::matrix_traits<SymmA>::uplo_type
 #else
- typename SymmA::packed_category
-#endif
- >::value);
+ typename SymmA::packed_category
+#endif
+ >::value);
 
- detail::symm (side, uplo, alpha, a, b, beta, c);
+ detail::symm (side, uplo, alpha, a, b, beta, c);
     }
 
 
@@ -273,140 +273,140 @@
       // C <- alpha * A * B + beta * C ; A == A^T
       struct symm_left {
         template <typename T, typename SymmA, typename MatrB, typename MatrC>
- static void f (T const& alpha, SymmA const& a, MatrB const& b,
- T const& beta, MatrC& c)
+ static void f (T const& alpha, SymmA const& a, MatrB const& b,
+ T const& beta, MatrC& c)
         {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
           BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<SymmA>::matrix_structure,
+ typename traits::matrix_traits<SymmA>::matrix_structure,
             traits::symmetric_t
- >::value));
+ >::value));
           BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrB>::matrix_structure,
+ typename traits::matrix_traits<MatrB>::matrix_structure,
             traits::general_t
>::value));
-#endif
+#endif
 
           int const m = traits::matrix_size1 (c);
           int const n = traits::matrix_size2 (c);
 
- assert (m == traits::matrix_size1 (a)
- && m == traits::matrix_size2 (a));
- assert (m == traits::matrix_size1 (b)
- && n == traits::matrix_size2 (b));
+ assert (m == traits::matrix_size1 (a)
+ && m == traits::matrix_size2 (a));
+ assert (m == traits::matrix_size1 (b)
+ && n == traits::matrix_size2 (b));
 
           CBLAS_ORDER const stor_ord
             = enum_cast<CBLAS_ORDER const>
             (storage_order<
               typename traits::matrix_traits<SymmA>::ordering_type
- >::value);
+ >::value);
 
           CBLAS_UPLO const uplo
             = enum_cast<CBLAS_UPLO const>
             (uplo_triang<
               typename traits::matrix_traits<SymmA>::uplo_type
- >::value);
+ >::value);
 
- symm (stor_ord, CblasLeft, uplo,
- m, n, alpha,
+ symm (stor_ord, CblasLeft, uplo,
+ m, n, alpha,
                 traits::matrix_storage (a), traits::leading_dimension (a),
                 traits::matrix_storage (b), traits::leading_dimension (b),
- beta,
- traits::matrix_storage (c), traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c), traits::leading_dimension (c));
         }
- };
+ };
 
       // C <- alpha * A * B + beta * C ; B == B^T
       struct symm_right {
         template <typename T, typename MatrA, typename SymmB, typename MatrC>
- static void f (T const& alpha, MatrA const& a, SymmB const& b,
- T const& beta, MatrC& c)
+ static void f (T const& alpha, MatrA const& a, SymmB const& b,
+ T const& beta, MatrC& c)
         {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
           BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrA>::matrix_structure,
+ typename traits::matrix_traits<MatrA>::matrix_structure,
             traits::general_t
>::value));
           BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<SymmB>::matrix_structure,
+ typename traits::matrix_traits<SymmB>::matrix_structure,
             traits::symmetric_t
>::value));
-#endif
+#endif
 
           int const m = traits::matrix_size1 (c);
           int const n = traits::matrix_size2 (c);
 
- assert (n == traits::matrix_size1 (b)
- && n == traits::matrix_size2 (b));
- assert (m == traits::matrix_size1 (a)
- && n == traits::matrix_size2 (a));
+ assert (n == traits::matrix_size1 (b)
+ && n == traits::matrix_size2 (b));
+ assert (m == traits::matrix_size1 (a)
+ && n == traits::matrix_size2 (a));
 
           CBLAS_ORDER const stor_ord
             = enum_cast<CBLAS_ORDER const>
             (storage_order<
               typename traits::matrix_traits<SymmB>::ordering_type
- >::value);
-
+ >::value);
+
           CBLAS_UPLO const uplo
             = enum_cast<CBLAS_UPLO const>
             (uplo_triang<
               typename traits::matrix_traits<SymmB>::uplo_type
- >::value);
+ >::value);
 
- symm (stor_ord, CblasRight, uplo,
- m, n, alpha,
+ symm (stor_ord, CblasRight, uplo,
+ m, n, alpha,
                 traits::matrix_storage (b), traits::leading_dimension (b),
                 traits::matrix_storage (a), traits::leading_dimension (a),
- beta,
- traits::matrix_storage (c), traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c), traits::leading_dimension (c));
         }
- };
+ };
+
+ } // detail
 
- } // detail
-
- // C <- alpha * A * B + beta * C
- // C <- alpha * B * A + beta * C
+ // C <- alpha * A * B + beta * C
+ // C <- alpha * B * A + beta * C
     // A == A^T
     template <typename T, typename MatrA, typename MatrB, typename MatrC>
     inline
- void symm (T const& alpha, MatrA const& a, MatrB const& b,
+ void symm (T const& alpha, MatrA const& a, MatrB const& b,
                T const& beta, MatrC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrC>::matrix_structure,
+ typename traits::matrix_traits<MatrC>::matrix_structure,
         traits::general_t
- >::value));
+ >::value));
 
       BOOST_STATIC_ASSERT((boost::is_same<
         typename traits::matrix_traits<MatrA>::ordering_type,
         typename traits::matrix_traits<MatrB>::ordering_type
- >::value));
+ >::value));
       BOOST_STATIC_ASSERT((boost::is_same<
         typename traits::matrix_traits<MatrA>::ordering_type,
         typename traits::matrix_traits<MatrC>::ordering_type
- >::value));
-#endif
+ >::value));
+#endif
 
       typedef typename
         boost::mpl::if_c<
           boost::is_same<
- typename traits::matrix_traits<MatrA>::matrix_structure,
+ typename traits::matrix_traits<MatrA>::matrix_structure,
             traits::symmetric_t
>::value,
- detail::symm_left,
+ detail::symm_left,
           detail::symm_right
- >::type functor;
+ >::type functor;
 
- functor::f (alpha, a, b, beta, c);
+ functor::f (alpha, a, b, beta, c);
     }
 
- // C <- A * B
- // C <- B * A
+ // C <- A * B
+ // C <- B * A
     template <typename MatrA, typename MatrB, typename MatrC>
     inline
     void symm (MatrA const& a, MatrB const& b, MatrC& c) {
- typedef typename traits::matrix_traits<MatrC>::value_type val_t;
+ typedef typename traits::matrix_traits<MatrC>::value_type val_t;
       symm ((val_t) 1, a, b, (val_t) 0, c);
     }
 
@@ -414,51 +414,51 @@
 
 
 
- // C <- alpha * A * B + beta * C
- // C <- alpha * B * A + beta * C
+ // C <- alpha * A * B + beta * C
+ // C <- alpha * B * A + beta * C
     // A == A^H
 
     namespace detail {
 
       template <typename T, typename HermA, typename MatrB, typename MatrC>
       inline
- void hemm (CBLAS_SIDE const side, CBLAS_UPLO const uplo,
- T const& alpha, HermA const& a, MatrB const& b,
+ void hemm (CBLAS_SIDE const side, CBLAS_UPLO const uplo,
+ T const& alpha, HermA const& a, MatrB const& b,
                  T const& beta, MatrC& c)
       {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
         BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrB>::matrix_structure,
+ typename traits::matrix_traits<MatrB>::matrix_structure,
           traits::general_t
>::value));
         BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrC>::matrix_structure,
+ typename traits::matrix_traits<MatrC>::matrix_structure,
           traits::general_t
- >::value));
+ >::value));
 
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<HermA>::ordering_type,
           typename traits::matrix_traits<MatrB>::ordering_type
- >::value));
+ >::value));
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<HermA>::ordering_type,
           typename traits::matrix_traits<MatrC>::ordering_type
- >::value));
-#endif
+ >::value));
+#endif
 
         assert (side == CblasLeft || side == CblasRight);
- assert (uplo == CblasUpper || uplo == CblasLower);
+ assert (uplo == CblasUpper || uplo == CblasLower);
 
         int const m = traits::matrix_size1 (c);
         int const n = traits::matrix_size2 (c);
 
- assert (side == CblasLeft
- ? m == traits::matrix_size1 (a)
+ assert (side == CblasLeft
+ ? m == traits::matrix_size1 (a)
                   && m == traits::matrix_size2 (a)
- : n == traits::matrix_size1 (a)
- && n == traits::matrix_size2 (a));
- assert (m == traits::matrix_size1 (b)
- && n == traits::matrix_size2 (b));
+ : n == traits::matrix_size1 (a)
+ && n == traits::matrix_size2 (a));
+ assert (m == traits::matrix_size1 (b)
+ && n == traits::matrix_size2 (b));
 
         CBLAS_ORDER const stor_ord
           = enum_cast<CBLAS_ORDER const>
@@ -466,62 +466,62 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
             typename traits::matrix_traits<HermA>::ordering_type
 #else
- typename HermA::orientation_category
-#endif
- >::value);
+ typename HermA::orientation_category
+#endif
+ >::value);
 
- hemm (stor_ord, side, uplo,
- m, n, alpha,
+ hemm (stor_ord, side, uplo,
+ m, n, alpha,
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (a),
+ traits::matrix_storage (a),
 #else
- traits::matrix_storage_const (a),
+ traits::matrix_storage_const (a),
 #endif
               traits::leading_dimension (a),
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (b),
+ traits::matrix_storage (b),
 #else
- traits::matrix_storage_const (b),
+ traits::matrix_storage_const (b),
 #endif
               traits::leading_dimension (b),
- beta,
- traits::matrix_storage (c),
- traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c),
+ traits::leading_dimension (c));
       }
 
- } // detail
-
- // C <- alpha * A * B + beta * C
- // C <- alpha * B * A + beta * C
+ } // detail
+
+ // C <- alpha * A * B + beta * C
+ // C <- alpha * B * A + beta * C
     // A == A^H
     template <typename T, typename HermA, typename MatrB, typename MatrC>
     inline
- void hemm (CBLAS_SIDE const side, CBLAS_UPLO const uplo,
- T const& alpha, HermA const& a, MatrB const& b,
+ void hemm (CBLAS_SIDE const side, CBLAS_UPLO const uplo,
+ T const& alpha, HermA const& a, MatrB const& b,
                T const& beta, MatrC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<HermA>::matrix_structure,
+ typename traits::matrix_traits<HermA>::matrix_structure,
         traits::general_t
- >::value));
-#endif
+ >::value));
+#endif
 
- detail::hemm (side, uplo, alpha, a, b, beta, c);
+ detail::hemm (side, uplo, alpha, a, b, beta, c);
     }
 
     template <typename T, typename HermA, typename MatrB, typename MatrC>
     inline
- void hemm (CBLAS_SIDE const side,
- T const& alpha, HermA const& a, MatrB const& b,
+ void hemm (CBLAS_SIDE const side,
+ T const& alpha, HermA const& a, MatrB const& b,
                T const& beta, MatrC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<HermA>::matrix_structure,
+ typename traits::matrix_traits<HermA>::matrix_structure,
         traits::hermitian_t
- >::value));
-#endif
+ >::value));
+#endif
 
       CBLAS_UPLO const uplo
         = enum_cast<CBLAS_UPLO const>
@@ -529,11 +529,11 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
           typename traits::matrix_traits<HermA>::uplo_type
 #else
- typename HermA::packed_category
-#endif
- >::value);
+ typename HermA::packed_category
+#endif
+ >::value);
 
- detail::hemm (side, uplo, alpha, a, b, beta, c);
+ detail::hemm (side, uplo, alpha, a, b, beta, c);
     }
 
 
@@ -544,143 +544,143 @@
       // C <- alpha * A * B + beta * C ; A == A^H
       struct hemm_left {
         template <typename T, typename HermA, typename MatrB, typename MatrC>
- static void f (T const& alpha, HermA const& a, MatrB const& b,
- T const& beta, MatrC& c)
+ static void f (T const& alpha, HermA const& a, MatrB const& b,
+ T const& beta, MatrC& c)
         {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
           BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<HermA>::matrix_structure,
+ typename traits::matrix_traits<HermA>::matrix_structure,
             traits::hermitian_t
- >::value));
+ >::value));
           BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrB>::matrix_structure,
+ typename traits::matrix_traits<MatrB>::matrix_structure,
             traits::general_t
>::value));
-#endif
+#endif
 
           int const m = traits::matrix_size1 (c);
           int const n = traits::matrix_size2 (c);
 
- assert (m == traits::matrix_size1 (a)
- && m == traits::matrix_size2 (a));
- assert (m == traits::matrix_size1 (b)
- && n == traits::matrix_size2 (b));
+ assert (m == traits::matrix_size1 (a)
+ && m == traits::matrix_size2 (a));
+ assert (m == traits::matrix_size1 (b)
+ && n == traits::matrix_size2 (b));
 
           CBLAS_ORDER const stor_ord
             = enum_cast<CBLAS_ORDER const>
             (storage_order<
               typename traits::matrix_traits<HermA>::ordering_type
- >::value);
+ >::value);
 
           CBLAS_UPLO const uplo
             = enum_cast<CBLAS_UPLO const>
             (uplo_triang<
               typename traits::matrix_traits<HermA>::uplo_type
- >::value);
+ >::value);
 
- hemm (stor_ord, CblasLeft, uplo,
- m, n, alpha,
+ hemm (stor_ord, CblasLeft, uplo,
+ m, n, alpha,
                 traits::matrix_storage (a), traits::leading_dimension (a),
                 traits::matrix_storage (b), traits::leading_dimension (b),
- beta,
- traits::matrix_storage (c), traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c), traits::leading_dimension (c));
         }
- };
+ };
 
       // C <- alpha * A * B + beta * C ; B == B^H
       struct hemm_right {
         template <typename T, typename MatrA, typename HermB, typename MatrC>
- static void f (T const& alpha, MatrA const& a, HermB const& b,
- T const& beta, MatrC& c)
+ static void f (T const& alpha, MatrA const& a, HermB const& b,
+ T const& beta, MatrC& c)
         {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
           BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrA>::matrix_structure,
+ typename traits::matrix_traits<MatrA>::matrix_structure,
             traits::general_t
>::value));
           BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<HermB>::matrix_structure,
+ typename traits::matrix_traits<HermB>::matrix_structure,
             traits::hermitian_t
>::value));
-#endif
+#endif
 
           int const m = traits::matrix_size1 (c);
           int const n = traits::matrix_size2 (c);
 
- assert (n == traits::matrix_size1 (b)
- && n == traits::matrix_size2 (b));
- assert (m == traits::matrix_size1 (a)
- && n == traits::matrix_size2 (a));
+ assert (n == traits::matrix_size1 (b)
+ && n == traits::matrix_size2 (b));
+ assert (m == traits::matrix_size1 (a)
+ && n == traits::matrix_size2 (a));
 
           CBLAS_ORDER const stor_ord
             = enum_cast<CBLAS_ORDER const>
             (storage_order<
               typename traits::matrix_traits<HermB>::ordering_type
- >::value);
-
+ >::value);
+
           CBLAS_UPLO const uplo
             = enum_cast<CBLAS_UPLO const>
             (uplo_triang<
               typename traits::matrix_traits<HermB>::uplo_type
- >::value);
+ >::value);
 
- hemm (stor_ord, CblasRight, uplo,
- m, n, alpha,
+ hemm (stor_ord, CblasRight, uplo,
+ m, n, alpha,
                 traits::matrix_storage (b), traits::leading_dimension (b),
                 traits::matrix_storage (a), traits::leading_dimension (a),
- beta,
- traits::matrix_storage (c), traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c), traits::leading_dimension (c));
         }
- };
+ };
+
+ }
 
- }
-
     template <typename T, typename MatrA, typename MatrB, typename MatrC>
     inline
- void hemm (T const& alpha, MatrA const& a, MatrB const& b,
+ void hemm (T const& alpha, MatrA const& a, MatrB const& b,
                T const& beta, MatrC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrC>::matrix_structure,
+ typename traits::matrix_traits<MatrC>::matrix_structure,
         traits::general_t
- >::value));
+ >::value));
 
       BOOST_STATIC_ASSERT((boost::is_same<
         typename traits::matrix_traits<MatrA>::ordering_type,
         typename traits::matrix_traits<MatrB>::ordering_type
- >::value));
+ >::value));
       BOOST_STATIC_ASSERT((boost::is_same<
         typename traits::matrix_traits<MatrA>::ordering_type,
         typename traits::matrix_traits<MatrC>::ordering_type
- >::value));
-#endif
+ >::value));
+#endif
 
       typedef typename
         boost::mpl::if_c<
           boost::is_same<
- typename traits::matrix_traits<MatrA>::matrix_structure,
+ typename traits::matrix_traits<MatrA>::matrix_structure,
             traits::hermitian_t
>::value,
- detail::hemm_left,
+ detail::hemm_left,
           detail::hemm_right
- >::type functor;
+ >::type functor;
 
- functor::f (alpha, a, b, beta, c);
+ functor::f (alpha, a, b, beta, c);
     }
 
- // C <- A * B
- // C <- B * A
+ // C <- A * B
+ // C <- B * A
     template <typename MatrA, typename MatrB, typename MatrC>
     inline
     void hemm (MatrA const& a, MatrB const& b, MatrC& c) {
- typedef typename traits::matrix_traits<MatrC>::value_type val_t;
+ typedef typename traits::matrix_traits<MatrC>::value_type val_t;
       hemm ((val_t) 1, a, b, (val_t) 0, c);
     }
 
 #endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
 
-
+
     // C <- alpha * A * A^T + beta * C
     // C <- alpha * A^T * A + beta * C
     // C == C^T
@@ -689,35 +689,35 @@
 
       template <typename T, typename MatrA, typename SymmC>
       inline
- void syrk (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
- T const& alpha, MatrA const& a,
+ void syrk (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
+ T const& alpha, MatrA const& a,
                  T const& beta, SymmC& c)
       {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
         BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrA>::matrix_structure,
+ typename traits::matrix_traits<MatrA>::matrix_structure,
           traits::general_t
>::value));
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<MatrA>::ordering_type,
           typename traits::matrix_traits<SymmC>::ordering_type
- >::value));
-#endif
+ >::value));
+#endif
 
- assert (uplo == CblasUpper || uplo == CblasLower);
- assert (trans == CblasNoTrans
- || trans == CblasTrans
- || trans == CblasConjTrans);
+ assert (uplo == CblasUpper || uplo == CblasLower);
+ assert (trans == CblasNoTrans
+ || trans == CblasTrans
+ || trans == CblasConjTrans);
 
         int const n = traits::matrix_size1 (c);
- assert (n == traits::matrix_size2 (c));
-
+ assert (n == traits::matrix_size2 (c));
+
         int const k = trans == CblasNoTrans
           ? traits::matrix_size2 (a)
- : traits::matrix_size1 (a);
+ : traits::matrix_size1 (a);
         assert (n == (trans == CblasNoTrans
                       ? traits::matrix_size1 (a)
- : traits::matrix_size2 (a)));
+ : traits::matrix_size2 (a)));
 
         CBLAS_ORDER const stor_ord
           = enum_cast<CBLAS_ORDER const>
@@ -725,56 +725,56 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
             typename traits::matrix_traits<SymmC>::ordering_type
 #else
- typename SymmC::orientation_category
-#endif
- >::value);
+ typename SymmC::orientation_category
+#endif
+ >::value);
 
- syrk (stor_ord, uplo, trans,
- n, k, alpha,
+ syrk (stor_ord, uplo, trans,
+ n, k, alpha,
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (a),
+ traits::matrix_storage (a),
 #else
- traits::matrix_storage_const (a),
+ traits::matrix_storage_const (a),
 #endif
               traits::leading_dimension (a),
- beta,
- traits::matrix_storage (c),
- traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c),
+ traits::leading_dimension (c));
       }
 
- } // detail
-
+ } // detail
+
     // C <- alpha * A * A^T + beta * C
     // C <- alpha * A^T * A + beta * C
     // C == C^T
     template <typename T, typename MatrA, typename SymmC>
     inline
- void syrk (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
- T const& alpha, MatrA const& a,
+ void syrk (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
+ T const& alpha, MatrA const& a,
                T const& beta, SymmC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<SymmC>::matrix_structure,
+ typename traits::matrix_traits<SymmC>::matrix_structure,
         traits::general_t
- >::value));
-#endif
+ >::value));
+#endif
 
- detail::syrk (uplo, trans, alpha, a, beta, c);
+ detail::syrk (uplo, trans, alpha, a, beta, c);
     }
 
     template <typename T, typename MatrA, typename SymmC>
     inline
- void syrk (CBLAS_TRANSPOSE trans,
- T const& alpha, MatrA const& a,
+ void syrk (CBLAS_TRANSPOSE trans,
+ T const& alpha, MatrA const& a,
                T const& beta, SymmC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<SymmC>::matrix_structure,
+ typename traits::matrix_traits<SymmC>::matrix_structure,
         traits::symmetric_t
- >::value));
-#endif
+ >::value));
+#endif
 
       CBLAS_UPLO const uplo
         = enum_cast<CBLAS_UPLO const>
@@ -782,11 +782,11 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
           typename traits::matrix_traits<SymmC>::uplo_type
 #else
- typename SymmC::packed_category
-#endif
- >::value);
+ typename SymmC::packed_category
+#endif
+ >::value);
 
- detail::syrk (uplo, trans, alpha, a, beta, c);
+ detail::syrk (uplo, trans, alpha, a, beta, c);
     }
 
     // C <- A * A^T + C
@@ -795,14 +795,14 @@
     inline
     void syrk (CBLAS_TRANSPOSE trans, MatrA const& a, SymmC& c) {
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
- typedef typename traits::matrix_traits<SymmC>::value_type val_t;
+ typedef typename traits::matrix_traits<SymmC>::value_type val_t;
 #else
- typedef typename SymmC::value_type val_t;
-#endif
+ typedef typename SymmC::value_type val_t;
+#endif
       syrk (trans, (val_t) 1, a, (val_t) 0, c);
     }
 
-
+
     // C <- alpha * A * B^T + conj(alpha) * B * A^T + beta * C
     // C <- alpha * A^T * B + conj(alpha) * B^T * A + beta * C
     // C == C^T
@@ -811,49 +811,49 @@
 
       template <typename T, typename MatrA, typename MatrB, typename SymmC>
       inline
- void syr2k (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
- T const& alpha, MatrA const& a, MatrB const& b,
+ void syr2k (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
+ T const& alpha, MatrA const& a, MatrB const& b,
                   T const& beta, SymmC& c)
       {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
         BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrA>::matrix_structure,
+ typename traits::matrix_traits<MatrA>::matrix_structure,
           traits::general_t
>::value));
         BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrB>::matrix_structure,
+ typename traits::matrix_traits<MatrB>::matrix_structure,
           traits::general_t
>::value));
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<MatrA>::ordering_type,
           typename traits::matrix_traits<SymmC>::ordering_type
- >::value));
+ >::value));
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<MatrB>::ordering_type,
           typename traits::matrix_traits<SymmC>::ordering_type
- >::value));
-#endif
+ >::value));
+#endif
 
- assert (uplo == CblasUpper || uplo == CblasLower);
- assert (trans == CblasNoTrans
- || trans == CblasTrans
- || trans == CblasConjTrans);
+ assert (uplo == CblasUpper || uplo == CblasLower);
+ assert (trans == CblasNoTrans
+ || trans == CblasTrans
+ || trans == CblasConjTrans);
 
         int const n = traits::matrix_size1 (c);
- assert (n == traits::matrix_size2 (c));
-
+ assert (n == traits::matrix_size2 (c));
+
         int const k = trans == CblasNoTrans
           ? traits::matrix_size2 (a)
- : traits::matrix_size1 (a);
+ : traits::matrix_size1 (a);
         assert (k == (trans == CblasNoTrans
                       ? traits::matrix_size2 (b)
- : traits::matrix_size1 (b)));
+ : traits::matrix_size1 (b)));
         assert (n == (trans == CblasNoTrans
                       ? traits::matrix_size1 (a)
- : traits::matrix_size2 (a)));
+ : traits::matrix_size2 (a)));
         assert (n == (trans == CblasNoTrans
                       ? traits::matrix_size1 (b)
- : traits::matrix_size2 (b)));
+ : traits::matrix_size2 (b)));
 
         CBLAS_ORDER const stor_ord
           = enum_cast<CBLAS_ORDER const>
@@ -861,62 +861,62 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
             typename traits::matrix_traits<SymmC>::ordering_type
 #else
- typename SymmC::orientation_category
-#endif
- >::value);
+ typename SymmC::orientation_category
+#endif
+ >::value);
 
- syr2k (stor_ord, uplo, trans,
- n, k, alpha,
+ syr2k (stor_ord, uplo, trans,
+ n, k, alpha,
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (a),
+ traits::matrix_storage (a),
 #else
- traits::matrix_storage_const (a),
+ traits::matrix_storage_const (a),
 #endif
                traits::leading_dimension (a),
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (b),
+ traits::matrix_storage (b),
 #else
- traits::matrix_storage_const (b),
+ traits::matrix_storage_const (b),
 #endif
                traits::leading_dimension (b),
- beta,
- traits::matrix_storage (c),
- traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c),
+ traits::leading_dimension (c));
       }
 
- } // detail
-
+ } // detail
+
     // C <- alpha * A * B^T + conj(alpha) * B * A^T + beta * C
     // C <- alpha * A^T * B + conj(alpha) * B^T * A + beta * C
     // C == C^T
     template <typename T, typename MatrA, typename MatrB, typename SymmC>
     inline
- void syr2k (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
- T const& alpha, MatrA const& a, MatrB const& b,
+ void syr2k (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
+ T const& alpha, MatrA const& a, MatrB const& b,
                T const& beta, SymmC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<SymmC>::matrix_structure,
+ typename traits::matrix_traits<SymmC>::matrix_structure,
         traits::general_t
- >::value));
-#endif
+ >::value));
+#endif
 
- detail::syr2k (uplo, trans, alpha, a, b, beta, c);
+ detail::syr2k (uplo, trans, alpha, a, b, beta, c);
     }
 
     template <typename T, typename MatrA, typename MatrB, typename SymmC>
     inline
- void syr2k (CBLAS_TRANSPOSE trans,
- T const& alpha, MatrA const& a, MatrB const& b,
+ void syr2k (CBLAS_TRANSPOSE trans,
+ T const& alpha, MatrA const& a, MatrB const& b,
                T const& beta, SymmC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<SymmC>::matrix_structure,
+ typename traits::matrix_traits<SymmC>::matrix_structure,
         traits::symmetric_t
- >::value));
-#endif
+ >::value));
+#endif
 
       CBLAS_UPLO const uplo
         = enum_cast<CBLAS_UPLO const>
@@ -924,29 +924,29 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
           typename traits::matrix_traits<SymmC>::uplo_type
 #else
- typename SymmC::packed_category
-#endif
- >::value);
+ typename SymmC::packed_category
+#endif
+ >::value);
 
- detail::syr2k (uplo, trans, alpha, a, b, beta, c);
+ detail::syr2k (uplo, trans, alpha, a, b, beta, c);
     }
 
     // C <- A * B^T + B * A^T + C
     // C <- A^T * B + B^T * A + C
     template <typename MatrA, typename MatrB, typename SymmC>
     inline
- void syr2k (CBLAS_TRANSPOSE trans,
- MatrA const& a, MatrB const& b, SymmC& c)
+ void syr2k (CBLAS_TRANSPOSE trans,
+ MatrA const& a, MatrB const& b, SymmC& c)
     {
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
- typedef typename traits::matrix_traits<SymmC>::value_type val_t;
+ typedef typename traits::matrix_traits<SymmC>::value_type val_t;
 #else
- typedef typename SymmC::value_type val_t;
-#endif
+ typedef typename SymmC::value_type val_t;
+#endif
       syr2k (trans, (val_t) 1, a, b, (val_t) 0, c);
     }
 
-
+
     // C <- alpha * A * A^H + beta * C
     // C <- alpha * A^H * A + beta * C
     // C == C^H
@@ -955,33 +955,33 @@
 
       template <typename T, typename MatrA, typename HermC>
       inline
- void herk (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
- T const& alpha, MatrA const& a,
+ void herk (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
+ T const& alpha, MatrA const& a,
                  T const& beta, HermC& c)
       {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
         BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrA>::matrix_structure,
+ typename traits::matrix_traits<MatrA>::matrix_structure,
           traits::general_t
>::value));
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<MatrA>::ordering_type,
           typename traits::matrix_traits<HermC>::ordering_type
- >::value));
-#endif
+ >::value));
+#endif
 
- assert (uplo == CblasUpper || uplo == CblasLower);
- assert (trans == CblasNoTrans || trans == CblasConjTrans);
+ assert (uplo == CblasUpper || uplo == CblasLower);
+ assert (trans == CblasNoTrans || trans == CblasConjTrans);
 
         int const n = traits::matrix_size1 (c);
- assert (n == traits::matrix_size2 (c));
-
+ assert (n == traits::matrix_size2 (c));
+
         int const k = trans == CblasNoTrans
           ? traits::matrix_size2 (a)
- : traits::matrix_size1 (a);
+ : traits::matrix_size1 (a);
         assert (n == (trans == CblasNoTrans
                       ? traits::matrix_size1 (a)
- : traits::matrix_size2 (a)));
+ : traits::matrix_size2 (a)));
 
         CBLAS_ORDER const stor_ord
           = enum_cast<CBLAS_ORDER const>
@@ -989,56 +989,56 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
             typename traits::matrix_traits<HermC>::ordering_type
 #else
- typename HermC::orientation_category
-#endif
- >::value);
+ typename HermC::orientation_category
+#endif
+ >::value);
 
- herk (stor_ord, uplo, trans,
- n, k, alpha,
+ herk (stor_ord, uplo, trans,
+ n, k, alpha,
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (a),
+ traits::matrix_storage (a),
 #else
- traits::matrix_storage_const (a),
+ traits::matrix_storage_const (a),
 #endif
               traits::leading_dimension (a),
- beta,
- traits::matrix_storage (c),
- traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c),
+ traits::leading_dimension (c));
       }
 
- } // detail
-
+ } // detail
+
     // C <- alpha * A * A^H + beta * C
     // C <- alpha * A^H * A + beta * C
     // C == C^H
     template <typename T, typename MatrA, typename HermC>
     inline
- void herk (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
- T const& alpha, MatrA const& a,
+ void herk (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
+ T const& alpha, MatrA const& a,
                T const& beta, HermC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<HermC>::matrix_structure,
+ typename traits::matrix_traits<HermC>::matrix_structure,
         traits::general_t
- >::value));
-#endif
+ >::value));
+#endif
 
- detail::herk (uplo, trans, alpha, a, beta, c);
+ detail::herk (uplo, trans, alpha, a, beta, c);
     }
 
     template <typename T, typename MatrA, typename HermC>
     inline
- void herk (CBLAS_TRANSPOSE trans,
- T const& alpha, MatrA const& a,
+ void herk (CBLAS_TRANSPOSE trans,
+ T const& alpha, MatrA const& a,
                T const& beta, HermC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<HermC>::matrix_structure,
+ typename traits::matrix_traits<HermC>::matrix_structure,
         traits::hermitian_t
- >::value));
-#endif
+ >::value));
+#endif
 
       CBLAS_UPLO const uplo
         = enum_cast<CBLAS_UPLO const>
@@ -1046,11 +1046,11 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
           typename traits::matrix_traits<HermC>::uplo_type
 #else
- typename HermC::packed_category
-#endif
- >::value);
+ typename HermC::packed_category
+#endif
+ >::value);
 
- detail::herk (uplo, trans, alpha, a, beta, c);
+ detail::herk (uplo, trans, alpha, a, beta, c);
     }
 
     // C <- A * A^H + C
@@ -1059,11 +1059,11 @@
     inline
     void herk (CBLAS_TRANSPOSE trans, MatrA const& a, HermC& c) {
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
- typedef typename traits::matrix_traits<HermC>::value_type val_t;
+ typedef typename traits::matrix_traits<HermC>::value_type val_t;
 #else
- typedef typename HermC::value_type val_t;
-#endif
- typedef typename traits::type_traits<val_t>::real_type real_t;
+ typedef typename HermC::value_type val_t;
+#endif
+ typedef typename traits::type_traits<val_t>::real_type real_t;
       herk (trans, (real_t) 1, a, (real_t) 0, c);
     }
 
@@ -1074,50 +1074,50 @@
 
     namespace detail {
 
- template <typename T1, typename T2,
+ template <typename T1, typename T2,
                 typename MatrA, typename MatrB, typename HermC>
       inline
- void her2k (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
- T1 const& alpha, MatrA const& a, MatrB const& b,
+ void her2k (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
+ T1 const& alpha, MatrA const& a, MatrB const& b,
                   T2 const& beta, HermC& c)
       {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
         BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrA>::matrix_structure,
+ typename traits::matrix_traits<MatrA>::matrix_structure,
           traits::general_t
>::value));
         BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<MatrB>::matrix_structure,
+ typename traits::matrix_traits<MatrB>::matrix_structure,
           traits::general_t
>::value));
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<MatrA>::ordering_type,
           typename traits::matrix_traits<HermC>::ordering_type
- >::value));
+ >::value));
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<MatrB>::ordering_type,
           typename traits::matrix_traits<HermC>::ordering_type
- >::value));
-#endif
+ >::value));
+#endif
 
- assert (uplo == CblasUpper || uplo == CblasLower);
- assert (trans == CblasNoTrans || trans == CblasConjTrans);
+ assert (uplo == CblasUpper || uplo == CblasLower);
+ assert (trans == CblasNoTrans || trans == CblasConjTrans);
 
         int const n = traits::matrix_size1 (c);
- assert (n == traits::matrix_size2 (c));
-
+ assert (n == traits::matrix_size2 (c));
+
         int const k = trans == CblasNoTrans
           ? traits::matrix_size2 (a)
- : traits::matrix_size1 (a);
+ : traits::matrix_size1 (a);
         assert (k == (trans == CblasNoTrans
                       ? traits::matrix_size2 (b)
- : traits::matrix_size1 (b)));
+ : traits::matrix_size1 (b)));
         assert (n == (trans == CblasNoTrans
                       ? traits::matrix_size1 (a)
- : traits::matrix_size2 (a)));
+ : traits::matrix_size2 (a)));
         assert (n == (trans == CblasNoTrans
                       ? traits::matrix_size1 (b)
- : traits::matrix_size2 (b)));
+ : traits::matrix_size2 (b)));
 
         CBLAS_ORDER const stor_ord
           = enum_cast<CBLAS_ORDER const>
@@ -1125,64 +1125,64 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
             typename traits::matrix_traits<HermC>::ordering_type
 #else
- typename HermC::orientation_category
-#endif
- >::value);
+ typename HermC::orientation_category
+#endif
+ >::value);
 
- her2k (stor_ord, uplo, trans,
- n, k, alpha,
+ her2k (stor_ord, uplo, trans,
+ n, k, alpha,
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (a),
+ traits::matrix_storage (a),
 #else
- traits::matrix_storage_const (a),
+ traits::matrix_storage_const (a),
 #endif
                traits::leading_dimension (a),
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- traits::matrix_storage (b),
+ traits::matrix_storage (b),
 #else
- traits::matrix_storage_const (b),
+ traits::matrix_storage_const (b),
 #endif
                traits::leading_dimension (b),
- beta,
- traits::matrix_storage (c),
- traits::leading_dimension (c));
+ beta,
+ traits::matrix_storage (c),
+ traits::leading_dimension (c));
       }
 
- } // detail
-
+ } // detail
+
     // C <- alpha * A * B^H + conj(alpha) * B * A^H + beta * C
     // C <- alpha * A^H * B + conj(alpha) * B^H * A + beta * C
     // C == C^H
- template <typename T1, typename T2,
+ template <typename T1, typename T2,
               typename MatrA, typename MatrB, typename HermC>
     inline
- void her2k (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
- T1 const& alpha, MatrA const& a, MatrB const& b,
+ void her2k (CBLAS_UPLO const uplo, CBLAS_TRANSPOSE trans,
+ T1 const& alpha, MatrA const& a, MatrB const& b,
                T2 const& beta, HermC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<HermC>::matrix_structure,
+ typename traits::matrix_traits<HermC>::matrix_structure,
         traits::general_t
- >::value));
-#endif
+ >::value));
+#endif
 
- detail::her2k (uplo, trans, alpha, a, b, beta, c);
+ detail::her2k (uplo, trans, alpha, a, b, beta, c);
     }
 
- template <typename T1, typename T2,
+ template <typename T1, typename T2,
               typename MatrA, typename MatrB, typename HermC>
     inline
- void her2k (CBLAS_TRANSPOSE trans,
- T1 const& alpha, MatrA const& a, MatrB const& b,
+ void her2k (CBLAS_TRANSPOSE trans,
+ T1 const& alpha, MatrA const& a, MatrB const& b,
                T2 const& beta, HermC& c)
     {
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
       BOOST_STATIC_ASSERT((boost::is_same<
- typename traits::matrix_traits<HermC>::matrix_structure,
+ typename traits::matrix_traits<HermC>::matrix_structure,
         traits::hermitian_t
- >::value));
-#endif
+ >::value));
+#endif
 
       CBLAS_UPLO const uplo
         = enum_cast<CBLAS_UPLO const>
@@ -1190,32 +1190,100 @@
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
           typename traits::matrix_traits<HermC>::uplo_type
 #else
- typename HermC::packed_category
-#endif
- >::value);
+ typename HermC::packed_category
+#endif
+ >::value);
 
- detail::her2k (uplo, trans, alpha, a, b, beta, c);
+ detail::her2k (uplo, trans, alpha, a, b, beta, c);
     }
 
     // C <- A * B^H + B * A^H + C
     // C <- A^H * B + B^H * A + C
     template <typename MatrA, typename MatrB, typename HermC>
     inline
- void her2k (CBLAS_TRANSPOSE trans,
- MatrA const& a, MatrB const& b, HermC& c)
+ void her2k (CBLAS_TRANSPOSE trans,
+ MatrA const& a, MatrB const& b, HermC& c)
     {
 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
- typedef typename traits::matrix_traits<HermC>::value_type val_t;
+ typedef typename traits::matrix_traits<HermC>::value_type val_t;
 #else
- typedef typename HermC::value_type val_t;
-#endif
- typedef typename traits::type_traits<val_t>::real_type real_t;
+ typedef typename HermC::value_type val_t;
+#endif
+ typedef typename traits::type_traits<val_t>::real_type real_t;
       her2k (trans, (val_t) 1, a, b, (real_t) 0, c);
     }
 
-
+
+ // B <- alpha * op(inv(A)) * B
+ // B <- alpha * B * op(inv(A))
+ // op (A) == A || A^T || A^H
+ template <typename T, typename MatrA, typename MatrB>
+ void trsm(CBLAS_SIDE const side, CBLAS_UPLO const uplo,
+ CBLAS_TRANSPOSE const TransA, CBLAS_DIAG const diag,
+ T const& alpha, MatrA const& a, MatrB& b)
+ {
+#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+ BOOST_STATIC_ASSERT((boost::is_same<
+ typename traits::matrix_traits<MatrA>::matrix_structure,
+ traits::general_t
+ >::value));
+ BOOST_STATIC_ASSERT((boost::is_same<
+ typename traits::matrix_traits<MatrB>::matrix_structure,
+ traits::general_t
+ >::value));
+
+ BOOST_STATIC_ASSERT((boost::is_same<
+ typename traits::matrix_traits<MatrA>::ordering_type,
+ typename traits::matrix_traits<MatrB>::ordering_type
+ >::value));
+#endif
+
+ assert (TransA == CblasNoTrans
+ || TransA == CblasTrans
+ || TransA == CblasConjTrans);
+ assert (side == CblasLeft || side == CblasRight);
+ assert (uplo == CblasUpper || uplo == CblasLower);
+
+
+ int const m = traits::matrix_size1 (b);
+ int const n = traits::matrix_size2 (b);
+
+ assert (side == CblasLeft
+ ? m == traits::matrix_size1 (a)
+ && m == traits::matrix_size2 (a)
+ : n == traits::matrix_size1 (a)
+ && n == traits::matrix_size2 (a));
+
+ // .. what about AtlasConj?
+
+ CBLAS_ORDER const stor_ord
+ = enum_cast<CBLAS_ORDER const>
+ (storage_order<
+#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
+ typename traits::matrix_traits<MatrA>::ordering_type
+#else
+ typename MatrA::orientation_category
+#endif
+ >::value);
+
+
+ detail::trsm (stor_ord, side, uplo, TransA, diag, m, n, alpha,
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+ traits::matrix_storage (a),
+#else
+ traits::matrix_storage_const (a),
+#endif
+ traits::leading_dimension (a),
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+ traits::matrix_storage (b),
+#else
+ traits::matrix_storage_const (b),
+#endif
+ traits::leading_dimension (b));
+ }
+
   } // namespace atlas
 
-}}}
+}}}
 
 #endif // BOOST_NUMERIC_BINDINGS_CBLAS_LEVEL_3_HPP

Modified: sandbox/numeric_bindings/boost/numeric/bindings/atlas/cblas3_overloads.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/atlas/cblas3_overloads.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/atlas/cblas3_overloads.hpp 2009-06-18 03:07:28 EDT (Thu, 18 Jun 2009)
@@ -1,12 +1,12 @@
 /*
- *
- * Copyright (c) Kresimir Fresl 2002
+ *
+ * Copyright (c) Kresimir Fresl 2002
  *
  * 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)
  *
- * Author acknowledges the support of the Faculty of Civil Engineering,
+ * Author acknowledges the support of the Faculty of Civil Engineering,
  * University of Zagreb, Croatia.
  *
  */
@@ -14,183 +14,183 @@
 #ifndef BOOST_NUMERIC_BINDINGS_CBLAS3_OVERLOADS_HPP
 #define BOOST_NUMERIC_BINDINGS_CBLAS3_OVERLOADS_HPP
 
-#include <complex>
+#include <complex>
 #include <boost/numeric/bindings/atlas/cblas_inc.hpp>
 #include <boost/numeric/bindings/traits/type.hpp>
 
 
-namespace boost { namespace numeric { namespace bindings {
+namespace boost { namespace numeric { namespace bindings {
 
   namespace atlas { namespace detail {
 
- // C <- alpha * op (A) * op (B) + beta * C
-
- inline
- void gemm (CBLAS_ORDER const Order,
- CBLAS_TRANSPOSE const TransA, CBLAS_TRANSPOSE const TransB,
- int const M, int const N, int const K,
+ // C <- alpha * op (A) * op (B) + beta * C
+
+ inline
+ void gemm (CBLAS_ORDER const Order,
+ CBLAS_TRANSPOSE const TransA, CBLAS_TRANSPOSE const TransB,
+ int const M, int const N, int const K,
                float const alpha, float const* A, int const lda,
- float const* B, int const ldb,
- float const beta, float* C, int const ldc)
+ float const* B, int const ldb,
+ float const beta, float* C, int const ldc)
     {
- cblas_sgemm (Order, TransA, TransB, M, N, K,
- alpha, A, lda,
+ cblas_sgemm (Order, TransA, TransB, M, N, K,
+ alpha, A, lda,
                    B, ldb,
- beta, C, ldc);
+ beta, C, ldc);
     }
 
- inline
- void gemm (CBLAS_ORDER const Order,
- CBLAS_TRANSPOSE const TransA, CBLAS_TRANSPOSE const TransB,
- int const M, int const N, int const K,
+ inline
+ void gemm (CBLAS_ORDER const Order,
+ CBLAS_TRANSPOSE const TransA, CBLAS_TRANSPOSE const TransB,
+ int const M, int const N, int const K,
                double const alpha, double const* A, int const lda,
- double const* B, int const ldb,
- double const beta, double* C, int const ldc)
+ double const* B, int const ldb,
+ double const beta, double* C, int const ldc)
     {
- cblas_dgemm (Order, TransA, TransB, M, N, K,
- alpha, A, lda,
+ cblas_dgemm (Order, TransA, TransB, M, N, K,
+ alpha, A, lda,
                    B, ldb,
- beta, C, ldc);
+ beta, C, ldc);
     }
 
- inline
- void gemm (CBLAS_ORDER const Order,
- CBLAS_TRANSPOSE const TransA, CBLAS_TRANSPOSE const TransB,
- int const M, int const N, int const K,
- traits::complex_f const& alpha,
+ inline
+ void gemm (CBLAS_ORDER const Order,
+ CBLAS_TRANSPOSE const TransA, CBLAS_TRANSPOSE const TransB,
+ int const M, int const N, int const K,
+ traits::complex_f const& alpha,
                traits::complex_f const* A, int const lda,
- traits::complex_f const* B, int const ldb,
- traits::complex_f const& beta,
- traits::complex_f* C, int const ldc)
- {
- cblas_cgemm (Order, TransA, TransB, M, N, K,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
+ traits::complex_f const* B, int const ldb,
+ traits::complex_f const& beta,
+ traits::complex_f* C, int const ldc)
+ {
+ cblas_cgemm (Order, TransA, TransB, M, N, K,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
                    static_cast<void const*> (B), ldb,
- static_cast<void const*> (&beta),
- static_cast<void*> (C), ldc);
+ static_cast<void const*> (&beta),
+ static_cast<void*> (C), ldc);
     }
-
- inline
- void gemm (CBLAS_ORDER const Order,
- CBLAS_TRANSPOSE const TransA, CBLAS_TRANSPOSE const TransB,
- int const M, int const N, int const K,
- traits::complex_d const& alpha,
+
+ inline
+ void gemm (CBLAS_ORDER const Order,
+ CBLAS_TRANSPOSE const TransA, CBLAS_TRANSPOSE const TransB,
+ int const M, int const N, int const K,
+ traits::complex_d const& alpha,
                traits::complex_d const* A, int const lda,
- traits::complex_d const* B, int const ldb,
- traits::complex_d const& beta,
- traits::complex_d* C, int const ldc)
- {
- cblas_zgemm (Order, TransA, TransB, M, N, K,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
+ traits::complex_d const* B, int const ldb,
+ traits::complex_d const& beta,
+ traits::complex_d* C, int const ldc)
+ {
+ cblas_zgemm (Order, TransA, TransB, M, N, K,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
                    static_cast<void const*> (B), ldb,
- static_cast<void const*> (&beta),
- static_cast<void*> (C), ldc);
+ static_cast<void const*> (&beta),
+ static_cast<void*> (C), ldc);
     }
 
-
- // C <- alpha * A * B + beta * C
- // C <- alpha * B * A + beta * C
+
+ // C <- alpha * A * B + beta * C
+ // C <- alpha * B * A + beta * C
     // A == A^T
 
- inline
+ inline
     void symm (CBLAS_ORDER const Order, CBLAS_SIDE const Side,
- CBLAS_UPLO const Uplo, int const M, int const N,
+ CBLAS_UPLO const Uplo, int const M, int const N,
                float const alpha, float const* A, int const lda,
- float const* B, int const ldb,
- float const beta, float* C, int const ldc)
+ float const* B, int const ldb,
+ float const beta, float* C, int const ldc)
     {
- cblas_ssymm (Order, Side, Uplo, M, N,
- alpha, A, lda,
+ cblas_ssymm (Order, Side, Uplo, M, N,
+ alpha, A, lda,
                    B, ldb,
- beta, C, ldc);
+ beta, C, ldc);
     }
-
- inline
+
+ inline
     void symm (CBLAS_ORDER const Order, CBLAS_SIDE const Side,
- CBLAS_UPLO const Uplo, int const M, int const N,
+ CBLAS_UPLO const Uplo, int const M, int const N,
                double const alpha, double const* A, int const lda,
- double const* B, int const ldb,
- double const beta, double* C, int const ldc)
+ double const* B, int const ldb,
+ double const beta, double* C, int const ldc)
     {
- cblas_dsymm (Order, Side, Uplo, M, N,
- alpha, A, lda,
+ cblas_dsymm (Order, Side, Uplo, M, N,
+ alpha, A, lda,
                    B, ldb,
- beta, C, ldc);
+ beta, C, ldc);
     }
-
- inline
+
+ inline
     void symm (CBLAS_ORDER const Order, CBLAS_SIDE const Side,
- CBLAS_UPLO const Uplo, int const M, int const N,
- traits::complex_f const& alpha,
+ CBLAS_UPLO const Uplo, int const M, int const N,
+ traits::complex_f const& alpha,
                traits::complex_f const* A, int const lda,
- traits::complex_f const* B, int const ldb,
- traits::complex_f const& beta,
- traits::complex_f* C, int const ldc)
- {
- cblas_csymm (Order, Side, Uplo, M, N,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
+ traits::complex_f const* B, int const ldb,
+ traits::complex_f const& beta,
+ traits::complex_f* C, int const ldc)
+ {
+ cblas_csymm (Order, Side, Uplo, M, N,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
                    static_cast<void const*> (B), ldb,
- static_cast<void const*> (&beta),
- static_cast<void*> (C), ldc);
+ static_cast<void const*> (&beta),
+ static_cast<void*> (C), ldc);
     }
-
- inline
+
+ inline
     void symm (CBLAS_ORDER const Order, CBLAS_SIDE const Side,
- CBLAS_UPLO const Uplo, int const M, int const N,
- traits::complex_d const& alpha,
+ CBLAS_UPLO const Uplo, int const M, int const N,
+ traits::complex_d const& alpha,
                traits::complex_d const* A, int const lda,
- traits::complex_d const* B, int const ldb,
- traits::complex_d const& beta,
- traits::complex_d* C, int const ldc)
- {
- cblas_zsymm (Order, Side, Uplo, M, N,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
+ traits::complex_d const* B, int const ldb,
+ traits::complex_d const& beta,
+ traits::complex_d* C, int const ldc)
+ {
+ cblas_zsymm (Order, Side, Uplo, M, N,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
                    static_cast<void const*> (B), ldb,
- static_cast<void const*> (&beta),
- static_cast<void*> (C), ldc);
+ static_cast<void const*> (&beta),
+ static_cast<void*> (C), ldc);
     }
-
 
- // C <- alpha * A * B + beta * C
- // C <- alpha * B * A + beta * C
+
+ // C <- alpha * A * B + beta * C
+ // C <- alpha * B * A + beta * C
     // A == A^H
-
- inline
+
+ inline
     void hemm (CBLAS_ORDER const Order, CBLAS_SIDE const Side,
- CBLAS_UPLO const Uplo, int const M, int const N,
- traits::complex_f const& alpha,
+ CBLAS_UPLO const Uplo, int const M, int const N,
+ traits::complex_f const& alpha,
                traits::complex_f const* A, int const lda,
- traits::complex_f const* B, int const ldb,
- traits::complex_f const& beta,
- traits::complex_f* C, int const ldc)
- {
- cblas_chemm (Order, Side, Uplo, M, N,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
+ traits::complex_f const* B, int const ldb,
+ traits::complex_f const& beta,
+ traits::complex_f* C, int const ldc)
+ {
+ cblas_chemm (Order, Side, Uplo, M, N,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
                    static_cast<void const*> (B), ldb,
- static_cast<void const*> (&beta),
- static_cast<void*> (C), ldc);
+ static_cast<void const*> (&beta),
+ static_cast<void*> (C), ldc);
     }
-
- inline
+
+ inline
     void hemm (CBLAS_ORDER const Order, CBLAS_SIDE const Side,
- CBLAS_UPLO const Uplo, int const M, int const N,
- traits::complex_d const& alpha,
+ CBLAS_UPLO const Uplo, int const M, int const N,
+ traits::complex_d const& alpha,
                traits::complex_d const* A, int const lda,
- traits::complex_d const* B, int const ldb,
- traits::complex_d const& beta,
- traits::complex_d* C, int const ldc)
- {
- cblas_zhemm (Order, Side, Uplo, M, N,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
+ traits::complex_d const* B, int const ldb,
+ traits::complex_d const& beta,
+ traits::complex_d* C, int const ldc)
+ {
+ cblas_zhemm (Order, Side, Uplo, M, N,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
                    static_cast<void const*> (B), ldb,
- static_cast<void const*> (&beta),
- static_cast<void*> (C), ldc);
+ static_cast<void const*> (&beta),
+ static_cast<void*> (C), ldc);
     }
 
 
@@ -202,48 +202,48 @@
     void syrk (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
                CBLAS_TRANSPOSE const Trans, int const N, int const K,
                float const alpha, float const* A, int const lda,
- float const beta, float* C, int const ldc)
+ float const beta, float* C, int const ldc)
     {
- cblas_ssyrk (Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc);
+ cblas_ssyrk (Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc);
     }
 
     inline
     void syrk (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
                CBLAS_TRANSPOSE const Trans, int const N, int const K,
                double const alpha, double const* A, int const lda,
- double const beta, double* C, int const ldc)
+ double const beta, double* C, int const ldc)
     {
- cblas_dsyrk (Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc);
+ cblas_dsyrk (Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc);
     }
 
     inline
     void syrk (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
                CBLAS_TRANSPOSE const Trans, int const N, int const K,
- traits::complex_f const& alpha,
+ traits::complex_f const& alpha,
                traits::complex_f const* A, int const lda,
- traits::complex_f const& beta,
- traits::complex_f* C, int const ldc)
+ traits::complex_f const& beta,
+ traits::complex_f* C, int const ldc)
     {
- cblas_csyrk (Order, Uplo, Trans, N, K,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
- static_cast<void const*> (&beta),
- static_cast<void*> (C), ldc);
+ cblas_csyrk (Order, Uplo, Trans, N, K,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
+ static_cast<void const*> (&beta),
+ static_cast<void*> (C), ldc);
     }
 
     inline
     void syrk (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
                CBLAS_TRANSPOSE const Trans, int const N, int const K,
- traits::complex_d const& alpha,
+ traits::complex_d const& alpha,
                traits::complex_d const* A, int const lda,
- traits::complex_d const& beta,
- traits::complex_d* C, int const ldc)
+ traits::complex_d const& beta,
+ traits::complex_d* C, int const ldc)
     {
- cblas_zsyrk (Order, Uplo, Trans, N, K,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
- static_cast<void const*> (&beta),
- static_cast<void*> (C), ldc);
+ cblas_zsyrk (Order, Uplo, Trans, N, K,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
+ static_cast<void const*> (&beta),
+ static_cast<void*> (C), ldc);
     }
 
 
@@ -256,10 +256,10 @@
                 CBLAS_TRANSPOSE const Trans, int const N, int const K,
                 float const alpha, float const* A, int const lda,
                 float const* B, int const ldb,
- float const beta, float* C, int const ldc)
+ float const beta, float* C, int const ldc)
     {
- cblas_ssyr2k (Order, Uplo, Trans, N, K,
- alpha, A, lda, B, ldb, beta, C, ldc);
+ cblas_ssyr2k (Order, Uplo, Trans, N, K,
+ alpha, A, lda, B, ldb, beta, C, ldc);
     }
 
     inline
@@ -267,44 +267,44 @@
                 CBLAS_TRANSPOSE const Trans, int const N, int const K,
                 double const alpha, double const* A, int const lda,
                 double const* B, int const ldb,
- double const beta, double* C, int const ldc)
+ double const beta, double* C, int const ldc)
     {
- cblas_dsyr2k (Order, Uplo, Trans, N, K,
- alpha, A, lda, B, ldb, beta, C, ldc);
+ cblas_dsyr2k (Order, Uplo, Trans, N, K,
+ alpha, A, lda, B, ldb, beta, C, ldc);
     }
 
     inline
     void syr2k (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
                 CBLAS_TRANSPOSE const Trans, int const N, int const K,
- traits::complex_f const& alpha,
+ traits::complex_f const& alpha,
                 traits::complex_f const* A, int const lda,
                 traits::complex_f const* B, int const ldb,
- traits::complex_f const& beta,
- traits::complex_f* C, int const ldc)
+ traits::complex_f const& beta,
+ traits::complex_f* C, int const ldc)
     {
- cblas_csyr2k (Order, Uplo, Trans, N, K,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
- static_cast<void const*> (B), ldb,
- static_cast<void const*> (&beta),
- static_cast<void*> (C), ldc);
+ cblas_csyr2k (Order, Uplo, Trans, N, K,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
+ static_cast<void const*> (B), ldb,
+ static_cast<void const*> (&beta),
+ static_cast<void*> (C), ldc);
     }
 
     inline
     void syr2k (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
                 CBLAS_TRANSPOSE const Trans, int const N, int const K,
- traits::complex_d const& alpha,
+ traits::complex_d const& alpha,
                 traits::complex_d const* A, int const lda,
                 traits::complex_d const* B, int const ldb,
- traits::complex_d const& beta,
- traits::complex_d* C, int const ldc)
+ traits::complex_d const& beta,
+ traits::complex_d* C, int const ldc)
     {
- cblas_zsyr2k (Order, Uplo, Trans, N, K,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
- static_cast<void const*> (B), ldb,
- static_cast<void const*> (&beta),
- static_cast<void*> (C), ldc);
+ cblas_zsyr2k (Order, Uplo, Trans, N, K,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
+ static_cast<void const*> (B), ldb,
+ static_cast<void const*> (&beta),
+ static_cast<void*> (C), ldc);
     }
 
 
@@ -316,22 +316,22 @@
     void herk (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
                CBLAS_TRANSPOSE const Trans, int const N, int const K,
                float alpha, traits::complex_f const* A, int const lda,
- float beta, traits::complex_f* C, int const ldc)
+ float beta, traits::complex_f* C, int const ldc)
     {
- cblas_cherk (Order, Uplo, Trans, N, K,
- alpha, static_cast<void const*> (A), lda,
- beta, static_cast<void*> (C), ldc);
+ cblas_cherk (Order, Uplo, Trans, N, K,
+ alpha, static_cast<void const*> (A), lda,
+ beta, static_cast<void*> (C), ldc);
     }
 
     inline
     void herk (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
                CBLAS_TRANSPOSE const Trans, int const N, int const K,
                double alpha, traits::complex_d const* A, int const lda,
- double beta, traits::complex_d* C, int const ldc)
+ double beta, traits::complex_d* C, int const ldc)
     {
- cblas_zherk (Order, Uplo, Trans, N, K,
- alpha, static_cast<void const*> (A), lda,
- beta, static_cast<void*> (C), ldc);
+ cblas_zherk (Order, Uplo, Trans, N, K,
+ alpha, static_cast<void const*> (A), lda,
+ beta, static_cast<void*> (C), ldc);
     }
 
 
@@ -342,37 +342,85 @@
     inline
     void her2k (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
                 CBLAS_TRANSPOSE const Trans, int const N, int const K,
- traits::complex_f const& alpha,
+ traits::complex_f const& alpha,
                 traits::complex_f const* A, int const lda,
                 traits::complex_f const* B, int const ldb,
- float beta, traits::complex_f* C, int const ldc)
+ float beta, traits::complex_f* C, int const ldc)
     {
- cblas_cher2k (Order, Uplo, Trans, N, K,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
- static_cast<void const*> (B), ldb,
- beta, static_cast<void*> (C), ldc);
+ cblas_cher2k (Order, Uplo, Trans, N, K,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
+ static_cast<void const*> (B), ldb,
+ beta, static_cast<void*> (C), ldc);
     }
 
     inline
     void her2k (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
                 CBLAS_TRANSPOSE const Trans, int const N, int const K,
- traits::complex_d const& alpha,
+ traits::complex_d const& alpha,
                 traits::complex_d const* A, int const lda,
                 traits::complex_d const* B, int const ldb,
- double beta, traits::complex_d* C, int const ldc)
+ double beta, traits::complex_d* C, int const ldc)
+ {
+ cblas_zher2k (Order, Uplo, Trans, N, K,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
+ static_cast<void const*> (B), ldb,
+ beta, static_cast<void*> (C), ldc);
+ }
+
+ inline
+ void trsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side,
+ const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA,
+ const enum CBLAS_DIAG Diag, const int M, const int N,
+ const float alpha, const float *A, const int lda,
+ float *B, const int ldb)
+ {
+ cblas_strsm (Order, Side, Uplo, TransA, Diag, M, N,
+ alpha, A, lda, B, ldb);
+ }
+
+ inline
+ void trsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side,
+ const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA,
+ const enum CBLAS_DIAG Diag, const int M, const int N,
+ const double alpha, const double *A, const int lda,
+ double *B, const int ldb)
+ {
+ cblas_dtrsm (Order, Side, Uplo, TransA, Diag, M, N,
+ alpha, A, lda, B, ldb);
+ }
+
+
+ inline
+ void trsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side,
+ const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA,
+ const enum CBLAS_DIAG Diag, const int M, const int N,
+ traits::complex_f const& alpha, traits::complex_f const* A, const int lda,
+ traits::complex_f* B, const int ldb)
+ {
+ cblas_ctrsm (Order, Side, Uplo, TransA, Diag, M, N,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
+ static_cast<void*> (B), ldb);
+ }
+
+ inline
+ void trsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side,
+ const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA,
+ const enum CBLAS_DIAG Diag, const int M, const int N,
+ traits::complex_d const& alpha, traits::complex_d const* A, const int lda,
+ traits::complex_d* B, const int ldb)
     {
- cblas_zher2k (Order, Uplo, Trans, N, K,
- static_cast<void const*> (&alpha),
- static_cast<void const*> (A), lda,
- static_cast<void const*> (B), ldb,
- beta, static_cast<void*> (C), ldc);
+ cblas_ztrsm (Order, Side, Uplo, TransA, Diag, M, N,
+ static_cast<void const*> (&alpha),
+ static_cast<void const*> (A), lda,
+ static_cast<void*> (B), ldb);
     }
 
-
   }} // namepaces detail & atlas
 
-}}}
+}}}
 
 
 #endif // BOOST_NUMERIC_BINDINGS_CBLAS3_OVERLOADS_HPP


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