00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef BOOST_NUMERIC_BINDINGS_BLAS_BLAS3_OVERLOADS_HPP
00010 #define BOOST_NUMERIC_BINDINGS_BLAS_BLAS3_OVERLOADS_HPP
00011
00012 #include <boost/numeric/bindings/blas/blas.h>
00013 #include <boost/numeric/bindings/traits/type_traits.hpp>
00014
00015 namespace boost { namespace numeric { namespace bindings { namespace blas { namespace detail {
00016
00017 using namespace boost::numeric::bindings::traits ;
00018
00019 inline
00020 void gemm( char TRANSA, char TRANSB, const int& m, const int& n, const int& k, const float & alpha, const float * a_ptr, const int& lda, const float * b_ptr, const int& ldb, const float & beta, float * c_ptr, const int& ldc ) { BLAS_SGEMM( &TRANSA, &TRANSB, &m, &n, &k, ( &alpha ), ( a_ptr ), &lda, ( b_ptr ), &ldb, ( &beta ), ( c_ptr ), &ldc ) ; }
00021 inline
00022 void gemm( char TRANSA, char TRANSB, const int& m, const int& n, const int& k, const double & alpha, const double * a_ptr, const int& lda, const double * b_ptr, const int& ldb, const double & beta, double * c_ptr, const int& ldc ) { BLAS_DGEMM( &TRANSA, &TRANSB, &m, &n, &k, ( &alpha ), ( a_ptr ), &lda, ( b_ptr ), &ldb, ( &beta ), ( c_ptr ), &ldc ) ; }
00023 inline
00024 void gemm( char TRANSA, char TRANSB, const int& m, const int& n, const int& k, const complex_f& alpha, const complex_f* a_ptr, const int& lda, const complex_f* b_ptr, const int& ldb, const complex_f& beta, complex_f* c_ptr, const int& ldc ) { BLAS_CGEMM( &TRANSA, &TRANSB, &m, &n, &k, complex_ptr( &alpha ), complex_ptr( a_ptr ), &lda, complex_ptr( b_ptr ), &ldb, complex_ptr( &beta ), complex_ptr( c_ptr ), &ldc ) ; }
00025 inline
00026 void gemm( char TRANSA, char TRANSB, const int& m, const int& n, const int& k, const complex_d& alpha, const complex_d* a_ptr, const int& lda, const complex_d* b_ptr, const int& ldb, const complex_d& beta, complex_d* c_ptr, const int& ldc ) { BLAS_ZGEMM( &TRANSA, &TRANSB, &m, &n, &k, complex_ptr( &alpha ), complex_ptr( a_ptr ), &lda, complex_ptr( b_ptr ), &ldb, complex_ptr( &beta ), complex_ptr( c_ptr ), &ldc ) ; }
00027
00028
00029
00030
00031
00032 inline
00033 void syrk( char uplo, char trans, const int& n, const int& k, const float& alpha,
00034 const float* a_ptr, const int lda, const float& beta, float* c_ptr,
00035 const int& ldc)
00036 {
00037 BLAS_SSYRK( &uplo, &trans, &n, &k, &alpha, a_ptr, &lda, &beta, c_ptr, &ldc);
00038 }
00039
00040 inline
00041 void syrk( char uplo, char trans, const int& n, const int& k, const double& alpha,
00042 const double* a_ptr, const int lda, const double& beta, double* c_ptr,
00043 const int& ldc)
00044 {
00045 BLAS_DSYRK( &uplo, &trans, &n, &k, &alpha, a_ptr, &lda, &beta, c_ptr, &ldc);
00046 }
00047
00048 inline
00049 void syrk( char uplo, char trans, const int& n, const int& k, const complex_f& alpha,
00050 const complex_f* a_ptr, const int lda, const complex_f& beta, complex_f* c_ptr,
00051 const int& ldc)
00052 {
00053 BLAS_CSYRK( &uplo, &trans, &n, &k, complex_ptr( &alpha ), complex_ptr( a_ptr ),
00054 &lda, complex_ptr( &beta ), complex_ptr( c_ptr ), &ldc);
00055 }
00056
00057 inline
00058 void syrk( char uplo, char trans, const int& n, const int& k, const complex_d& alpha,
00059 const complex_d* a_ptr, const int lda, const complex_d& beta, complex_d* c_ptr,
00060 const int& ldc)
00061 {
00062 BLAS_ZSYRK( &uplo, &trans, &n, &k, complex_ptr( &alpha ), complex_ptr( a_ptr ),
00063 &lda, complex_ptr( &beta ), complex_ptr( c_ptr ), &ldc);
00064 }
00065
00066
00067
00068
00069 inline
00070 void herk( char uplo, char trans, const int& n, const int& k, const float& alpha,
00071 const float* a_ptr, const int lda, const float& beta, float* c_ptr,
00072 const int& ldc)
00073 {
00074 BLAS_SSYRK( &uplo, &trans, &n, &k, &alpha, a_ptr, &lda, &beta, c_ptr, &ldc);
00075 }
00076
00077 inline
00078 void herk( char uplo, char trans, const int& n, const int& k, const double& alpha,
00079 const double* a_ptr, const int lda, const double& beta, double* c_ptr,
00080 const int& ldc)
00081 {
00082 BLAS_DSYRK( &uplo, &trans, &n, &k, &alpha, a_ptr, &lda, &beta, c_ptr, &ldc);
00083 }
00084
00085
00086 inline
00087 void herk( char uplo, char trans, const int& n, const int& k, const float& alpha,
00088 const complex_f* a_ptr, const int lda, const float& beta, complex_f* c_ptr,
00089 const int& ldc)
00090 {
00091 BLAS_CHERK( &uplo, &trans, &n, &k, &alpha, complex_ptr( a_ptr ),
00092 &lda, &beta, complex_ptr( c_ptr ), &ldc);
00093 }
00094
00095 inline
00096 void herk( char uplo, char trans, const int& n, const int& k, const double& alpha,
00097 const complex_d* a_ptr, const int lda, const double& beta, complex_d* c_ptr,
00098 const int& ldc)
00099 {
00100 BLAS_ZHERK( &uplo, &trans, &n, &k, &alpha, complex_ptr( a_ptr ),
00101 &lda, &beta, complex_ptr( c_ptr ), &ldc);
00102 }
00103
00104
00105
00106
00107 inline
00108 void trsm( char side, char uplo, char transa, char diag, int m, int n,
00109 float const& alpha, float const* a_ptr, int lda,
00110 float* b_ptr, int ldb )
00111 {
00112 BLAS_STRSM( &side, &uplo, &transa, &diag, &m, &n, &alpha, a_ptr, &lda, b_ptr, &ldb ) ;
00113 }
00114
00115 inline
00116 void trsm( char side, char uplo, char transa, char diag, int m, int n,
00117 double const& alpha, double const* a_ptr, int lda,
00118 double* b_ptr, int ldb )
00119 {
00120 BLAS_DTRSM( &side, &uplo, &transa, &diag, &m, &n, &alpha, a_ptr, &lda, b_ptr, &ldb ) ;
00121 }
00122
00123 inline
00124 void trsm( char side, char uplo, char transa, char diag, int m, int n,
00125 complex_f const& alpha, complex_f const* a_ptr, int lda,
00126 complex_f* b_ptr, int ldb )
00127 {
00128 BLAS_CTRSM( &side, &uplo, &transa, &diag, &m, &n, complex_ptr( &alpha ), complex_ptr( a_ptr ), &lda, complex_ptr( b_ptr ), &ldb ) ;
00129 }
00130
00131 inline
00132 void trsm( char side, char uplo, char transa, char diag, int m, int n,
00133 complex_d const& alpha, complex_d const* a_ptr, int lda,
00134 complex_d* b_ptr, int ldb )
00135 {
00136 BLAS_ZTRSM( &side, &uplo, &transa, &diag, &m, &n, complex_ptr( &alpha ), complex_ptr( a_ptr ), &lda, complex_ptr( b_ptr ), &ldb ) ;
00137 }
00138
00139 }}}}}
00140
00141 #endif // BOOST_NUMERIC_BINDINGS_BLAS_BLAS3_OVERLOADS_HPP
00142