![]() |
GURLS++
2.0.00
C++ Implementation of GURLS Matlab Toolbox
|
00001 #ifndef BLAS_LAPACK_H 00002 #define BLAS_LAPACK_H 00003 00004 00011 namespace gurls 00012 { 00017 enum CBLAS_ORDER {CblasRowMajor=9, CblasColMajor=10}; 00018 00023 enum CBLAS_TRANSPOSE {CblasNoTrans=0, CblasTrans=1, CblasConjTrans=2}; 00024 00029 enum CBLAS_UPLO {CblasUpper=3, CblasLower=4}; 00030 00035 enum CBLAS_DIAG {CblasNonUnit=5, CblasUnit=6}; 00036 00041 enum CBLAS_SIDE {CblasLeft=7, CblasRight=8}; 00042 00046 class BlasUtils 00047 { 00048 public: 00049 00053 static char charValue(int value) 00054 { 00055 static char chars[] = "NTCULNULR"; 00056 00057 return chars[value]; 00058 } 00059 00060 }; 00061 00062 } 00063 00064 extern "C" 00065 { 00066 00067 00068 // ------ BLAS 00069 00070 00076 float sdot_(int *n, float *x, int *incx, float *y, int *incy); 00077 00089 void sgemm_(char *transa, char *transb, int *m, int *n, int *k, float *alpha, float *a, int *lda, float *b, int *ldb, float *beta, float *c, int *ldc); 00090 00098 void sgemv_(char *trans, int *m, int *n, float *alpha, float *a, int *lda, float *x, int *incx, float *beta, float *y, int *incy); 00099 00105 void scopy_(int *n, float *x, int *incx, float *y, int *incy); 00106 00112 void saxpy_(int *n, float *alpha, float *x, int *incx, float *y, int *incy); 00113 00119 float snrm2_(int *n, float *x, int *incx); 00120 00126 void sscal_(int *n, float *a, float *x, int *incx); 00127 00138 void strsm_(char *side, char *uplo, char *transa, char *diag, int *m, int *n, float *alpha, float *a, int *lda, float *b, int *ldb); 00139 00146 void sswap_(int *n, float *sx, int *incx, float *sy, int *incy); 00147 00153 double ddot_(int *n, double *x, int *incx, double *y, int *incy); 00154 00166 void dgemm_(char *transa, char *transb, int *m, int *n, int *k, double *alpha, double *a, int *lda, double *b, int *ldb, double *beta, double *c, int *ldc); 00167 00175 void dgemv_(char *trans, int *m, int *n, double *alpha, double *a, int *lda, double *x, int *incx, double *beta, double *y, int *incy); 00176 00182 void dcopy_(int *n, double *x, int *incx, double *y, int *incy); 00183 00189 void daxpy_(int *n, double *alpha, double *x, int *incx, double *y, int *incy); 00190 00196 double dnrm2_(int *n, double *x, int *incx); 00197 00203 void dscal_(int *n, double *a, double *x, int *incx); 00204 00215 void dtrsm_(char *side, char *uplo, char *transa, char *diag, int *m, int *n, double *alpha, double *a, int *lda, double *b, int *ldb); 00216 00223 void dswap_(int *n, double *sx, int *incx, double *sy, int *incy); 00224 00225 00226 00227 // ------ LAPACK 00228 00229 00230 00242 int sgetrf_(int *m, int *n, float *a, int *lda, int *ipiv, int *info); 00243 00259 int sgesvd_(char *jobu, char *jobvt, int *m, int *n, float *a, int *lda, float *s, float *u, int *ldu, float *vt, int *ldvt, float *work, int *lwork, int *info); 00260 00276 int dgesvd_(char *jobu, char *jobvt, int *m, int *n, double *a, int *lda, double *s, double *u, int *ldu, double *vt, int *ldvt, double *work, int *lwork, int *info); 00277 00292 int sgeev_(char *jobvl, char *jobvr, int *n, float *a, int *lda, float *wr, float *wi, float *vl, int *ldvl, float *vr, int *ldvr, float *work, int *lwork, int *info); 00293 00308 int dgeev_(char *jobvl, char *jobvr, int *n, double *a, int *lda, double *wr, double *wi, double *vl, int *ldvl, double *vr, int *ldvr, double *work, int *lwork, int *info); 00309 00319 int sgetri_(int *n, float *a, int* lda, int *ipiv, float*work, int *lwork, int *info); 00320 00332 int spotrf_(char *UPLO, int *n, float *a, int *lda , int *info); 00333 00345 int dpotrf_(char *UPLO, int *n, double *a, int *lda , int *info); 00346 00366 int sgelss_( int *m, int *n, int* nrhs, float *a, int *lda, float* b, int *ldb, float *s, float *rcond, int *rank, float *work, int *lwork, int *info); 00367 00387 int dgelss_( int *m, int *n, int* nrhs, double *a, int *lda, double* b, int *ldb, double *s, double *rcond, int *rank, double *work, int *lwork, int *info); 00388 00395 int ssyev_( char* jobz, char* uplo, int* n, float* a, int* lda, float* w, float* work, int* lwork, int* info ); 00396 00403 int dsyev_( char* jobz, char* uplo, int* n, double* a, int* lda, double* w, double* work, int* lwork, int* info ); 00404 00410 void sgeqp3_( int *m, int *n, float *A, int *lda, int *jpvt, float *tau, float *work, int *lwork, int *info); 00411 00417 void dgeqp3_( int *m, int *n, double *A, int *lda, int *jpvt, double *tau, double *work, int *lwork, int *info); 00418 00430 void sorgqr_(int *m, int *n, int *k, float *a, int *lda, float *tau, float *work, int *lwork, int *info); 00431 00443 void dorgqr_(int *m, int *n, int *k, double *a, int *lda, double *tau, double *work, int *lwork, int *info); 00444 00445 } 00446 00447 #include"gurls++/blas_lapack.hpp" 00448 00449 #endif //BLAS_LAPACK_H