~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/3rdParty/boost/numeric/bindings/blas/blas3_overloads.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-07-16 18:37:41 UTC
  • Revision ID: james.westby@ubuntu.com-20090716183741-oww9kcxqrk991i1n
Tags: upstream-0.8.2237
ImportĀ upstreamĀ versionĀ 0.8.2237

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
//  Copyright (C) Toon Knapen 2003
 
3
//
 
4
// Distributed under the Boost Software License, Version 1.0.
 
5
// (See accompanying file LICENSE_1_0.txt or copy at
 
6
// http://www.boost.org/LICENSE_1_0.txt)
 
7
//
 
8
 
 
9
#ifndef BOOST_NUMERIC_BINDINGS_BLAS_BLAS3_OVERLOADS_HPP
 
10
#define BOOST_NUMERIC_BINDINGS_BLAS_BLAS3_OVERLOADS_HPP
 
11
 
 
12
#include <boost/numeric/bindings/blas/blas.h>
 
13
#include <boost/numeric/bindings/traits/type_traits.hpp>
 
14
 
 
15
namespace boost { namespace numeric { namespace bindings { namespace blas { namespace detail {
 
16
 
 
17
  using namespace boost::numeric::bindings::traits ;
 
18
 
 
19
  inline
 
20
  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 ) ; }
 
21
  inline
 
22
  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 ) ; }
 
23
  inline
 
24
  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 ) ; }
 
25
  inline
 
26
  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 ) ; }
 
27
 
 
28
 
 
29
  //
 
30
  // SYRK
 
31
  //
 
32
  inline
 
33
  void syrk( char uplo, char trans, const int& n, const int& k, const float& alpha,
 
34
             const float* a_ptr, const int lda, const float& beta, float* c_ptr,
 
35
             const int& ldc)
 
36
  {
 
37
     BLAS_SSYRK( &uplo, &trans, &n, &k, &alpha, a_ptr, &lda, &beta, c_ptr, &ldc);
 
38
  }
 
39
 
 
40
  inline
 
41
  void syrk( char uplo, char trans, const int& n, const int& k, const double& alpha,
 
42
             const double* a_ptr, const int lda, const double& beta, double* c_ptr,
 
43
             const int& ldc)
 
44
  {
 
45
     BLAS_DSYRK( &uplo, &trans, &n, &k, &alpha, a_ptr, &lda, &beta, c_ptr, &ldc);
 
46
  }
 
47
 
 
48
  inline
 
49
  void syrk( char uplo, char trans, const int& n, const int& k, const complex_f& alpha,
 
50
             const complex_f* a_ptr, const int lda, const complex_f& beta, complex_f* c_ptr,
 
51
             const int& ldc)
 
52
  {
 
53
     BLAS_CSYRK( &uplo, &trans, &n, &k, complex_ptr( &alpha ), complex_ptr( a_ptr ),
 
54
                 &lda, complex_ptr( &beta ), complex_ptr( c_ptr ), &ldc);
 
55
  }
 
56
 
 
57
  inline
 
58
  void syrk( char uplo, char trans, const int& n, const int& k, const complex_d& alpha,
 
59
             const complex_d* a_ptr, const int lda, const complex_d& beta, complex_d* c_ptr,
 
60
             const int& ldc)
 
61
  {
 
62
     BLAS_ZSYRK( &uplo, &trans, &n, &k, complex_ptr( &alpha ), complex_ptr( a_ptr ),
 
63
                 &lda, complex_ptr( &beta ), complex_ptr( c_ptr ), &ldc);
 
64
  }
 
65
 
 
66
  //
 
67
  // HERK
 
68
  //
 
69
  inline
 
70
  void herk( char uplo, char trans, const int& n, const int& k, const float& alpha,
 
71
             const float* a_ptr, const int lda, const float& beta, float* c_ptr,
 
72
             const int& ldc)
 
73
  {
 
74
     BLAS_SSYRK( &uplo, &trans, &n, &k, &alpha, a_ptr, &lda, &beta, c_ptr, &ldc);
 
75
  }
 
76
 
 
77
  inline
 
78
  void herk( char uplo, char trans, const int& n, const int& k, const double& alpha,
 
79
             const double* a_ptr, const int lda, const double& beta, double* c_ptr,
 
80
             const int& ldc)
 
81
  {
 
82
     BLAS_DSYRK( &uplo, &trans, &n, &k, &alpha, a_ptr, &lda, &beta, c_ptr, &ldc);
 
83
  }
 
84
 
 
85
 
 
86
  inline
 
87
  void herk( char uplo, char trans, const int& n, const int& k, const float& alpha,
 
88
             const complex_f* a_ptr, const int lda, const float& beta, complex_f* c_ptr,
 
89
             const int& ldc)
 
90
  {
 
91
     BLAS_CHERK( &uplo, &trans, &n, &k, &alpha, complex_ptr( a_ptr ),
 
92
                 &lda, &beta, complex_ptr( c_ptr ), &ldc);
 
93
  }
 
94
 
 
95
  inline
 
96
  void herk( char uplo, char trans, const int& n, const int& k, const double& alpha,
 
97
             const complex_d* a_ptr, const int lda, const double& beta, complex_d* c_ptr,
 
98
             const int& ldc)
 
99
  {
 
100
     BLAS_ZHERK( &uplo, &trans, &n, &k, &alpha, complex_ptr( a_ptr ),
 
101
                 &lda, &beta, complex_ptr( c_ptr ), &ldc);
 
102
  }
 
103
 
 
104
  //
 
105
  // trsm
 
106
  //
 
107
  inline
 
108
  void trsm( char side, char uplo, char transa, char diag, int m, int n,
 
109
             float const& alpha, float const* a_ptr, int lda,
 
110
             float* b_ptr, int ldb )
 
111
  {
 
112
     BLAS_STRSM( &side, &uplo, &transa, &diag, &m, &n, &alpha, a_ptr, &lda, b_ptr, &ldb ) ;
 
113
  }
 
114
 
 
115
  inline
 
116
  void trsm( char side, char uplo, char transa, char diag, int m, int n,
 
117
             double const& alpha, double const* a_ptr, int lda,
 
118
             double* b_ptr, int ldb )
 
119
  {
 
120
     BLAS_DTRSM( &side, &uplo, &transa, &diag, &m, &n, &alpha, a_ptr, &lda, b_ptr, &ldb ) ;
 
121
  }
 
122
 
 
123
  inline
 
124
  void trsm( char side, char uplo, char transa, char diag, int m, int n,
 
125
             complex_f const& alpha, complex_f const* a_ptr, int lda,
 
126
             complex_f* b_ptr, int ldb )
 
127
  {
 
128
     BLAS_CTRSM( &side, &uplo, &transa, &diag, &m, &n, complex_ptr( &alpha ), complex_ptr( a_ptr ), &lda, complex_ptr( b_ptr ), &ldb ) ;
 
129
  }
 
130
 
 
131
  inline
 
132
  void trsm( char side, char uplo, char transa, char diag, int m, int n,
 
133
             complex_d const& alpha, complex_d const* a_ptr, int lda,
 
134
             complex_d* b_ptr, int ldb )
 
135
  {
 
136
     BLAS_ZTRSM( &side, &uplo, &transa, &diag, &m, &n, complex_ptr( &alpha ), complex_ptr( a_ptr ), &lda, complex_ptr( b_ptr ), &ldb ) ;
 
137
  }
 
138
 
 
139
}}}}}
 
140
 
 
141
#endif // BOOST_NUMERIC_BINDINGS_BLAS_BLAS3_OVERLOADS_HPP
 
142