1a1e12872SBarry Smith /* 24fcfbe5fSBarry Smith This file dispatches between various header files for blas/lapack distributions to handle the name mangling. 34fcfbe5fSBarry Smith It also provides C prototypes for all the BLAS/LAPACK functions that PETSc uses 4f3da1532SBarry Smith 5f3da1532SBarry Smith This is not included automatically by petscsys.h because some external packages include their own prototypes for 6f3da1532SBarry Smith certain BLAS/LAPACK functions that conflict with the ones given here. Hence this should only be included when needed. 7f3da1532SBarry Smith 837c12098SBarry Smith The BLAS/LAPACK name mangling is almost (but not always) the same as the Fortran mangling; and exists even if there is 937c12098SBarry Smith not Fortran compiler. 1037c12098SBarry Smith 1137c12098SBarry Smith PETSC_BLASLAPACK_UNDERSCORE BLAS/LAPACK function have an underscore at the end of each function name 1237c12098SBarry Smith PETSC_BLASLAPACK_CAPS BLAS/LAPACK function names are all in capital letters 1337c12098SBarry Smith PETSC_BLASLAPACK_C BLAS/LAPACK function names have no mangling 1437c12098SBarry Smith 1537c12098SBarry Smith PETSC_BLASLAPACK_SINGLEISDOUBLE - for Cray systems where the BLAS/LAPACK single precision (i.e. Fortran single precision is actually 64 bits) 1637c12098SBarry Smith old Cray vector machines used to be this way, it is is not clear if any exist now. 1737c12098SBarry Smith 18570b7f6dSBarry Smith PetscBLASInt is almost always 32 bit integers but can be 64 bit integers for certain usages of MKL and OpenBLAS BLAS/LAPACK libraries 1937c12098SBarry Smith 20a1e12872SBarry Smith */ 21c3e41550SBarry Smith #if !defined(_BLASLAPACK_H) 22c3e41550SBarry Smith #define _BLASLAPACK_H 23bb638ab5SSatish Balay 246c737031SSatish Balay #include <petscconf.h> 256c737031SSatish Balay #if defined(__cplusplus) 266c737031SSatish Balay #define BLAS_EXTERN extern "C" 276c737031SSatish Balay #else 286c737031SSatish Balay #define BLAS_EXTERN extern 296c737031SSatish Balay #endif 306c737031SSatish Balay 318b83055fSJed Brown #define PetscStackCallBLAS(name,routine) do { \ 32a2f94806SJed Brown PetscStackPushNoCheck(name,PETSC_FALSE,PETSC_TRUE); \ 338b83055fSJed Brown routine; \ 348b83055fSJed Brown PetscStackPop; \ 358b83055fSJed Brown } while (0) 368b83055fSJed Brown 373ca90d2dSJacob Faibussowitsch static inline void PetscMissingLapack(const char *fname,...) 383c377650SSatish Balay { 393ca90d2dSJacob Faibussowitsch PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,PETSC_ERR_SUP,PETSC_ERROR_INITIAL,"%s - Lapack routine is unavailable.",fname); 403ca90d2dSJacob Faibussowitsch MPI_Abort(PETSC_COMM_SELF,PETSC_ERR_SUP); 413c377650SSatish Balay } 423c377650SSatish Balay 43e5b2100bSSteven G. Johnson #include <petscblaslapack_mangle.h> 44a1e12872SBarry Smith 456c737031SSatish Balay BLAS_EXTERN void LAPACKgetrf_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 46b9d4cb8dSJed Brown BLAS_EXTERN void LAPACKREALgetrf_(PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 476c737031SSatish Balay BLAS_EXTERN void LAPACKgetri_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 48b9d4cb8dSJed Brown BLAS_EXTERN void LAPACKREALgetri_(PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*); 493c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_ORGQR) 50c964aadfSJose E. Roman BLAS_EXTERN void LAPACKorgqr_(PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 513c377650SSatish Balay #else 523c377650SSatish Balay #define LAPACKorgqr_(a,b,c,d,e,f,g,h,i) PetscMissingLapack("ORGQR",a,b,c,d,e,f,g,h,i) 533c377650SSatish Balay #endif 546c737031SSatish Balay BLAS_EXTERN void LAPACKgeqrf_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 5549b12944SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SNRM2_RETURNS_DOUBLE) 566c737031SSatish Balay BLAS_EXTERN double BLASnrm2_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 5749b12944SBarry Smith #else 586c737031SSatish Balay BLAS_EXTERN PetscReal BLASnrm2_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 5949b12944SBarry Smith #endif 606c737031SSatish Balay BLAS_EXTERN void BLASscal_(const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*); 616c737031SSatish Balay BLAS_EXTERN void BLAScopy_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 626c737031SSatish Balay BLAS_EXTERN void BLASswap_(const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 636c737031SSatish Balay BLAS_EXTERN void BLASaxpy_(const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 6451da93a6SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SNRM2_RETURNS_DOUBLE) 656c737031SSatish Balay BLAS_EXTERN double BLASasum_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 6651da93a6SBarry Smith #else 676c737031SSatish Balay BLAS_EXTERN PetscReal BLASasum_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 6851da93a6SBarry Smith #endif 696c737031SSatish Balay BLAS_EXTERN void LAPACKpttrf_(const PetscBLASInt*,PetscReal*,PetscScalar*,const PetscBLASInt*); 703c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEIN) 716c737031SSatish Balay BLAS_EXTERN void LAPACKstein_(const PetscBLASInt*,PetscReal*,PetscReal*,const PetscBLASInt*,PetscReal*,const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscReal*,const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*); 723c377650SSatish Balay #else 733c377650SSatish Balay #define LAPACKstein_(a,b,c,d,e,f,g,h,i,j,k,l,m) PetscMissingLapack("STEIN",a,b,c,d,e,f,g,h,i,j,k,l) 743c377650SSatish Balay #endif 756c737031SSatish Balay BLAS_EXTERN void LAPACKgesv_(const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*); 76c35b00c6SBarry Smith 776c737031SSatish Balay BLAS_EXTERN void LAPACKpotrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 786c737031SSatish Balay BLAS_EXTERN void LAPACKpotri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 796c737031SSatish Balay BLAS_EXTERN void LAPACKpotrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 806c737031SSatish Balay BLAS_EXTERN void LAPACKsytrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 816c737031SSatish Balay BLAS_EXTERN void LAPACKsytrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 823c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_SYTRI) 836c737031SSatish Balay BLAS_EXTERN void LAPACKsytri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*); 843c377650SSatish Balay #else 853c377650SSatish Balay #define LAPACKsytri_(a,b,c,d,e,f,g) PetscMissingLapack("SYTRI",a,b,c,d,e,f,g) 863c377650SSatish Balay #endif 87916c178eSAndreas Fink BLAS_EXTERN void BLASsyrk_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*); 88916c178eSAndreas Fink BLAS_EXTERN void BLASsyr2k_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*); 896c737031SSatish Balay BLAS_EXTERN void BLASgemv_(const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar *,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*); 906c737031SSatish Balay BLAS_EXTERN void LAPACKgetrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 91916c178eSAndreas Fink BLAS_EXTERN void BLAStrmv_(const char*,const char*,const char*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 92916c178eSAndreas Fink BLAS_EXTERN void BLASgemm_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*); 93b9d4cb8dSJed Brown BLAS_EXTERN void BLASREALgemm_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,const PetscReal*,const PetscReal*,const PetscBLASInt*,const PetscReal*,const PetscBLASInt*,const PetscReal*,PetscReal*,const PetscBLASInt*); 94916c178eSAndreas Fink BLAS_EXTERN void BLASsymm_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*); 956c737031SSatish Balay BLAS_EXTERN void BLAStrsm_(const char*,const char*,const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 963c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_ORMQR) 97872393edSJose E. Roman BLAS_EXTERN void LAPACKormqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 983c377650SSatish Balay #else 993c377650SSatish Balay #define LAPACKormqr_(a,b,c,d,e,f,g,h,i,j,k,l,m) PetscMissingLapack("ORMQR",a,b,c,d,e,f,g,h,i,j,k,l,m) 1003c377650SSatish Balay #endif 1019369748bSToby Isaac #if !defined(PETSC_MISSING_LAPACK_STEGR) 1029369748bSToby Isaac BLAS_EXTERN void LAPACKstegr_(const char*,const char *,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 1039369748bSToby Isaac #else 1049369748bSToby Isaac #define LAPACKstegr_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) PetscMissingLapack("STEGR",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) 1059369748bSToby Isaac #endif 1063c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEQR) 1076c737031SSatish Balay BLAS_EXTERN void LAPACKsteqr_(const char*,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1086c737031SSatish Balay BLAS_EXTERN void LAPACKREALsteqr_(const char*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1093c377650SSatish Balay #else 1103c377650SSatish Balay #define LAPACKsteqr_(a,b,c,d,e,f,g,h) PetscMissingLapack("STEQR",a,b,c,d,e,f,g,h) 1113c377650SSatish Balay #define LAPACKREALsteqr_(a,b,c,d,e,f,g,h) PetscMissingLapack("STEQR",a,b,c,d,e,f,g,h) 1123c377650SSatish Balay #endif 1133c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HGEQZ) 1146c737031SSatish Balay BLAS_EXTERN void LAPACKhgeqz_(const char *,const char *,const char *,PetscBLASInt *,PetscBLASInt *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscScalar *,PetscScalar *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscBLASInt *); 1153c377650SSatish Balay #else 1163c377650SSatish Balay #define LAPACKhgeqz_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) PetscMissingLapack("HGEQZ",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) 1173c377650SSatish Balay #endif 1183c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRTRS) 1196c737031SSatish Balay BLAS_EXTERN void LAPACKtrtrs_(const char *,const char *, const char *,PetscBLASInt *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscBLASInt *); 1203c377650SSatish Balay #else 1213c377650SSatish Balay #define LAPACKtrtrs_(a,b,c,d,e,f,g,h,i,j) PetscMissingLapack("TRTRS",a,b,c,d,e,f,g,h,i,j) 1223c377650SSatish Balay #endif 1236c737031SSatish Balay BLAS_EXTERN void LAPACKgels_(const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*); 124c35b00c6SBarry Smith 125f16551e9SSatish Balay /* handle complex dot() with special code */ 126f16551e9SSatish Balay #if defined(PETSC_USE_COMPLEX) 127*9fbee547SJacob Faibussowitsch static inline PetscScalar BLASdot_(const PetscBLASInt *n,const PetscScalar *x,const PetscBLASInt *sx,const PetscScalar *y,const PetscBLASInt *sy) 128f16551e9SSatish Balay { 129f16551e9SSatish Balay PetscScalar sum=0.0; 1309669e4d8SBarry Smith PetscInt i,j,k; 131f16551e9SSatish Balay if (*sx==1 && *sy==1) { 132f16551e9SSatish Balay for (i=0; i < *n; i++) sum += PetscConj(x[i])*y[i]; 133f16551e9SSatish Balay } else { 134f16551e9SSatish Balay for (i=0,j=0,k=0; i < *n; i++,j+=*sx,k+=*sy) sum += PetscConj(x[j])*y[k]; 135f16551e9SSatish Balay } 136f16551e9SSatish Balay return sum; 137f16551e9SSatish Balay } 138*9fbee547SJacob Faibussowitsch static inline PetscScalar BLASdotu_(const PetscBLASInt *n,const PetscScalar *x,const PetscBLASInt *sx,const PetscScalar *y,const PetscBLASInt *sy) 139f16551e9SSatish Balay { 140f16551e9SSatish Balay PetscScalar sum=0.0; 1419669e4d8SBarry Smith PetscInt i,j,k; 142f16551e9SSatish Balay if (*sx==1 && *sy==1) { 143f16551e9SSatish Balay for (i=0; i < *n; i++) sum += x[i]*y[i]; 144f16551e9SSatish Balay } else { 145f16551e9SSatish Balay for (i=0,j=0,k=0; i < *n; i++,j+=*sx,k+=*sy) sum += x[j]*y[k]; 146f16551e9SSatish Balay } 147f16551e9SSatish Balay return sum; 148f16551e9SSatish Balay } 149f16551e9SSatish Balay #else 15049b12944SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SDOT_RETURNS_DOUBLE) 1516c737031SSatish Balay BLAS_EXTERN double BLASdot_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 1526c737031SSatish Balay BLAS_EXTERN double BLASdotu_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 15349b12944SBarry Smith #else 1546c737031SSatish Balay BLAS_EXTERN PetscScalar BLASdot_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 155f16551e9SSatish Balay #endif 15649b12944SBarry Smith #endif 157f16551e9SSatish Balay 15865da4498SStefano Zampini /* Some functions prototypes do not exist for reals */ 15965da4498SStefano Zampini #if defined(PETSC_USE_COMPLEX) 1606c737031SSatish Balay BLAS_EXTERN void LAPACKhetrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1616c737031SSatish Balay BLAS_EXTERN void LAPACKhetrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1626c737031SSatish Balay BLAS_EXTERN void LAPACKhetri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*); 16365da4498SStefano Zampini #endif 164976cf19bSSatish Balay /* Some functions prototypes differ between real and complex */ 165976cf19bSSatish Balay #if defined(PETSC_USE_COMPLEX) 1663c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GELSS) 1676c737031SSatish Balay BLAS_EXTERN void LAPACKgelss_(const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscReal*,const PetscReal*,PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscReal*,PetscBLASInt*); 1683c377650SSatish Balay #else 1693c377650SSatish Balay #define LAPACKgelss_(a,b,c,d,e,f,g,h,i,j,k,l,m,n) PetscMissingLapack("GELSS",a,b,c,d,e,f,g,h,i,j,k,l,m,n) 1703c377650SSatish Balay #endif 1716c737031SSatish Balay BLAS_EXTERN void LAPACKsyev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1726c737031SSatish Balay BLAS_EXTERN void LAPACKsyevx_(const char*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 1736c737031SSatish Balay BLAS_EXTERN void LAPACKsygv_(PetscBLASInt*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1746c737031SSatish Balay BLAS_EXTERN void LAPACKsygvx_(PetscBLASInt*,const char*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 1756c737031SSatish Balay BLAS_EXTERN void LAPACKpttrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1763c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GERFS) 1776c737031SSatish Balay BLAS_EXTERN void LAPACKgerfs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscReal*,PetscBLASInt*); 1783c377650SSatish Balay #else 1793c377650SSatish Balay #define LAPACKgerfs_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) PetscMissingLapack("GERFS",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) 1803c377650SSatish Balay #endif 1813c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRSEN) 1826c737031SSatish Balay BLAS_EXTERN void LAPACKtrsen_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1833c377650SSatish Balay #else 1843c377650SSatish Balay #define LAPACKtrsen_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) PetscMissingLapack("TRSEN",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) 1853c377650SSatish Balay #endif 1863c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TGSEN) 1876c737031SSatish Balay BLAS_EXTERN void LAPACKtgsen_(PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 1883c377650SSatish Balay #else 1893c377650SSatish Balay #define LAPACKtgsen_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) PetscMissingLapack("TGSEN",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) 1903c377650SSatish Balay #endif 1913c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GGES) 1926c737031SSatish Balay BLAS_EXTERN void LAPACKgges_(const char*,const char*,const char*,PetscBLASInt(*)(),PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*); 1933c377650SSatish Balay #else 1943c377650SSatish Balay #define LAPACKgges_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) PetscMissingLapack("GGES",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) 1953c377650SSatish Balay #endif 1963c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HSEQR) 1976c737031SSatish Balay BLAS_EXTERN void LAPACKhseqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 198976cf19bSSatish Balay #else 1993c377650SSatish Balay #define LAPACKhseqr_(a,b,c,d,e,f,g,h,i,j,k,l,m) PetscMissingLapack("HSEQR",a,b,c,d,e,f,g,h,i,j,k,l,m) 2003c377650SSatish Balay #endif 2013c377650SSatish Balay #else /* !defined(PETSC_USE_COMPLEX) */ 2023c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GELSS) 2036c737031SSatish Balay BLAS_EXTERN void LAPACKgelss_(const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscReal*,const PetscReal*,PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*); 2043c377650SSatish Balay #else 2053c377650SSatish Balay #define LAPACKgelss_(a,b,c,d,e,f,g,h,i,j,k,l,m) PetscMissingLapack("GELSS",a,b,c,d,e,f,g,h,i,j,k,l,m) 2063c377650SSatish Balay #endif 2076c737031SSatish Balay BLAS_EXTERN void LAPACKsyev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2086c737031SSatish Balay BLAS_EXTERN void LAPACKsyevx_(const char*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 2096c737031SSatish Balay BLAS_EXTERN void LAPACKsygv_(PetscBLASInt*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2106c737031SSatish Balay BLAS_EXTERN void LAPACKsygvx_(PetscBLASInt*,const char*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 2116c737031SSatish Balay BLAS_EXTERN void LAPACKpttrs_(PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2123c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEBZ) 2136c737031SSatish Balay BLAS_EXTERN void LAPACKstebz_(const char*,const char*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*); 2143c377650SSatish Balay #else 2153c377650SSatish Balay #define LAPACKstebz_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) PetscMissingLapack("STEBZ",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) 216976cf19bSSatish Balay #endif 2173c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GERFS) 2183c377650SSatish Balay BLAS_EXTERN void LAPACKgerfs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2193c377650SSatish Balay #else 2203c377650SSatish Balay #define LAPACKgerfs_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) PetscMissingLapack("GERFS",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) 2213c377650SSatish Balay #endif 2223c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRSEN) 2233c377650SSatish Balay BLAS_EXTERN void LAPACKtrsen_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 2243c377650SSatish Balay #else 2253c377650SSatish Balay #define LAPACKtrsen_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) PetscMissingLapack("TRSEN",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) 2263c377650SSatish Balay #endif 2273c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TGSEN) 2283c377650SSatish Balay BLAS_EXTERN void LAPACKtgsen_(PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 2293c377650SSatish Balay #else 2303c377650SSatish Balay #define LAPACKtgsen_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) PetscMissingLapack("TGSEN",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) 2313c377650SSatish Balay #endif 2323c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GGES) 2333c377650SSatish Balay BLAS_EXTERN void LAPACKgges_(const char*,const char*,const char*,PetscBLASInt(*)(void),PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 2343c377650SSatish Balay #else 2353c377650SSatish Balay #define LAPACKgges_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) PetscMissingLapack("GGES",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) 2363c377650SSatish Balay #endif 2373c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HSEQR) 2383c377650SSatish Balay BLAS_EXTERN void LAPACKhseqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2393c377650SSatish Balay #else 2403c377650SSatish Balay #define LAPACKhseqr_(a,b,c,d,e,f,g,h,i,j,k,l,m,n) PetscMissingLapack("HSEQR",a,b,c,d,e,f,g,h,i,j,k,l,m,n) 2413c377650SSatish Balay #endif 2423c377650SSatish Balay #endif /* defined(PETSC_USE_COMPLEX) */ 243976cf19bSSatish Balay 2441148afceSStefano Zampini #if defined(PETSC_USE_COMPLEX) 2456c737031SSatish Balay BLAS_EXTERN void LAPACKgeev_(const char*,const char*,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 246e2b200f6SPierre Jolivet BLAS_EXTERN void LAPACKgesvd_(const char*,const char*,const PetscBLASInt *,const PetscBLASInt*,PetscScalar *,const PetscBLASInt*,PetscReal*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscReal*,PetscBLASInt*); 247976cf19bSSatish Balay #else 2486c737031SSatish Balay BLAS_EXTERN void LAPACKgeev_(const char*,const char*,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 249e2b200f6SPierre Jolivet BLAS_EXTERN void LAPACKgesvd_(const char*,const char*,const PetscBLASInt *,const PetscBLASInt*,PetscScalar *,const PetscBLASInt*,PetscReal*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*); 250c35b00c6SBarry Smith #endif 251c35b00c6SBarry Smith 252c35b00c6SBarry Smith #endif 253