00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef BlasWrapper_H
00025 #define BlasWrapper_H
00026
00027 #include <iostream>
00028 #include <math.h>
00029 #include <complex>
00030
00031 using namespace std;
00032
00033 #ifndef __C_COMPLEX
00034 #define __C_COMPLEX
00035 typedef struct
00036 {
00037 float re, im;
00038 } __c_complex;
00039
00040 typedef struct
00041 {
00042 double re, im;
00043 } __c_dcomplex;
00044 #endif
00045
00046 complex<double> dcmplx(double r,double i);
00047
00048 #define F77_FUNC(x,y) x##_
00049
00050 extern "C" {
00051 double F77_FUNC(ddot,DDOT)(int*, double*, int*, double*, int*);
00052
00053 void F77_FUNC(dcopy,DCOPY)(int*, double*, int*, double*, int*);
00054
00055 void F77_FUNC(daxpy,DAXPY)(int*, double*, double*, int*, double*, int*);
00056
00057 double F77_FUNC(dnrm2,DNRM2)(int*, double*, int*);
00058
00059 int F77_FUNC(idamax,IDAMAX)(int*, double*, int*);
00060
00061 double F77_FUNC(dasum,DASUM)(int*, double*, int*);
00062
00063 void F77_FUNC(dscal,DSCAL)(int*, double*, double*, int*);
00064
00065 void F77_FUNC(dgemm,DGEMM)(char *transa, char *transb, int *m, int *n,
00066 int *k,double *alpha, double *a, int *lda,
00067 double *b, int *ldb, double *beta, double *c,
00068 int *ldc);
00069
00070 void F77_FUNC(dgemv,DGEMV)(char *trans, int *m, int *n, double *alpha,
00071 double *a, int *lda, double *x, int *incx,
00072 double *beta, double *y, int *incy);
00073
00074 float F77_FUNC(sasum,SASUM)(int*, float*, int*);
00075
00076 float F77_FUNC(sdot,SDOT)(int*, float*, int*, float*, int*);
00077
00078 void F77_FUNC(scopy,SCOPY)(int*, float*, int*, float*, int*);
00079
00080 void F77_FUNC(saxpy,SAXPY)(int*, float*, float*, int*, float*, int*);
00081
00082 float F77_FUNC(snrm2,SNRM2)(int*, float*, int*);
00083
00084 float F77_FUNC(sasum,SASUM)(int*, float*, int*);
00085
00086 int F77_FUNC(isamax,ISAMAX)(int*, float*, int*);
00087
00088 void F77_FUNC(sscal,SSCAL)(int*, float*, float*, int*);
00089
00090 void F77_FUNC(sgemm,SGEMM)(char *transa, char *transb, int *m, int *n,
00091 int *k,float *alpha, float *a, int *lda,
00092 float *b, int *ldb, float *beta, float *c,
00093 int *ldc);
00094
00095 void F77_FUNC(sgemv,SGEMV)(char *trans, int *m, int *n, float *alpha,
00096 float *a, int *lda, float *x, int *incx,
00097 float *beta, float *y, int *incy);
00098
00099 complex<double> F77_FUNC(zdotu,ZDOTU)(int*, double*, int*, double*, int*);
00100
00101 complex<double> F77_FUNC(zdotc,ZDOTC)(int*, double*, int*, double*, int*);
00102
00103 void F77_FUNC(zscal,ZSCAL)(int*, double*, double*, int*);
00104
00105 void F77_FUNC(zaxpy,ZAXPY)(int*, double*, double*, int*, double*, int*);
00106
00107 void F77_FUNC(zcopy,ZCOPY)(int*, double*, int*, double*, int*);
00108
00109 double F77_FUNC(dznrm2,DZNRM2)(int*, double*, int*);
00110
00111 double F77_FUNC(dzasum,DZASUM)(int*, double*, int*);
00112
00113 int F77_FUNC(izamax,IZAMAX)(int*, double*, int*);
00114
00115 void F77_FUNC(zgemm,ZGEMM)(char *transa, char *transb, int *m, int *n, int *k, double *alpha, double *a, int *lda, double *b, int *ldb,
00116 double *beta, double *c, int *ldc);
00117
00118 void F77_FUNC(zgemv,ZGEMV)(char *trans, int *m, int *n, double *alpha,
00119 double *a, int *lda, double *x, int *incx, double *beta,
00120 double *y, int *incy);
00121
00122 void F77_FUNC(zgemm,ZGEMM)(char *transa, char *transb, int *m, int *n, int *k,
00123 double *alpha, double *a, int *lda, double *b, int *ldb, double *beta,
00124 double *c, int *ldc);
00125 }
00126
00127 #endif