00001 //************************************************************************** 00002 // 00003 // NOTICE 00004 // 00005 // This software is a result of the research described in the report 00006 // 00007 // " A comparison of algorithms for modal analysis in the absence 00008 // of a sparse direct method", P. Arbenz, R. Lehoucq, and U. Hetmaniuk, 00009 // Sandia National Laboratories, Technical report SAND2003-1028J. 00010 // 00011 // It is based on the Epetra, AztecOO, and ML packages defined in the Trilinos 00012 // framework ( http://software.sandia.gov/trilinos/ ). 00013 // 00014 // The distribution of this software follows also the rules defined in Trilinos. 00015 // This notice shall be marked on any reproduction of this software, in whole or 00016 // in part. 00017 // 00018 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00019 // license for use of this work by or on behalf of the U.S. Government. 00020 // 00021 // This program is distributed in the hope that it will be useful, but 00022 // WITHOUT ANY WARRANTY; without even the implied warranty of 00023 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00024 // 00025 // Code Authors: U. Hetmaniuk (ulhetma@sandia.gov), R. Lehoucq (rblehou@sandia.gov) 00026 // 00027 //************************************************************************** 00028 00029 #ifndef FORTRAN_ROUTINES 00030 #define FORTRAN_ROUTINES 00031 00032 #include "Epetra_BLAS_wrappers.h" 00033 #include "Teuchos_LAPACK_wrappers.hpp" 00034 00035 #ifdef EPETRA_MPI 00036 #include "mpi.h" 00037 #endif 00038 00039 // LOGICAL as 4 bytes 00040 typedef int LOGICAL; 00041 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00046 // Double precision BLAS 1 // 00047 00048 void PREFIX F77_FUNC(dswap,DSWAP)(int *n, double x[], int* incx, double y[], int* incy); 00049 00050 /* 00051 // Double precision LAPACK // 00052 void PREFIX F77_FUNC(dgeqrf,DGEQRF)(int *M, int *N, double *A, int *lda, double *tau, 00053 double *work, int *lwork, int *info); 00054 void PREFIX F77_FUNC(dormqr,DORMQR)(Epetra_fcd, Epetra_fcd, int *M, int *N, int *K, double *A, 00055 int *lda, double *tau, double *C, int *ldc, double *work, int *lwork, 00056 int *info); 00057 void PREFIX F77_FUNC(dspev,DSPEV)(Epetra_fcd, Epetra_fcd, int *N, double *A, double *W, 00058 double *Z, int *ldz, double *work, int *info); 00059 void PREFIX F77_FUNC(dsteqr,DSTEQR)(Epetra_fcd, int *N, double *D, double *E, double *Z, 00060 int *ldz, double *work, int *info); 00061 void PREFIX F77_FUNC(dsyev,DSYEV)(Epetra_fcd, Epetra_fcd, int *N, double *A, int *lda, 00062 double *W, double *work, int *lwork, int *info); 00063 void PREFIX F77_FUNC(dsygv,DSYGV)(int *itype, Epetra_fcd, Epetra_fcd, int *N, double *A, 00064 int *lda, double *B, int *ldb, double *W, double *work, int *lwork, 00065 int *info); 00066 00067 #if defined (INTEL_CXML) 00068 00069 int PREFIX F77_FUNC(ilaenv,ILAENV)(int *ispec, char *NAME, unsigned int len_name, char *OPTS, 00070 unsigned int len_opts, int *N1, int *N2, int *N3, int *N4); 00071 00072 #else 00073 00074 int PREFIX F77_FUNC(ilaenv,ILAENV)(int *ispec, char *NAME, char *OPTS, int *N1, int *N2, 00075 int *N3, int *N4, int len_name, int len_opts); 00076 00077 #endif 00078 00079 */ 00080 00081 #if 0 00082 // Double precision customized ARPACK routines // 00083 #if defined (INTEL_CXML) 00084 void PREFIX F77_FUNC(mydsaupd,MYDSAUPD)(int *, char *, unsigned int, int *, char *, 00085 unsigned int, int *, double *, double *, int *, double *, int *, int *, 00086 int *, double *, double *, int *, int *, int *); 00087 void PREFIX F77_FUNC(dseupd,DSEUPD)(LOGICAL *rvec, char *HOWMNY, unsigned int len_howny, 00088 LOGICAL *select, double *D, double *Z, int *ldz, double *sigma, char *BMAT, 00089 unsigned int len_bmat, int *N, char *which, unsigned int len_which, 00090 int *nev, double *tol, double *resid, int *ncv, double *V, int *ldv, 00091 int *iparam, int *ipntr, double *workd, double *workl, int *lworkl, 00092 int *info); 00093 #else 00094 void PREFIX F77_FUNC(mydsaupd,MYDSAUPD)(int *, char *, int *, char *, int *, 00095 double *, double *, int *, double *, int *, int *, int *, double *, 00096 double *, int *, int *, int *, int, int); 00097 void PREFIX F77_FUNC(dseupd,DSEUPD)(LOGICAL *rvec, char *HOWMNY, LOGICAL *select, double *D, 00098 double *Z, int *ldz, double *sigma, char *BMAT, int *N, char *which, 00099 int *nev, double *tol, double *resid, int *ncv, double *V, int *ldv, 00100 int *iparam, int *ipntr, double *workd, double *workl, int *lworkl, 00101 int *info, int len_howmny, int len_bmat, int len_which); 00102 #endif 00103 00104 #ifdef EPETRA_MPI 00105 00106 // Double precision customized PARPACK routines // 00107 #if defined (INTEL_CXML) 00108 /* 00109 void PREFIX F77_FUNC(mypdsaupd,MYPDSAUPD)(MPI_Comm *, int *, char *, unsigned int, int *, 00110 char *, unsigned int, int *, double *, double *, int *, double *, 00111 int *, int *, int *, double *, double *, int *, int *, int *); 00112 void PREFIX F77_FUNC(pdseupd,PDSEUPD)(MPI_Comm *MyComm, LOGICAL *rvec, char *HOWMNY, 00113 unsigned int len_howmny, LOGICAL *select, double *D, double *Z, 00114 int *ldz, double *sigma, char *BMAT, unsigned int len_bmat, int *N, 00115 char *which, unsigned int len_which, int *nev, double *tol, double *resid, 00116 int *ncv, double *V, int *ldv, int *iparam, int *ipntr, double *workd, 00117 double *workl, int *lworkl, int *info); 00118 */ 00119 #else 00120 /* 00121 void PREFIX F77_FUNC(mypdsaupd,MYPDSAUPD)(MPI_Comm *, int *, char *, int *, char *, int *, 00122 double *, double *, int *, double *, int *, int *, int *, double *, 00123 double *, int *, int *, int *, int, int); 00124 void PREFIX F77_FUNC(pdseupd,PDSEUPD)(MPI_Comm *MyComm, LOGICAL *rvec, char *HOWMNY, 00125 LOGICAL *select, double *D, double *Z, int *ldz, double *sigma, 00126 char *BMAT, int *N, char *which, int *nev, double *tol, double *resid, 00127 int *ncv, double *V, int *ldv, int *iparam, int *ipntr, double *workd, 00128 double *workl, int *lworkl, int *info, int len_howmny, 00129 int len_bmat, int len_which); 00130 */ 00131 #endif 00132 00133 #endif 00134 #endif 00135 00136 #ifdef __cplusplus 00137 } 00138 #endif 00139 00140 class FortranRoutines { 00141 00142 public: 00143 00144 // Double precision BLAS 1 // 00145 void SCAL_INCX(int N, double ALPHA, double *X, int incX) const; 00146 00147 00148 void SWAP(int N, double *X, int incx, double *Y, int incy) const; 00149 00150 /* 00151 // Double precision LAPACK // 00152 void GEQRF(int M, int N, double *A, int lda, double *tau, double *work, int lwork, 00153 int *info) const; 00154 void ORMQR(char SIDE, char TRANS, int M, int N, int K, double *A, int lda, double *tau, 00155 double *C, int ldc, double *work, int lwork, int *info) const; 00156 void SPEV(char JOBZ, char UPLO, int N, double *A, double *W, double *Z, int ldz, 00157 double *work, int *info) const; 00158 void STEQR(char COMPZ, int N, double *D, double *E, double *Z, int ldz, double *work, 00159 int *info) const; 00160 */ 00161 void SYEV(char JOBZ, char UPLO, int N, double *A, int lda, double *W, double *work, 00162 int lwork, int *info) const; 00163 00164 void SYGV(int itype, char JOBZ, char UPLO, int N, double *A, int lda, double *B, int ldb, 00165 double *W, double *work, int lwork, int *info) const; 00166 00167 int LAENV(int ispec, char *NAME, char *OPTS, int N1, int N2, int N3, int N4, 00168 int len_name, int len_opts) const; 00169 00170 #if 0 00171 // Double precision ARPACK routines 00172 void SAUPD(int *ido, char BMAT, int N, char *which, int nev, double tol, double *resid, 00173 int ncv, double *V, int ldv, int *iparam, int *ipntr, double *workd, double *workl, 00174 int lworkl, int *info, int verbose) const; 00175 void SEUPD(LOGICAL rvec, char HOWMNY, LOGICAL *select, double *D, double *Z, int ldz, 00176 double sigma, char BMAT, int N, char *which, int nev, double tol, double *resid, 00177 int ncv, double *V, int ldv, int *iparam, int *ipntr, double *workd, 00178 double *workl, int lworkl, int *info) const; 00179 00180 #ifdef EPETRA_MPI 00181 // Double precision PARPACK routines 00182 void PSAUPD(MPI_Comm MyComm, int *ido, char BMAT, int N, char *which, int nev, double tol, 00183 double *resid, int ncv, double *V, int ldv, int *iparam, int *ipntr, double *workd, 00184 double *workl, int lworkl, int *info, int verbose) const; 00185 void PSEUPD(MPI_Comm MyComm, LOGICAL rvec, char HOWMNY, LOGICAL *select, double *D, double *Z, 00186 int ldz, double sigma, char BMAT, int N, char *which, int nev, double tol, 00187 double *resid, int ncv, double *V, int ldv, int *iparam, int *ipntr, double *workd, 00188 double *workl, int lworkl, int *info) const; 00189 00190 #endif 00191 #endif 00192 00193 }; 00194 00195 #endif