1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
|
/*
* This file is part of tela the Tensor Language.
* Copyright (c) 1994-1996 Pekka Janhunen
*/
#if defined(HPUX) && !defined(__GNUC__)
# define NO_UNDERSCORE_IN_FORTRAN_NAMES
#endif
#ifdef NO_UNDERSCORE_IN_FORTRAN_NAMES
# define Fortran(x) x
#else
# define Fortran(x) x##_
#endif
#ifdef UNICOS
# define RGETRF SGETRF
# define RPOTRF SPOTRF
# define RGETRI SGETRI
# define RGETRS SGETRS
# define RGESV SGESV
# define RGELS SGELS
# define RGEEV SGEEV
# define RGESVD SGESVD
# define RGEMM SGEMM
# define RDOT SDOT
# define RAXPY SAXPY
#else
# define RGETRF Fortran(dgetrf)
# define RPOTRF Fortran(dpotrf)
# define RGETRI Fortran(dgetri)
# define RGETRS Fortran(dgetrs)
# define RGESV Fortran(dgesv)
# define RGELS Fortran(dgels)
# define RGEEV Fortran(dgeev)
# define RGESVD Fortran(dgesvd)
# define CGETRF Fortran(zgetrf)
# define CPOTRF Fortran(zpotrf)
# define CGETRI Fortran(zgetri)
# define CGETRS Fortran(zgetrs)
# define CGESV Fortran(zgesv)
# define CGELS Fortran(zgels)
# define CGEEV Fortran(zgeev)
# define CGESVD Fortran(zgesvd)
# define RGEMM Fortran(dgemm)
# define CGEMM Fortran(zgemm)
# define RDOT Fortran(ddot)
# define RAXPY Fortran(daxpy)
# define CAXPY Fortran(zaxpy)
#endif
extern "C" {
/* LAPACK routines: */
/* ---------------- */
void RGETRF (const Tint& M, const Tint& N,
Treal A[], const Tint& LDA,
Tint IPIV[],
Tint& INFO);
void RPOTRF(const char*UPLO,
const Tint& N,
Treal A[], const Tint& LDA,
Tint& INFO);
void RGETRI (const Tint& N,
Treal A[], const Tint& LDA,
const Tint IPIV[],
Treal WORK[], const Tint& LWORK,
Tint& INFO);
void RGETRS (const char*TRANS,
const Tint& N,
const Tint& NRHS,
const Treal A[], const Tint& LDA,
const Tint IPIV[],
Treal B[], const Tint& LDB,
Tint& INFO);
void RGESV (const Tint& N,
const Tint& NRHS,
Treal A[],
const Tint& LDA,
Tint IPIV[],
Treal B[],
const Tint& LDB,
Tint& INFO);
void RGELS (const char*TRANSA,
const Tint& M,
const Tint& N,
const Tint& NRHS,
Treal A[],
const Tint& LDA,
Treal B[],
const Tint& LDB,
Treal WORK[],
const Tint& LWORK,
Tint& INFO);
void RGEEV (const char*JOBVL, const char*JOBVR,
const Tint& N,
Treal A[],
const Tint& LDA,
Treal WR[], Treal WI[],
Treal VL[], const Tint& LDVL,
Treal VR[], const Tint& LDVR,
Treal WORK[], const Tint& LWORK,
Tint& info);
void RGESVD (const char*JOBU, const char*JOBVT,
const Tint& M, const Tint& N,
Treal A[], const Tint& LDA,
Treal S[],
Treal U[], const Tint& LDU,
Treal VT[], const Tint& LDVT,
Treal WORK[], const Tint& LWORK,
Tint& INFO);
void CGETRF (const Tint& M, const Tint& N,
Tcomplex A[], const Tint& LDA,
Tint IPIV[],
Tint& INFO);
void CPOTRF(const char*UPLO,
const Tint& N,
Tcomplex A[], const Tint& LDA,
Tint& INFO);
void CGETRI (const Tint& N,
Tcomplex A[], const Tint& LDA,
const Tint IPIV[],
Tcomplex WORK[], const Tint& LWORK,
Tint& INFO);
void CGETRS (const char*TRANS,
const Tint& N,
const Tint& NRHS,
const Tcomplex A[], const Tint& LDA,
const Tint IPIV[],
Tcomplex B[], const Tint& LDB,
Tint& INFO);
void CGESV (const Tint& N,
const Tint& NRHS,
Tcomplex A[],
const Tint& LDA,
Tint IPIV[],
Tcomplex B[],
const Tint& LDB,
Tint& INFO);
void CGELS (const char*TRANSA,
const Tint& M,
const Tint& N,
const Tint& NRHS,
Tcomplex A[],
const Tint& LDA,
Tcomplex B[],
const Tint& LDB,
Tcomplex WORK[],
const Tint& LWORK,
Tint& INFO);
void CGEEV (const char*JOBVL, const char*JOBVR,
const Tint& N,
Tcomplex A[], const Tint& LDA,
Tcomplex W[],
Tcomplex VL[], const Tint& LDVL,
Tcomplex VR[], const Tint& LDVR,
Tcomplex WORK[], const Tint& LWORK,
Treal RWORK[],
Tint& INFO);
void CGESVD (const char*JOBU, const char*JOBVT,
const Tint& M, const Tint& N,
Tcomplex A[], const Tint& LDA,
Treal S[],
Tcomplex U[], const Tint& LDU,
Tcomplex VT[], const Tint& LDVT,
Tcomplex WORK[], const Tint& LWORK,
Treal RWORK[],
Tint& INFO);
/* Level-1 BLAS routines: */
/* ---------------------- */
Treal RDOT (const Tint& N, const Treal x[], const Tint& incx, const Treal y[], const Tint& incy);
void RAXPY(const Tint& N,
const Treal& alpha,
const Treal x[], const Tint& incx,
Treal y[], const Tint& incy);
void CAXPY(const Tint& N,
const Tcomplex& alpha,
const Tcomplex x[], const Tint& incx,
Tcomplex y[], const Tint& incy);
/* Level-3 BLAS routines: */
/* ---------------------- */
void RGEMM (const char* TRANSA, const char* TRANSB,
const Tint& M, const Tint& N, const Tint& K,
const Treal& ALPHA,
const Treal A[], const Tint& LDA,
const Treal B[], const Tint& LDB,
const Treal& BETA,
Treal C[], const Tint& LDC);
void CGEMM (const char* TRANSA, const char* TRANSB,
const Tint& M, const Tint& N, const Tint& K,
const Tcomplex& ALPHA,
const Tcomplex A[], const Tint& LDA,
const Tcomplex B[], const Tint& LDB,
const Tcomplex& BETA,
Tcomplex C[], const Tint& LDC);
}
|