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