1 #ifndef SimTK_SimTKCOMMON_TEMPLATIZED_LAPACK_H_ 2 #define SimTK_SimTKCOMMON_TEMPLATIZED_LAPACK_H_ 34 #include "SimTKlapack.h" 45 template <
class P>
static void 47 (
char transa,
char transb,
49 const P& alpha,
const P a[],
int lda,
51 const P& beta, P c[],
int ldc) {assert(
false);}
53 template <
class P>
static void 61 int &info ) {assert(
false);}
63 template <
class P>
static void 70 int &info ) {assert(
false);}
76 template <>
inline void Lapack::gemm<float>
77 (
char transa,
char transb,
79 const float& alpha,
const float a[],
int lda,
80 const float b[],
int ldb,
81 const float& beta,
float c[],
int ldc)
85 m,n,k,alpha,a,lda,b,ldb,beta,c,ldc
88 template <>
inline void Lapack::gemm<double>
89 (
char transa,
char transb,
91 const double& alpha,
const double a[],
int lda,
92 const double b[],
int ldb,
93 const double& beta,
double c[],
int ldc)
97 m,n,k,alpha,a,lda,b,ldb,beta,c,ldc
100 template <>
inline void Lapack::gemm< complex<float> >
101 (
char transa,
char transb,
103 const complex<float>& alpha,
const complex<float> a[],
int lda,
104 const complex<float> b[],
int ldb,
105 const complex<float>& beta, complex<float> c[],
int ldc)
109 m,n,k,alpha,a,lda,b,ldb,beta,c,ldc
112 template <>
inline void Lapack::gemm< complex<double> >
113 (
char transa,
char transb,
115 const complex<double>& alpha,
const complex<double> a[],
int lda,
116 const complex<double> b[],
int ldb,
117 const complex<double>& beta, complex<double> c[],
int ldc)
121 m,n,k,alpha,a,lda,b,ldb,beta,c,ldc
127 template <>
inline void Lapack::getri<float>
136 sgetri_(n,a,lda,ipiv,work,lwork,info);
139 template <>
inline void Lapack::getri<double>
148 dgetri_(n,a,lda,ipiv,work,lwork,info);
151 template <>
inline void Lapack::getri< complex<float> >
156 complex<float> work[],
160 cgetri_(n,a,lda,ipiv,work,lwork,info);
163 template <>
inline void Lapack::getri< complex<double> >
168 complex<double> work[],
172 zgetri_(n,a,lda,ipiv,work,lwork,info);
176 template <>
inline void Lapack::getrf<float>
184 sgetrf_(m,n,a,lda,ipiv,info);
187 template <>
inline void Lapack::getrf<double>
195 dgetrf_(m,n,a,lda,ipiv,info);
198 template <>
inline void Lapack::getrf< complex<float> >
206 cgetrf_(m,n,a,lda,ipiv,info);
209 template <>
inline void Lapack::getrf< complex<double> >
217 zgetrf_(m,n,a,lda,ipiv,info);
361 #endif // SimTK_SimTKCOMMON_TEMPLATIZED_LAPACK_H_ This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
static void getri(int n, P a[], int lda, const int ipiv[], P work[], int lwork, int &info)
Definition: TemplatizedLapack.h:55
static void getrf(int m, int n, P a[], int lda, int ipiv[], int &info)
Definition: TemplatizedLapack.h:65
Definition: TemplatizedLapack.h:41
static void gemm(char transa, char transb, int m, int n, int k, const P &alpha, const P a[], int lda, const P b[], int ldb, const P &beta, P c[], int ldc)
Definition: TemplatizedLapack.h:47
Mandatory first inclusion for any Simbody source or header file.