Octopus
lapack.F90
Go to the documentation of this file.
1!! Copyright (C) 2009 X. Andrade
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
21! -----------------------------------------------------------------------
23! -----------------------------------------------------------------------
24
25module lapack_oct_m
26 implicit none
27
28 public ! only interfaces in this module
29
44 interface lapack_potrf
45 subroutine dpotrf(uplo, n, a, lda, info)
46 use, intrinsic :: iso_fortran_env
47 implicit none
48 character(1), intent(in) :: uplo
49 integer, intent(in) :: n
50 real(real64), intent(inout) :: a
51 integer, intent(in) :: lda
52 integer, intent(out) :: info
53 end subroutine dpotrf
54
55 subroutine zpotrf(uplo, n, a, lda, info)
56 use, intrinsic :: iso_fortran_env
57 implicit none
58 character(1), intent(in) :: uplo
59 integer, intent(in) :: n
60 complex(real64), intent(inout) :: a
61 integer, intent(in) :: lda
62 integer, intent(out) :: info
63 end subroutine zpotrf
64 end interface lapack_potrf
65
71 interface lapack_sygv
72 subroutine dsygv(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, info)
73 use, intrinsic :: iso_fortran_env
74 implicit none
75 character(1), intent(in) :: jobz, uplo
76 integer, intent(in) :: itype, n, lda, ldb, lwork
77 real(real64), intent(inout) :: a, b
78 real(real64), intent(out) :: w, work
79 integer, intent(out) :: info
80 end subroutine dsygv
81 end interface lapack_sygv
82
84 interface lapack_sygvd
85 subroutine dsygvd(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, iwork, liwork, info)
86 use, intrinsic :: iso_fortran_env
87 implicit none
88 character(1), intent(in) :: jobz, uplo
89 integer, intent(in) :: itype, n, lda, ldb, lwork, liwork
90 real(real64), intent(inout) :: a, b
91 real(real64), intent(out) :: w, work
92 integer, intent(out) :: iwork, info
93 end subroutine dsygvd
94 end interface lapack_sygvd
95
101 interface lapack_hegv
102 subroutine zhegv(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, info)
103 use, intrinsic :: iso_fortran_env
104 implicit none
105 character(1), intent(in) :: jobz, uplo
106 integer, intent(in) :: n, itype, lda, ldb, lwork
107 complex(real64), intent(inout) :: a, b
108 real(real64), intent(out) :: w, rwork
109 complex(real64), intent(out) :: work
110 integer, intent(out) :: info
111 end subroutine zhegv
112 end interface lapack_hegv
113
115 interface lapack_hegvd
116 subroutine zhegvd(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, lrwork, iwork, liwork, info)
117 use, intrinsic :: iso_fortran_env
118 implicit none
119 character(1), intent(in) :: jobz, uplo
120 integer, intent(in) :: n, itype, lda, ldb, lwork, lrwork, liwork
121 complex(real64), intent(inout) :: a, b
122 real(real64), intent(out) :: w, rwork
123 complex(real64), intent(out) :: work
124 integer, intent(out) :: iwork, info
125 end subroutine zhegvd
126 end interface lapack_hegvd
127
144 interface
145 subroutine dgeev(jobvl, jobvr, n, a, lda, wr, wi, vl, ldvl, vr, ldvr, work, lwork, info)
146 use, intrinsic :: iso_fortran_env
147 implicit none
148 character(1), intent(in) :: jobvl, jobvr
149 integer, intent(in) :: n, lda, ldvl, ldvr, lwork
150 real(real64), intent(inout) :: a
151 real(real64), intent(out) :: wr, wi, vl, vr
152 real(real64), intent(out) :: work
153 integer, intent(out) :: info
154 end subroutine dgeev
155
156 subroutine zgeev(jobvl, jobvr, n, a, lda, w, vl, ldvl, vr, ldvr, work, lwork, rwork, info)
157 use, intrinsic :: iso_fortran_env
158 implicit none
159 character(1), intent(in) :: jobvl, jobvr
160 integer, intent(in) :: n, lda, ldvl, ldvr, lwork
161 complex(real64), intent(inout) :: a
162 complex(real64), intent(out) :: w, vl, vr
163 real(real64), intent(out) :: rwork
164 complex(real64), intent(out) :: work
165 integer, intent(out) :: info
166 end subroutine zgeev
167 end interface
168
169 interface lapack_gesvx
170 subroutine dgesvx(fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, &
171 c, b, ldb, x, ldx, rcond, ferr, berr, work, iwork, info)
172 use, intrinsic :: iso_fortran_env
173 implicit none
174 character(1), intent(in) :: fact, trans
175 integer, intent(in) :: n, nrhs, lda, ldaf, ldb, ldx
176 real(real64), intent(inout) :: a, af, r, c, b
177 integer, intent(inout) :: ipiv
178 real(real64), intent(out) :: x, ferr, berr, work
179 real(real64), intent(out) :: rcond
180 character(1), intent(inout) :: equed
181 integer, intent(out) :: iwork
182 integer, intent(out) :: info
183 end subroutine dgesvx
184
185 subroutine zgesvx (fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, &
186 c, b, ldb, x, ldx, rcond, ferr, berr, work, rwork, info)
187 use, intrinsic :: iso_fortran_env
188 implicit none
189 character(1), intent(in) :: fact, trans
190 integer, intent(in) :: n, nrhs, lda, ldaf, ldb, ldx
191 complex(real64), intent(inout) :: a, af, b
192 real(real64), intent(inout) :: r, c
193 integer, intent(inout) :: ipiv
194 real(real64), intent(out) :: ferr, berr
195 real(real64), intent(out) :: rcond
196 complex(real64), intent(out) :: x, work
197 character(1), intent(inout) :: equed
198 real(real64), intent(out) :: rwork
199 integer, intent(out) :: info
200 end subroutine zgesvx
201 end interface lapack_gesvx
202
205 interface lapack_syev
206 subroutine dsyev(jobz, uplo, n, a, lda, w, work, lwork, info)
207 use, intrinsic :: iso_fortran_env
208 implicit none
209 character(1), intent(in) :: jobz, uplo
210 integer, intent(in) :: n, lda, lwork
211 real(real64), intent(inout) :: a
212 real(real64), intent(out) :: w, work
213 integer, intent(out) :: info
214 end subroutine dsyev
215 end interface lapack_syev
216
219 interface lapack_heev
220 subroutine zheev(jobz, uplo, n, a, lda, w, work, lwork, rwork, info)
221 use, intrinsic :: iso_fortran_env
222 implicit none
223 character(1), intent(in) :: jobz, uplo
224 integer, intent(in) :: n, lda, lwork
225 complex(real64), intent(inout) :: a
226 real(real64), intent(out) :: w, rwork
227 complex(real64), intent(out) :: work
228 integer, intent(out) :: info
229 end subroutine zheev
230 end interface lapack_heev
231
232 interface
233 subroutine dsyevx(jobz, range, uplo, n, a, lda, &
234 vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, iwork, ifail, info)
235 use, intrinsic :: iso_fortran_env
236 implicit none
237 integer, intent(in) :: n, lda, il, iu, ldz, lwork
238 character(1), intent(in) :: jobz, range, uplo
239 integer, intent(out) :: m, iwork, ifail, info
240 real(real64), intent(in) :: vl, vu, abstol
241 real(real64), intent(inout) :: a
242 real(real64), intent(out) :: w, z, work
243 end subroutine dsyevx
244
245 subroutine zheevx(jobz, range, uplo, n, a, lda, &
246 vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, iwork, ifail, info)
247 use, intrinsic :: iso_fortran_env
248 implicit none
249 integer, intent(in) :: n, lda, il, iu, ldz, lwork
250 character(1), intent(in) :: jobz, range, uplo
251 integer, intent(out) :: m, iwork, ifail, info
252 real(real64), intent(in) :: vl, vu, abstol
253 real(real64), intent(out) :: w
254 complex(real64), intent(inout) :: a
255 complex(real64), intent(out) :: z, work
256 end subroutine zheevx
257 end interface
258
263 interface lapack_geqrf
264 subroutine dgeqrf(m, n, a, lda, tau, work, lwork, info)
265 use, intrinsic :: iso_fortran_env
266 implicit none
267 integer, intent(in) :: lda, lwork, m, n
268 real(real64), intent(inout) :: a
269 real(real64), intent(out) :: tau, work
270 integer, intent(out) :: info
271 end subroutine dgeqrf
272
273 subroutine zgeqrf(m, n, a, lda, tau, work, lwork, info)
274 use, intrinsic :: iso_fortran_env
275 implicit none
276 integer, intent(in) :: lda, lwork, m, n
277 complex(real64), intent(inout) :: a
278 complex(real64), intent(out) :: tau, work
279 integer, intent(out) :: info
280 end subroutine zgeqrf
281 end interface lapack_geqrf
282
292 interface lapack_orgqr
293 subroutine dorgqr(m, n, k, a, lda, tau, work, lwork, info)
294 use, intrinsic :: iso_fortran_env
295 implicit none
296 integer, intent(in) :: k, lda, lwork, m, n
297 real(real64), intent(in) :: tau
298 real(real64), intent(inout) :: a
299 real(real64), intent(out) :: work
300 integer, intent(out) :: info
301 end subroutine dorgqr
302
303 subroutine zungqr(m, n, k, a, lda, tau, work, lwork, info)
304 use, intrinsic :: iso_fortran_env
305 implicit none
306 integer, intent(in) :: k, lda, lwork, m, n
307 complex(real64), intent(in) :: tau
308 complex(real64), intent(inout) :: a
309 complex(real64), intent(out) :: work
310 integer, intent(out) :: info
311 end subroutine zungqr
312 end interface lapack_orgqr
313
320 interface lapack_sygvx
321 subroutine dsygvx(itype, jobz, range, uplo, n, a, lda, b, ldb, vl, vu, il, iu, abstol, &
322 m, w, z, ldz, work, lwork, iwork, ifail, info)
323 use, intrinsic :: iso_fortran_env
324 implicit none
325
326 integer, intent(in) :: itype
327 character(len=1), intent(in) :: jobz
328 character(len=1), intent(in) :: range
329 character(len=1), intent(in) :: uplo
330 integer, intent(in) :: n
331 real(real64), intent(inout) :: a
332 integer, intent(in) :: lda
333 real(real64), intent(inout) :: b
334 integer, intent(in) :: ldb
335 real(real64), intent(in) :: vl
336 real(real64), intent(in) :: vu
337 integer, intent(in) :: il
338 integer, intent(in) :: iu
339 real(real64), intent(in) :: abstol
340 integer, intent(out) :: m
341 real(real64), intent(out) :: w
342 real(real64), intent(out) :: z
343 integer, intent(in) :: ldz
344 real(real64), intent(out) :: work
345 integer, intent(in) :: lwork
346 integer, intent(out) :: iwork
347 integer, intent(out) :: ifail
348 integer, intent(out) :: info
349 end subroutine dsygvx
350 end interface lapack_sygvx
351
358 interface lapack_hegvx
359 subroutine zhegvx(itype, jobz, range, uplo, n, a, lda, b, ldb, vl, vu, il, iu, abstol, &
360 m, w, z, ldz, work, lwork, rwork, iwork, ifail, info)
361 use, intrinsic :: iso_fortran_env
362 implicit none
363
364 integer, intent(in) :: itype
365 character(len=1), intent(in) :: jobz
366 character(len=1), intent(in) :: range
367 character(len=1), intent(in) :: uplo
368 integer, intent(in) :: n
369 complex(real64), intent(inout) :: a
370 integer, intent(in) :: lda
371 complex(real64), intent(inout) :: b
372 integer, intent(in) :: ldb
373 real(real64), intent(in) :: vl
374 real(real64), intent(in) :: vu
375 integer, intent(in) :: il
376 integer, intent(in) :: iu
377 real(real64), intent(in) :: abstol
378 integer, intent(out) :: m
379 real(real64), intent(out) :: w
380 complex(real64), intent(out) :: z
381 integer, intent(in) :: ldz
382 complex(real64), intent(out) :: work
383 integer, intent(in) :: lwork
384 real(real64), intent(out) :: rwork
385 integer, intent(out) :: iwork
386 integer, intent(out) :: ifail
387 integer, intent(out) :: info
388 end subroutine zhegvx
389 end interface lapack_hegvx
390
391 interface lapack_gelss
392 subroutine dgelss(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, info)
393 use, intrinsic :: iso_fortran_env
394 implicit none
395 integer, intent(in) :: m
396 integer, intent(in) :: n
397 integer, intent(in) :: nrhs
398 real(real64),intent(inout) :: a
399 integer, intent(in) :: lda
400 real(real64),intent(inout) :: b
401 integer, intent(in) :: ldb
402 real(real64),intent(out) :: s
403 real(real64),intent(in) :: rcond
404 integer, intent(out) :: rank
405 real(real64),intent(out) :: work
406 integer, intent(in) :: lwork
407 integer, intent(out) :: info
408 end subroutine dgelss
409
410 subroutine zgelss(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, rwork, info)
411 use, intrinsic :: iso_fortran_env
412 implicit none
413 integer, intent(in) :: m
414 integer, intent(in) :: n
415 integer, intent(in) :: nrhs
416 complex(real64), intent(inout) :: a
417 integer, intent(in) :: lda
418 complex(real64), intent(inout) :: b
419 integer, intent(in) :: ldb
420 real(real64),intent(out) :: s
421 real(real64),intent(in) :: rcond
422 integer, intent(out) :: rank
423 complex(real64), intent(out) :: work
424 integer, intent(in) :: lwork
425 real(real64),intent(out) :: rwork
426 integer, intent(out) :: info
427 end subroutine zgelss
428 end interface lapack_gelss
429
430 interface lapack_getrf
431 subroutine dgetrf (m, n, a, lda, ipiv, info)
432 use, intrinsic :: iso_fortran_env
433 implicit none
434 integer, intent(in) :: m, n, lda
435 real(real64), intent(inout) :: a
436 integer, intent(out) :: ipiv
437 integer, intent(out) :: info
438 end subroutine dgetrf
439
440 subroutine zgetrf (m, n, a, lda, ipiv, info)
441 use, intrinsic :: iso_fortran_env
442 implicit none
443 integer, intent(in) :: m, n, lda
444 complex(real64), intent(inout) :: a
445 integer, intent(out) :: ipiv
446 integer, intent(out) :: info
447 end subroutine zgetrf
448 end interface lapack_getrf
449
450 interface lapack_getri
451 subroutine dgetri(n, a, lda, ipiv, work, lwork, info)
452 use, intrinsic :: iso_fortran_env
453 implicit none
454 integer, intent(in) :: n, lda, lwork
455 real(real64), intent(inout) :: a
456 integer, intent(in) :: ipiv
457 real(real64), intent(out) :: work
458 integer, intent(out) :: info
459 end subroutine dgetri
460
461 subroutine zgetri(n, a, lda, ipiv, work, lwork, info)
462 use, intrinsic :: iso_fortran_env
463 implicit none
464 integer, intent(in) :: n, lda, lwork
465 complex(real64), intent(inout) :: a
466 integer, intent(in) :: ipiv
467 complex(real64), intent(out) :: work
468 integer, intent(out) :: info
469 end subroutine zgetri
470 end interface lapack_getri
471
472 interface lapack_sytrf
473 subroutine dsytrf(uplo, n, a, lda, ipiv, work, lwork, info)
474 use, intrinsic :: iso_fortran_env
475 implicit none
476 character(1), intent(in) :: uplo
477 integer, intent(in) :: n, lda, lwork
478 real(real64), intent(inout) :: a
479 integer, intent(out) :: ipiv
480 real(real64), intent(out) :: work
481 integer, intent(out) :: info
482 end subroutine dsytrf
483
484 subroutine zsytrf(uplo, n, a, lda, ipiv, work, lwork, info)
485 use, intrinsic :: iso_fortran_env
486 implicit none
487 character(1), intent(in) :: uplo
488 integer, intent(in) :: n, lda, lwork
489 complex(real64), intent(inout) :: a
490 integer, intent(out) :: ipiv
491 complex(real64), intent(out) :: work
492 integer, intent(out) :: info
493 end subroutine zsytrf
494 end interface lapack_sytrf
495
496 interface lapack_sytri
497 subroutine dsytri (uplo, n, a, lda, ipiv, work, info)
498 use, intrinsic :: iso_fortran_env
499 implicit none
500 character(1), intent(in) :: uplo
501 integer, intent(in) :: n, lda
502 real(real64), intent(inout) :: a
503 integer, intent(in) :: ipiv
504 real(real64), intent(out) :: work
505 integer, intent(out) :: info
506 end subroutine dsytri
507
508 subroutine zsytri (uplo, n, a, lda, ipiv, work, info)
509 use, intrinsic :: iso_fortran_env
510 implicit none
511 character(1), intent(in) :: uplo
512 integer, intent(in) :: n, lda
513 complex(real64), intent(inout) :: a
514 integer, intent(in) :: ipiv
515 complex(real64), intent(out) :: work
516 integer, intent(out) :: info
517 end subroutine zsytri
518 end interface lapack_sytri
519
520 interface lapack_stev
521 subroutine dstev (jobz, n, d, e, z, ldz, work, info)
522 use, intrinsic :: iso_fortran_env
523 implicit none
524 character(1), intent(in) :: jobz
525 integer, intent(in) :: n
526 real(real64), intent(inout) :: d, e
527 real(real64), intent(out) :: z
528 integer, intent(in) :: ldz
529 real(real64), intent(out) :: work
530 integer, intent(out) :: info
531 end subroutine dstev
532 end interface lapack_stev
533
534 interface lapack_steqr
535 subroutine zsteqr (compz, n, d, e, z, ldz, work, info)
536 use, intrinsic :: iso_fortran_env
537 implicit none
538 character(1), intent(in) :: compz
539 integer, intent(in) :: n
540 real(real64), intent(inout) :: d, e
541 complex(real64), intent(inout) :: z
542 integer, intent(in) :: ldz
543 real(real64), intent(out) :: work
544 integer, intent(out) :: info
545 end subroutine zsteqr
546 end interface lapack_steqr
547
548
549end module lapack_oct_m
550
551!! Local Variables:
552!! mode: f90
553!! coding: utf-8
554!! End:
Computes for an complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or righ...
Definition: lapack.F90:240
Computes a QR factorization of a real matrix A:
Definition: lapack.F90:358
Computes all eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A.
Definition: lapack.F90:314
Computes all the eigenvalues, and optionally, the eigenvectors of a complex generalized Hermitian-def...
Definition: lapack.F90:196
Same as lapack_hegv but using the divide and conquer algorithm.
Definition: lapack.F90:210
Computes selected eigenvalues, and optionally, eigenvectors of a complex generalized Hermitian-defini...
Definition: lapack.F90:453
Generates an real matrix Q with orthonormal columns, which is defined as the first N columns of a pr...
Definition: lapack.F90:387
computes the Cholesky factorization of a real symmetric positive definite matrix A.
Definition: lapack.F90:139
Computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix A.
Definition: lapack.F90:300
Computes all the eigenvalues, and optionally, the eigenvectors of a real generalized symmetric-defini...
Definition: lapack.F90:166
Same as lapack_sygv but using the divide and conquer algorithm.
Definition: lapack.F90:179
Computes selected eigenvalues, and optionally, eigenvectors of a real generalized symmetric-definite ...
Definition: lapack.F90:415
This module contains interfaces for LAPACK routines.
Definition: lapack.F90:120