00001 #ifndef _psi_src_bin_psimrcc_algebra_interface_h
00002 #define _psi_src_bin_psimrcc_algebra_interface_h
00003
00004
00005
00006
00007
00008
00009 #ifndef FC_SYMBOL
00010 #define FC_SYMBOL 2
00011 #endif
00012
00013 #if FC_SYMBOL==2
00014 #define F_DAXPY daxpy_
00015 #define F_DCOPY dcopy_
00016 #define F_DGEMM dgemm_
00017 #define F_DROT drot_
00018 #define F_DSCAL dscal_
00019 #define F_DGEMV dgemv_
00020 #define F_DSPMV dspmv_
00021 #define F_DDOT ddot_
00022 #elif FC_SYMBOL==1
00023 #define F_DAXPY daxpy
00024 #define F_DCOPY dcopy
00025 #define F_DGEMM dgemm
00026 #define F_DROT drot
00027 #define F_DSCAL dscal
00028 #define F_DGEMV dgemv
00029 #define F_DSPMV dspmv
00030 #define F_DDOT ddot
00031 #elif FC_SYMBOL==3
00032 #define F_DAXPY DAXPY
00033 #define F_DCOPY DCOPY
00034 #define F_DGEMM DGEMM
00035 #define F_DROT DROT
00036 #define F_DSCAL DSCAL
00037 #define F_DGEMV DGEMV
00038 #define F_DSPMV DSPMV
00039 #define F_DDOT DDOT
00040 #elif FC_SYMBOL==4
00041 #define F_DAXPY DAXPY_
00042 #define F_DCOPY DCOPY_
00043 #define F_DGEMM DGEMM_
00044 #define F_DROT DROT_
00045 #define F_DSCAL DSCAL_
00046 #define F_DGEMV DGEMV_
00047 #define F_DSPMV DSPMV_
00048 #define F_DDOT DDOT_
00049 #endif
00050
00051 namespace psi{ namespace psimrcc{
00052
00053 extern "C" void F_DAXPY(int *length, double *a, double *x, int *inc_x,
00054 double *y, int *inc_y);
00055 extern "C" void F_DCOPY(int *length, double *x, int *inc_x,
00056 double *y, int *inc_y);
00057 extern "C" void F_DGEMM(char *transa, char *transb, int *m, int *n, int *k,
00058 double *alpha, double *A, int *lda, double *B, int *ldb,
00059 double *beta, double *C, int *ldc);
00060 extern "C" void F_DROT(int *ntot,double *x, int *incx,double *y, int *incy,
00061 double *cotheta,double *sintheta);
00062 extern "C" void F_DSCAL(int *n, double *alpha, double *vec, int *inc);
00063 extern "C" void F_DGEMV(char *transa, int *m, int *n, double *alpha, double *A,
00064 int *lda, double *X, int *inc_x, double *beta,
00065 double *Y, int *inc_y);
00066 extern "C" double F_DDOT(int *n, double *x, int *incx, double *y, int *incy);
00067
00068 void C_DGEMM_12(int m, int n, int k, double alpha,double *A, int nra,
00069 double *B, int ncb, double beta, double *C, int ncc);
00070 void C_DGEMM_22(int m, int n, int k, double alpha,double *A, int nca,
00071 double *B, int ncb, double beta, double *C, int ncc);
00072
00073
00074
00075
00076
00077
00078
00079 #if FC_SYMBOL==2
00080 #define F_DGEEV dgeev_
00081 #define F_DGESV dgesv_
00082 #define F_DGETRF dgetrf_
00083 #define F_DGETRI dgetri_
00084 #define F_DGESVD dgesvd_
00085 #define F_DSYEV dsyev_
00086 #elif FC_SYMBOL==1
00087 #define F_DGEEV dgeev
00088 #define F_DGESV dgesv
00089 #define F_DGETRF dgetrf
00090 #define F_DGETRI dgetri
00091 #define F_DGESVD dgesvd
00092 #define F_DSYEV dsyev
00093 #elif FC_SYMBOL==3
00094 #define F_DGEEV DGEEV
00095 #define F_DGESV DGESV
00096 #define F_DGETRF DGETRF
00097 #define F_DGETRI DGETRI
00098 #define F_DGESVD DGESVD
00099 #define F_DSYEV DSYEV
00100 #elif FC_SYMBOL==4
00101 #define F_DGEEV DGEEV_
00102 #define F_DGESV DGESV_
00103 #define F_DGETRF DGETRF_
00104 #define F_DGETRI DGETRI_
00105 #define F_DGESVD DGESVD_
00106 #define F_DSYEV DSYEV_
00107 #endif
00108
00109 extern "C" void F_DGEEV(char *jobvl, char *jobvr, int *n, double *a, int *lda,
00110 double *wr, double *wi, double *vl, int *ldvl, double *vr,
00111 int *ldvr, double *work, int *lwork, int *info);
00112 extern "C" void F_DGESV(int *n, int *nrhs, double *A, int *lda, int *ipiv,
00113 double *B, int *ldb, int *info);
00114
00115 }}
00116
00117 #endif // _psi_src_bin_psimrcc_algebra_interface_h