xref: /petsc/include/petscblaslapack.h (revision db1cb5662e0a2578adcdbeb5708d2347aee15ec5)
1 /*
2    This file provides some name space protection from LAPACK and BLAS and
3 allows the appropriate single or double precision version to be used.
4 This file also deals with different Fortran 77 naming conventions on machines.
5 
6    Another problem is character strings are represented differently on
7 on some machines in C and Fortran 77. This problem comes up on the
8 Cray T3D/T3E.
9 
10 */
11 #if !defined(_BLASLAPACK_H)
12 #define _BLASLAPACK_H
13 #include "petsc.h"
14 PETSC_EXTERN_CXX_BEGIN
15 
16 #if defined(PETSC_BLASLAPACK_MKL64_ONLY)
17 # define PETSC_MISSING_LAPACK_GESVD
18 # define PETSC_MISSING_LAPACK_GEEV
19 # define PETSC_MISSING_LAPACK_SYGV
20 # define PETSC_MISSING_LAPACK_SYGVX
21 # define PETSC_MISSING_LAPACK_GETRF
22 # define PETSC_MISSING_LAPACK_POTRF
23 # define PETSC_MISSING_LAPACK_GETRS
24 # define PETSC_MISSING_LAPACK_POTRS
25 #elif defined(PETSC_BLASLAPACK_MKL_ONLY)
26 # define PETSC_MISSING_LAPACK_GESVD
27 # define PETSC_MISSING_LAPACK_GEEV
28 # define PETSC_MISSING_LAPACK_SYGV
29 # define PETSC_MISSING_LAPACK_SYGVX
30 #elif defined(PETSC_BLASLAPACK_CRAY_ONLY)
31 # define PETSC_MISSING_LAPACK_GESVD
32 #elif defined(PETSC_BLASLAPACK_ESSL_ONLY)
33 # define PETSC_MISSING_LAPACK_GESVD
34 # define PETSC_MISSING_LAPACK_GETRF
35 # define PETSC_MISSING_LAPACK_GETRS
36 # define PETSC_MISSING_LAPACK_POTRF
37 # define PETSC_MISSING_LAPACK_POTRS
38 #endif
39 
40 /*
41    This include file on the Cray T3D/T3E defines the interface between
42   Fortran and C representations of character strings.
43 */
44 #if defined(PETSC_USES_CPTOFCD)
45 # include <fortran.h>
46 #endif
47 
48 #if !defined(PETSC_USE_COMPLEX)
49 
50 /*
51     These are real case with no character string arguments
52 */
53 
54 # if defined(PETSC_USES_FORTRAN_SINGLE)
55 /*
56    For these machines we must call the single precision Fortran version
57 */
58 #  define DGEQRF   SGEQRF
59 #  define DGETRF   SGETRF
60 #  define DDOT     SDOT
61 #  define DNRM2    SNRM2
62 #  define DSCAL    SSCAL
63 #  define DCOPY    SCOPY
64 #  define DSWAP    SSWAP
65 #  define DAXPY    SAXPY
66 #  define DASUM    SASUM
67 #  define DSORMQR  SORMQR
68 #  define DTRTRS   STRTRS
69 #  define DPOTRF   SPOTRF
70 #  define DPOTRS   SPOTRS
71 #  define DGEMV    SGEMV
72 #  define DGETRS   SGETRS
73 #  define DGETRS   SGETRS
74 #  define DGEMM    SGEMM
75 #  define DGESVD   SGESVD
76 #  define DGEEV    SGEEV
77 #  define DSYGV    SSYGV
78 #  define DSYGVX   SSYGVX
79 #  define DTRMV    STRMV
80 #  define DTRSL    STRSL
81 # endif
82 
83 # if defined(PETSC_USE_SINGLE)
84 
85 #  if defined(PETSC_HAVE_FORTRAN_UNDERSCORE) || defined(PETSC_BLASLAPACK_F2C)
86 #   define LAPACKgeqrf_ sgeqrf_
87 #   define LAPACKgetrf_ sgetrf_
88 #   define LAPACKgetf2_ sgetf2_
89 #   define BLASdot_     sdot_
90 #   define BLASnrm2_    snrm2_
91 #   define BLASscal_    sscal_
92 #   define BLAScopy_    scopy_
93 #   define BLASswap_    sswap_
94 #   define BLASaxpy_    saxpy_
95 #   define BLASasum_    sasum_
96 #  elif defined(PETSC_HAVE_FORTRAN_CAPS)
97 #   define LAPACKgeqrf_ SGEQRF
98 #   define LAPACKgetrf_ SGETRF
99 #   define LAPACKgetf2_ SGETF2
100 #   define BLASdot_     SDOT
101 #   define BLASnrm2_    SNRM2
102 #   define BLASscal_    SSCAL
103 #   define BLAScopy_    SCOPY
104 #   define BLASswap_    SSWAP
105 #   define BLASaxpy_    SAXPY
106 #   define BLASasum_    SASUM
107 #  else
108 #   define LAPACKgeqrf_ sgeqrf
109 #   define LAPACKgetrf_ sgetrf
110 #   define LAPACKgetf2_ sgetf2
111 #   define BLASdot_     sdot
112 #   define BLASnrm2_    snrm2
113 #   define BLASscal_    sscal
114 #   define BLAScopy_    scopy
115 #   define BLASswap_    sswap
116 #   define BLASaxpy_    saxpy
117 #   define BLASasum_    sasum
118 #  endif
119 
120 # else
121 
122 #  if defined(PETSC_HAVE_FORTRAN_UNDERSCORE) || defined(PETSC_BLASLAPACK_F2C)
123 #   define LAPACKgeqrf_ dgeqrf_
124 #   define LAPACKgetrf_ dgetrf_
125 #   define LAPACKgetf2_ dgetf2_
126 #   define BLASdot_     ddot_
127 #   define BLASnrm2_    dnrm2_
128 #   define BLASscal_    dscal_
129 #   define BLAScopy_    dcopy_
130 #   define BLASswap_    dswap_
131 #   define BLASaxpy_    daxpy_
132 #   define BLASasum_    dasum_
133 #  elif defined(PETSC_HAVE_FORTRAN_CAPS)
134 #   define LAPACKgeqrf_ DGEQRF
135 #   define LAPACKgetrf_ DGETRF
136 #   define LAPACKgetf2_ DGETF2
137 #   define BLASdot_     DDOT
138 #   define BLASnrm2_    DNRM2
139 #   define BLASscal_    DSCAL
140 #   define BLAScopy_    DCOPY
141 #   define BLASswap_    DSWAP
142 #   define BLASaxpy_    DAXPY
143 #   define BLASasum_    DASUM
144 #  else
145 #   define LAPACKgeqrf_ dgeqrf
146 #   define LAPACKgetrf_ dgetrf
147 #   define LAPACKgetf2_ dgetf2
148 #   define BLASdot_     ddot
149 #   define BLASnrm2_    dnrm2
150 #   define BLASscal_    dscal
151 #   define BLAScopy_    dcopy
152 #   define BLASswap_    dswap
153 #   define BLASaxpy_    daxpy
154 #   define BLASasum_    dasum
155 #  endif
156 
157 # endif
158 
159 /*
160    Real with character string arguments.
161 */
162 # if defined(PETSC_USES_CPTOFCD)
163 /*
164    Note that this assumes that machines which use cptofcd() use
165   the PETSC_HAVE_FORTRAN_CAPS option. This is true on the Cray T3D/T3E.
166 */
167 #  define LAPACKormqr_(a,b,c,d,e,f,g,h,i,j,k,l,m)   DORMQR(_cptofcd((a),1),_cptofcd((b),1),(c),(d),(e),(f),(g),(h),(i),(j),(k),(l),(m))
168 #  define LAPACKtrtrs_(a,b,c,d,e,f,g,h,i,j)         DTRTRS(_cptofcd((a),1),_cptofcd((b),1),_cptofcd((c),1),(d),(e),(f),(g),(h),(i),(j))
169 #  define LAPACKpotrf_(a,b,c,d,e)                   DPOTRF(_cptofcd((a),1),(b),(c),(d),(e))
170 #  define LAPACKpotrs_(a,b,c,d,e,f,g,h)             DPOTRS(_cptofcd((a),1),(b),(c),(d),(e),(f),(g),(h))
171 #  define BLASgemv_(a,b,c,d,e,f,g,h,i,j,k)          DGEMV(_cptofcd((a),1),(b),(c),(d),(e),(f),(g),(h),(i),(j),(k))
172 #  define LAPACKgetrs_(a,b,c,d,e,f,g,h,i)           DGETRS(_cptofcd((a),1),(b),(c),(d),(e),(f),(g),(h),(i))
173 #  define BLASgemm_(a,b,c,d,e,f,g,h,i,j,k,l,m)      DGEMM(_cptofcd((a),1), _cptofcd((b),1),(c),(d),(e),(f),(g),(h),(i),(j),(k),(l),(m))
174 #  define LAPACKgesvd_(a,b,c,d,e,f,g,h,i,j,k,l,m,n) DGESVD(_cptofcd((a),1),_cptofcd((b),1),(c),(d),(e),(f),(g),(h),(i),(j),(k),(l),(m),(n))
175 #  define LAPACKgeev_(a,b,c,d,e,f,g,h,i,j,k,l,m,n)  DGEEV(_cptofcd((a),1),_cptofcd((b),1),(c),(d),(e),(f),(g),(h),(i),(j),(k),(l),(m),(n))
176 #  define LAPACKsygv_(a,b,c,d,e,f,g,h,i,j,k,l)      DSYGV((a),_cptofcd((b),1),_cptofcd((c),1),(d),(e),(f),(g),(h),(i),(j),(k),(l))
177 #  define LAPACKsygvx_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w) DSYGVX((a),_cptofcd((b),1),_cptofcd((c),1),_cptofcd((d),1),(e),(f),(g),(h),(i),(j),(k),(l),(m),(n),(o),(p),(q),(r),(s),(t),(u),(v),(w))
178 #  define BLAStrmv_  DTRMV
179 #  define LAPACKtrsl_  DTRSL
180 #  define LAPACKgetrf_ DGETRF
181 
182 # elif defined(PETSC_USE_SINGLE)
183 
184 #  if defined(PETSC_HAVE_FORTRAN_UNDERSCORE) || defined(PETSC_BLASLAPACK_F2C)
185 #   define LAPACKormqr_ sormqr_
186 #   define LAPACKtrtrs_ strtrs_
187 #   define LAPACKpotrf_ spotrf_
188 #   define LAPACKpotrs_ spotrs_
189 #   define BLASgemv_  sgemv_
190 #   define LAPACKgetrs_ sgetrs_
191 #   define BLAStrmv_  strmv_
192 #   define LAPACKtrsl_  strsl_
193 #   define BLASgemm_  sgemm_
194 #   define LAPACKgesvd_ sgesvd_
195 #   define LAPACKgeev_  sgeev_
196 #   define LAPACKsygv_  ssygv_
197 #   define LAPACKsygvx_  ssygvx_
198 
199 #  elif defined(PETSC_HAVE_FORTRAN_CAPS)
200 #   define LAPACKormqr_ SORMQR
201 #   define LAPACKtrtrs_ STRTRS
202 #   define LAPACKpotrf_ SPOTRF
203 #   define LAPACKpotrs_ SPOTRS
204 #   define BLASgemv_  SGEMV
205 #   define LAPACKgetrs_ SGETRS
206 #   define BLAStrmv_  STRMV
207 #   define LAPACKtrsl_  STRSL
208 #   define LAPACKgesvd_ SGESVD
209 #   define LAPACKgeev_  SGEEV
210 #   define LAPACKsygv_  SSYGV
211 #   define LAPACKsygvx_ SSYGVX
212 #   define BLASgemm_  SGEMM
213 #  else
214 #   define LAPACKormqr_ sormqr
215 #   define LAPACKtrtrs_ strtrs
216 #   define LAPACKpotrf_ spotrf
217 #   define LAPACKpotrs_ spotrs
218 #   define BLASgemv_  sgemv
219 #   define LAPACKgetrs_ sgetrs
220 #   define BLAStrmv_  strmv
221 #   define LAPACKtrsl_  strsl
222 #   define BLASgemm_  sgemm
223 #   define LAPACKgesvd_ sgesvd
224 #   define LAPACKgeev_  sgeev
225 #   define LAPACKsygv_  ssygv_
226 #   define LAPACKsygvx_  ssygvx_
227 #  endif
228 
229 # else /* PETSC_USE_SINGLE */
230 
231 #  if defined(PETSC_HAVE_FORTRAN_UNDERSCORE) || defined(PETSC_BLASLAPACK_F2C)
232 #   define LAPACKormqr_ dormqr_
233 #   define LAPACKtrtrs_ dtrtrs_
234 #   define LAPACKpotrf_ dpotrf_
235 #   define LAPACKpotrs_ dpotrs_
236 #   define BLASgemv_  dgemv_
237 #   define LAPACKgetrs_ dgetrs_
238 #   define BLAStrmv_  dtrmv_
239 #   define LAPACKtrsl_  dtrsl_
240 #   define BLASgemm_  dgemm_
241 #   define LAPACKgesvd_ dgesvd_
242 #   define LAPACKgeev_  dgeev_
243 #   define LAPACKsygv_  dsygv_
244 #   define LAPACKsygvx_  dsygvx_
245 
246 #  elif defined(PETSC_HAVE_FORTRAN_CAPS)
247 #   define LAPACKormqr_ DORMQR
248 #   define LAPACKtrtrs_ DTRTRS
249 #   define LAPACKpotrf_ DPOTRF
250 #   define LAPACKpotrs_ DPOTRS
251 #   define BLASgemv_  DGEMV
252 #   define LAPACKgetrs_ DGETRS
253 #   define BLAStrmv_  DTRMV
254 #   define LAPACKtrsl_  DTRSL
255 #   define LAPACKgesvd_ DGESVD
256 #   define LAPACKgeev_  DGEEV
257 #   define LAPACKsygv_  DSYGV
258 #   define LAPACKsygvx_  DSYGVX
259 #   define BLASgemm_  DGEMM
260 #  else
261 #   define LAPACKormqr_ dormqr
262 #   define LAPACKtrtrs_ dtrtrs
263 #   define LAPACKpotrf_ dpotrf
264 #   define LAPACKpotrs_ dpotrs
265 #   define BLASgemv_  dgemv
266 #   define LAPACKgetrs_ dgetrs
267 #   define BLAStrmv_  dtrmv
268 #   define LAPACKtrsl_  dtrsl
269 #   define BLASgemm_  dgemm
270 #   define LAPACKgesvd_ dgesvd
271 #   define LAPACKgeev_  dgeev
272 #   define LAPACKsygv_  dsygv
273 #   define LAPACKsygvx_  dsygvx
274 #  endif
275 
276 # endif /* PETSC_USES_CPTOFCD */
277 
278 #else
279 /*
280    Complex with no character string arguments
281 */
282 # if defined(PETSC_USES_FORTRAN_SINGLE)
283 #  define ZGEQRF  CGEQRF
284 #  define ZDOTC   CDOTC
285 #  define DZNRM2  SCNRM2
286 #  define ZSCAL   CSCAL
287 #  define ZCOPY   CCOPY
288 #  define ZSWAP   CSWAP
289 #  define ZAXPY   CAXPY
290 #  define DZASUM  SCASUM
291 #  define ZGETRF  CGETRF
292 #  define ZTRTRS  CTRTRS
293 #  define ZPOTRF  CPOTRF
294 #  define ZPOTRS  CPOTRS
295 #  define ZGEMV   CGEMV
296 #  define ZGETRS  CGETRS
297 #  define ZGEMM   SGEMM
298 #  define ZTRMV   CTRMV
299 #  define ZTRSL   CTRSL
300 #  define ZGEEV   CGEEV
301 #  define ZSYGV   CSYGV
302 #  define ZSYGVX  CSYGVX
303 # endif
304 
305 # if defined(PETSC_HAVE_FORTRAN_UNDERSCORE) || defined(PETSC_BLASLAPACK_F2C)
306 #  define LAPACKgeqrf_ zgeqrf_
307 #  define LAPACKgetrf_ zgetrf_
308 #  define LAPACKgetf2_ zgetf2_
309 #  define BLASdot_     zdotc_
310 #  define BLASnrm2_    dznrm2_
311 #  define BLASscal_    zscal_
312 #  define BLAScopy_    zcopy_
313 #  define BLASswap_    zswap_
314 #  define BLASaxpy_    zaxpy_
315 #  define BLASasum_    dzasum_
316 # elif defined(PETSC_HAVE_FORTRAN_CAPS)
317 #  define LAPACKgeqrf_ ZGEQRF
318 #  define LAPACKgetrf_ ZGETRF
319 #  define BLASdot_     ZDOTC
320 #  define BLASnrm2_    DZNRM2
321 #  define BLASscal_    ZSCAL
322 #  define BLAScopy_    ZCOPY
323 #  define BLASswap_    ZSWAP
324 #  define BLASaxpy_    ZAXPY
325 #  define BLASasum_    DZASUM
326 # else
327 #  define LAPACKgeqrf_ zgeqrf
328 #  define LAPACKgetrf_ zgetrf
329 #  define LAPACKgetf2_ zgetf2
330 #  define BLASdot_     zdotc
331 #  define BLASnrm2_    dznrm2
332 #  define BLASscal_    zscal
333 #  define BLAScopy_    zcopy
334 #  define BLASswap_    zswap
335 #  define BLASaxpy_    zaxpy
336 #  define BLASasum_    dzasum
337 # endif
338 
339 # if defined(PETSC_USES_CPTOFCD)
340 #  define LAPACKtrtrs_(a,b,c,d,e,f,g,h,i,j)           ZTRTRS(_cptofcd((a),1),_cptofcd((b),1),_cptofcd((c),1),(d),(e),(f),(g),(h),(i),(j))
341 #  define LAPACKpotrf_(a,b,c,d,e)                     ZPOTRF(_cptofcd((a),1),(b),(c),(d),(e))
342 #  define LAPACKpotrs_(a,b,c,d,e,f,g,h)               ZPOTRS(_cptofcd((a),1),(b),(c),(d),(e),(f),(g),(h))
343 #  define BLASgemv_(a,b,c,d,e,f,g,h,i,j,k)            ZGEMV(_cptofcd((a),1),(b),(c),(d),(e),(f),(g),(h),(i),(j),(k))
344 #  define LAPACKgetrs_(a,b,c,d,e,f,g,h,i)             ZGETRS(_cptofcd((a),1),(b),(c),(d),(e),(f),(g),(h),(i))
345 #  define BLASgemm_(a,b,c,d,e,f,g,h,i,j,k,l,m)        ZGEMM(_cptofcd((a),1),_cptofcd((b),1),(c),(d),(e),(f),(g),(h),(i),(j),(k),(l),(m))
346 #  define LAPACKgesvd_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,p) ZGESVD(_cptofcd((a),1),_cptofcd((b),1),(c),(d),(e),(f),(g),(h),(i),(j),(k),(l),(m),(n),(p))
347 #  define LAPACKgeev_(a,b,c,d,e,f,g,h,i,j,k,l,m,n)    ZGEEV(_cptofcd((a),1),_cptofcd((b),1),(c),(d),(e),(f),(g),(h),(i),(j),(k),(l),(m),(n))
348 #  define LAPACKsygv_(a,b,c,d,e,f,g,h,i,j,k,l)        ZSYGV((a),_cptofcd((b),1),_cptofcd((c),1),(d),(e),(f),(g),(h),(i),(j),(k),(l))
349 #  define LAPACKsygvx_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w)    ZSYGVX((a),_cptofcd((b),1),_cptofcd((c),1),_cptofcd((d),1),(e),(f),(g),(h),(i),(j),(k),(l),(m),(n),(o),(p),(q),(r),(s),(t),(u),(v),(w))
350 
351 #  define BLAStrmv_    ZTRMV
352 #  define LAPACKtrsl_  ZTRSL
353 # elif defined(PETSC_HAVE_FORTRAN_UNDERSCORE) || defined(PETSC_BLASLAPACK_F2C)
354 #  define LAPACKtrtrs_ ztrtrs_
355 #  define LAPACKpotrf_ zpotrf_
356 #  define LAPACKpotrs_ zpotrs_
357 #  define BLASgemv_    zgemv_
358 #  define LAPACKgetrs_ zgetrs_
359 #  define BLAStrmv_    ztrmv_
360 #  define LAPACKtrsl_  ztrsl_
361 #  define BLASgemm_    zgemm_
362 #  define LAPACKgesvd_ zgesvd_
363 #  define LAPACKgeev_  zgeev_
364 #  define LAPACKsygv_  zsygv_
365 #  define LAPACKsygvx_  zsygvx_
366 
367 # elif defined(PETSC_HAVE_FORTRAN_CAPS)
368 #  define LAPACKtrtrs_ ZTRTRS
369 #  define LAPACKpotrf_ ZPOTRF
370 #  define LAPACKpotrs_ ZPOTRS
371 #  define BLASgemv_    ZGEMV
372 #  define LAPACKgetrf_ ZGETRF
373 #  define LAPACKgetf2_ ZGETF2
374 #  define LAPACKgetrs_ ZGETRS
375 #  define BLAStrmv_    ZTRMV
376 #  define LAPACKtrsl_  ZTRSL
377 #  define BLASgemm_    ZGEMM
378 #  define LAPACKgesvd_ ZGESVD
379 #  define LAPACKgeev_  ZGEEV
380 #  define LAPACKsygv_  ZSYGV
381 #  define LAPACKsygvx_  ZSYGVX
382 
383 # else
384 #  define LAPACKtrtrs_ ztrtrs
385 #  define LAPACKpotrf_ zpotrf
386 #  define LAPACKpotrs_ zpotrs
387 #  define BLASgemv_    zgemv
388 #  define LAPACKgetrs_ zgetrs
389 #  define BLAStrmv_    ztrmv
390 #  define LAPACKtrsl_  ztrsl
391 #  define BLASgemm_    zgemm
392 #  define LAPACKgesvd_ zgesvd
393 #  define LAPACKgeev_  zgeev
394 #  define LAPACKsygv_  zsygv
395 #  define LAPACKsygvx_  zsygvx
396 # endif
397 
398 #endif
399 
400 EXTERN_C_BEGIN
401 
402 /*
403    BLASdot cannot be used with COMPLEX because it cannot
404    handle returing a double complex to C++.
405 */
406 EXTERN PetscReal BLASdot_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*);
407 EXTERN PetscReal BLASnrm2_(PetscBLASInt*,PetscScalar*,PetscBLASInt*);
408 EXTERN PetscReal BLASasum_(PetscBLASInt*,PetscScalar*,PetscBLASInt*);
409 EXTERN void      BLASscal_(PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*);
410 EXTERN void      BLAScopy_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*);
411 EXTERN void      BLASswap_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*);
412 EXTERN void      BLASaxpy_(PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*);
413 EXTERN void      LAPACKgetrf_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
414 EXTERN void      LAPACKgetf2_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
415 EXTERN void      LAPACKgeqrf_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
416 
417 #if defined(PETSC_USES_CPTOFCD)
418 
419 # if defined(PETSC_USE_COMPLEX)
420 EXTERN void   ZORMQR(_fcd,_fcd,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
421 EXTERN void   ZTRTRS(_fcd,_fcd,_fcd,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
422 EXTERN void   ZPOTRF(_fcd,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
423 EXTERN void   ZGEMV(_fcd,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*);
424 EXTERN void   ZPOTRS(_fcd,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
425 EXTERN void   ZGETRS(_fcd,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
426 EXTERN void   ZGEMM(_fcd,_fcd,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*);
427 EXTERN void   ZGESVD(_fcd,_fcd,PetscBLASInt *,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
428 EXTERN void   ZGEEV(_fcd,_fcd,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
429 EXTERN void   ZSYGV(PetscBLASInt*,_fcd,_fcd,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
430 EXTERN void   ZSYGVX(PetscBLASInt*,_fcd,_fcd,_fcd,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
431 
432 # else
433 EXTERN void   DORMQR(_fcd,_fcd,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
434 EXTERN void   DTRTRS(_fcd,_fcd,_fcd,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
435 EXTERN void   DPOTRF(_fcd,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
436 EXTERN void   DGEMV(_fcd,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*);
437 EXTERN void   DPOTRS(_fcd,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
438 EXTERN void   DGETRS(_fcd,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
439 EXTERN void   DGEMM(_fcd,_fcd,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*);
440 EXTERN void   DGESVD(_fcd,_fcd,PetscBLASInt *,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
441 EXTERN void   DGEEV(_fcd,_fcd,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
442 EXTERN void   DSYGV(PetscBLASInt*,_fcd,_fcd,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
443 EXTERN void   DSYGVX(PetscBLASInt*,_fcd,_fcd,_fcd,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
444 # endif
445 
446 #else
447 EXTERN void   LAPACKormqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
448 EXTERN void   LAPACKtrtrs_(const char*,const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
449 EXTERN void   LAPACKpotrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
450 EXTERN void   BLASgemv_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*);
451 EXTERN void   LAPACKpotrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
452 EXTERN void   LAPACKgetrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
453 EXTERN void   BLASgemm_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*);
454 
455 /* ESSL uses a different calling sequence for dgeev(), zgeev() than LAPACK; */
456 # if defined(PETSC_HAVE_ESSL) && defined(PETSC_USE_COMPLEX)
457 EXTERN void   LAPACKgeev_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
458 EXTERN void   LAPACKgesvd_(const char*,const char*,PetscBLASInt *,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
459 # elif defined(PETSC_HAVE_ESSL)
460 EXTERN void   LAPACKgeev_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
461 EXTERN void   LAPACKgesvd_(const char*,const char*,PetscBLASInt *,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
462 # elif !defined(PETSC_USE_COMPLEX)
463 EXTERN void   LAPACKgeev_(const char*,const char*,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
464 EXTERN void   LAPACKgesvd_(const char*,const char*,PetscBLASInt *,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
465 EXTERN void   LAPACKsygv_(PetscBLASInt*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
466 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*);
467 # else
468 EXTERN void   LAPACKgeev_(const char*,const char*,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
469 EXTERN void   LAPACKsygv_(PetscBLASInt*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
470 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*);
471 EXTERN void   LAPACKgesvd_(const char*,const char*,PetscBLASInt *,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
472 # endif
473 #endif
474 
475 EXTERN_C_END
476 PETSC_EXTERN_CXX_END
477 #endif
478