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, rwork, 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) :: rwork
153 real(real64), intent(out) :: work
154 integer, intent(out) :: info
155 end subroutine dgeev
156
157 subroutine zgeev(jobvl, jobvr, n, a, lda, w, vl, ldvl, vr, ldvr, work, lwork, rwork, info)
158 use, intrinsic :: iso_fortran_env
159 implicit none
160 character(1), intent(in) :: jobvl, jobvr
161 integer, intent(in) :: n, lda, ldvl, ldvr, lwork
162 complex(real64), intent(inout) :: a
163 complex(real64), intent(out) :: w, vl, vr
164 real(real64), intent(out) :: rwork
165 complex(real64), intent(out) :: work
166 integer, intent(out) :: info
167 end subroutine zgeev
168 end interface
169
170 interface lapack_gesvx
171 subroutine dgesvx(fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, &
172 c, b, ldb, x, ldx, rcond, ferr, berr, work, iwork, info)
173 use, intrinsic :: iso_fortran_env
174 implicit none
175 character(1), intent(in) :: fact, trans
176 integer, intent(in) :: n, nrhs, lda, ldaf, ldb, ldx
177 real(real64), intent(inout) :: a, af, r, c, b
178 integer, intent(inout) :: ipiv
179 real(real64), intent(out) :: x, ferr, berr, work
180 real(real64), intent(out) :: rcond
181 character(1), intent(inout) :: equed
182 integer, intent(out) :: iwork
183 integer, intent(out) :: info
184 end subroutine dgesvx
185
186 subroutine zgesvx (fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, &
187 c, b, ldb, x, ldx, rcond, ferr, berr, work, rwork, info)
188 use, intrinsic :: iso_fortran_env
189 implicit none
190 character(1), intent(in) :: fact, trans
191 integer, intent(in) :: n, nrhs, lda, ldaf, ldb, ldx
192 complex(real64), intent(inout) :: a, af, b
193 real(real64), intent(inout) :: r, c
194 integer, intent(inout) :: ipiv
195 real(real64), intent(out) :: ferr, berr
196 real(real64), intent(out) :: rcond
197 complex(real64), intent(out) :: x, work
198 character(1), intent(inout) :: equed
199 real(real64), intent(out) :: rwork
200 integer, intent(out) :: info
201 end subroutine zgesvx
202 end interface lapack_gesvx
203
206 interface lapack_syev
207 subroutine dsyev(jobz, uplo, n, a, lda, w, work, lwork, info)
208 use, intrinsic :: iso_fortran_env
209 implicit none
210 character(1), intent(in) :: jobz, uplo
211 integer, intent(in) :: n, lda, lwork
212 real(real64), intent(inout) :: a
213 real(real64), intent(out) :: w, work
214 integer, intent(out) :: info
215 end subroutine dsyev
216 end interface lapack_syev
217
220 interface lapack_heev
221 subroutine zheev(jobz, uplo, n, a, lda, w, work, lwork, rwork, info)
222 use, intrinsic :: iso_fortran_env
223 implicit none
224 character(1), intent(in) :: jobz, uplo
225 integer, intent(in) :: n, lda, lwork
226 complex(real64), intent(inout) :: a
227 real(real64), intent(out) :: w, rwork
228 complex(real64), intent(out) :: work
229 integer, intent(out) :: info
230 end subroutine zheev
231 end interface lapack_heev
232
233 interface
234 subroutine dsyevx(jobz, range, uplo, n, a, lda, &
235 vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, iwork, ifail, info)
236 use, intrinsic :: iso_fortran_env
237 implicit none
238 integer, intent(in) :: n, lda, il, iu, ldz, lwork
239 character(1), intent(in) :: jobz, range, uplo
240 integer, intent(out) :: m, iwork, ifail, info
241 real(real64), intent(in) :: vl, vu, abstol
242 real(real64), intent(inout) :: a
243 real(real64), intent(out) :: w, z, work
244 end subroutine dsyevx
245
246 subroutine zheevx(jobz, range, uplo, n, a, lda, &
247 vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, iwork, ifail, info)
248 use, intrinsic :: iso_fortran_env
249 implicit none
250 integer, intent(in) :: n, lda, il, iu, ldz, lwork
251 character(1), intent(in) :: jobz, range, uplo
252 integer, intent(out) :: m, iwork, ifail, info
253 real(real64), intent(in) :: vl, vu, abstol
254 real(real64), intent(out) :: w
255 complex(real64), intent(inout) :: a
256 complex(real64), intent(out) :: z, work
257 end subroutine zheevx
258 end interface
259
264 interface lapack_geqrf
265 subroutine dgeqrf(m, n, a, lda, tau, work, lwork, info)
266 use, intrinsic :: iso_fortran_env
267 implicit none
268 integer, intent(in) :: lda, lwork, m, n
269 real(real64), intent(inout) :: a
270 real(real64), intent(out) :: tau, work
271 integer, intent(out) :: info
272 end subroutine dgeqrf
273
274 subroutine zgeqrf(m, n, a, lda, tau, work, lwork, info)
275 use, intrinsic :: iso_fortran_env
276 implicit none
277 integer, intent(in) :: lda, lwork, m, n
278 complex(real64), intent(inout) :: a
279 complex(real64), intent(out) :: tau, work
280 integer, intent(out) :: info
281 end subroutine zgeqrf
282 end interface lapack_geqrf
283
293 interface lapack_orgqr
294 subroutine dorgqr(m, n, k, a, lda, tau, work, lwork, info)
295 use, intrinsic :: iso_fortran_env
296 implicit none
297 integer, intent(in) :: k, lda, lwork, m, n
298 real(real64), intent(in) :: tau
299 real(real64), intent(inout) :: a
300 real(real64), intent(out) :: work
301 integer, intent(out) :: info
302 end subroutine dorgqr
303
304 subroutine zungqr(m, n, k, a, lda, tau, work, lwork, info)
305 use, intrinsic :: iso_fortran_env
306 implicit none
307 integer, intent(in) :: k, lda, lwork, m, n
308 complex(real64), intent(in) :: tau
309 complex(real64), intent(inout) :: a
310 complex(real64), intent(out) :: work
311 integer, intent(out) :: info
312 end subroutine zungqr
313 end interface lapack_orgqr
321 interface lapack_sygvx
322 subroutine dsygvx(itype, jobz, range, uplo, n, a, lda, b, ldb, vl, vu, il, iu, abstol, &
323 m, w, z, ldz, work, lwork, iwork, ifail, info)
324 use, intrinsic :: iso_fortran_env
325 implicit none
326
327 integer, intent(in) :: itype
328 character(len=1), intent(in) :: jobz
329 character(len=1), intent(in) :: range
330 character(len=1), intent(in) :: uplo
331 integer, intent(in) :: n
332 real(real64), intent(inout) :: a
333 integer, intent(in) :: lda
334 real(real64), intent(inout) :: b
335 integer, intent(in) :: ldb
336 real(real64), intent(in) :: vl
337 real(real64), intent(in) :: vu
338 integer, intent(in) :: il
339 integer, intent(in) :: iu
340 real(real64), intent(in) :: abstol
341 integer, intent(out) :: m
342 real(real64), intent(out) :: w
343 real(real64), intent(out) :: z
344 integer, intent(in) :: ldz
345 real(real64), intent(out) :: work
346 integer, intent(in) :: lwork
347 integer, intent(out) :: iwork
348 integer, intent(out) :: ifail
349 integer, intent(out) :: info
350 end subroutine dsygvx
351 end interface lapack_sygvx
352
359 interface lapack_hegvx
360 subroutine zhegvx(itype, jobz, range, uplo, n, a, lda, b, ldb, vl, vu, il, iu, abstol, &
361 m, w, z, ldz, work, lwork, rwork, iwork, ifail, info)
362 use, intrinsic :: iso_fortran_env
363 implicit none
364
365 integer, intent(in) :: itype
366 character(len=1), intent(in) :: jobz
367 character(len=1), intent(in) :: range
368 character(len=1), intent(in) :: uplo
369 integer, intent(in) :: n
370 complex(real64), intent(inout) :: a
371 integer, intent(in) :: lda
372 complex(real64), intent(inout) :: b
373 integer, intent(in) :: ldb
374 real(real64), intent(in) :: vl
375 real(real64), intent(in) :: vu
376 integer, intent(in) :: il
377 integer, intent(in) :: iu
378 real(real64), intent(in) :: abstol
379 integer, intent(out) :: m
380 real(real64), intent(out) :: w
381 complex(real64), intent(out) :: z
382 integer, intent(in) :: ldz
383 complex(real64), intent(out) :: work
384 integer, intent(in) :: lwork
385 real(real64), intent(out) :: rwork
386 integer, intent(out) :: iwork
387 integer, intent(out) :: ifail
388 integer, intent(out) :: info
389 end subroutine zhegvx
390 end interface lapack_hegvx
391
392 interface lapack_gelss
393 subroutine dgelss(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, info)
394 use, intrinsic :: iso_fortran_env
395 implicit none
396 integer, intent(in) :: m
397 integer, intent(in) :: n
398 integer, intent(in) :: nrhs
399 real(real64),intent(inout) :: a
400 integer, intent(in) :: lda
401 real(real64),intent(inout) :: b
402 integer, intent(in) :: ldb
403 real(real64),intent(out) :: s
404 real(real64),intent(in) :: rcond
405 integer, intent(out) :: rank
406 real(real64),intent(out) :: work
407 integer, intent(in) :: lwork
408 integer, intent(out) :: info
409 end subroutine dgelss
410
411 subroutine zgelss(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, rwork, info)
412 use, intrinsic :: iso_fortran_env
413 implicit none
414 integer, intent(in) :: m
415 integer, intent(in) :: n
416 integer, intent(in) :: nrhs
417 complex(real64), intent(inout) :: a
418 integer, intent(in) :: lda
419 complex(real64), intent(inout) :: b
420 integer, intent(in) :: ldb
421 real(real64),intent(out) :: s
422 real(real64),intent(in) :: rcond
423 integer, intent(out) :: rank
424 complex(real64), intent(out) :: work
425 integer, intent(in) :: lwork
426 real(real64),intent(out) :: rwork
427 integer, intent(out) :: info
428 end subroutine zgelss
429 end interface lapack_gelss
430
431 interface lapack_getrf
432 subroutine dgetrf (m, n, a, lda, ipiv, info)
433 use, intrinsic :: iso_fortran_env
434 implicit none
435 integer, intent(in) :: m, n, lda
436 real(real64), intent(inout) :: a
437 integer, intent(out) :: ipiv
438 integer, intent(out) :: info
439 end subroutine dgetrf
440
441 subroutine zgetrf (m, n, a, lda, ipiv, info)
442 use, intrinsic :: iso_fortran_env
443 implicit none
444 integer, intent(in) :: m, n, lda
445 complex(real64), intent(inout) :: a
446 integer, intent(out) :: ipiv
447 integer, intent(out) :: info
448 end subroutine zgetrf
449 end interface lapack_getrf
450
451 interface lapack_getri
452 subroutine dgetri(n, a, lda, ipiv, work, lwork, info)
453 use, intrinsic :: iso_fortran_env
454 implicit none
455 integer, intent(in) :: n, lda, lwork
456 real(real64), intent(inout) :: a
457 integer, intent(in) :: ipiv
458 real(real64), intent(out) :: work
459 integer, intent(out) :: info
460 end subroutine dgetri
461
462 subroutine zgetri(n, a, lda, ipiv, work, lwork, info)
463 use, intrinsic :: iso_fortran_env
464 implicit none
465 integer, intent(in) :: n, lda, lwork
466 complex(real64), intent(inout) :: a
467 integer, intent(in) :: ipiv
468 complex(real64), intent(out) :: work
469 integer, intent(out) :: info
470 end subroutine zgetri
471 end interface lapack_getri
472
473 interface lapack_sytrf
474 subroutine dsytrf(uplo, n, a, lda, ipiv, work, lwork, info)
475 use, intrinsic :: iso_fortran_env
476 implicit none
477 character(1), intent(in) :: uplo
478 integer, intent(in) :: n, lda, lwork
479 real(real64), intent(inout) :: a
480 integer, intent(out) :: ipiv
481 real(real64), intent(out) :: work
482 integer, intent(out) :: info
483 end subroutine dsytrf
484
485 subroutine zsytrf(uplo, n, a, lda, ipiv, work, lwork, info)
486 use, intrinsic :: iso_fortran_env
487 implicit none
488 character(1), intent(in) :: uplo
489 integer, intent(in) :: n, lda, lwork
490 complex(real64), intent(inout) :: a
491 integer, intent(out) :: ipiv
492 complex(real64), intent(out) :: work
493 integer, intent(out) :: info
494 end subroutine zsytrf
495 end interface lapack_sytrf
496
497 interface lapack_sytri
498 subroutine dsytri (uplo, n, a, lda, ipiv, work, info)
499 use, intrinsic :: iso_fortran_env
500 implicit none
501 character(1), intent(in) :: uplo
502 integer, intent(in) :: n, lda
503 real(real64), intent(inout) :: a
504 integer, intent(in) :: ipiv
505 real(real64), intent(out) :: work
506 integer, intent(out) :: info
507 end subroutine dsytri
508
509 subroutine zsytri (uplo, n, a, lda, ipiv, work, info)
510 use, intrinsic :: iso_fortran_env
511 implicit none
512 character(1), intent(in) :: uplo
513 integer, intent(in) :: n, lda
514 complex(real64), intent(inout) :: a
515 integer, intent(in) :: ipiv
516 complex(real64), intent(out) :: work
517 integer, intent(out) :: info
518 end subroutine zsytri
519 end interface lapack_sytri
520
521 interface lapack_stev
522 subroutine dstev (jobz, n, d, e, z, ldz, work, info)
523 use, intrinsic :: iso_fortran_env
524 implicit none
525 character(1), intent(in) :: jobz
526 integer, intent(in) :: n
527 real(real64), intent(inout) :: d, e
528 real(real64), intent(out) :: z
529 integer, intent(in) :: ldz
530 real(real64), intent(out) :: work
531 integer, intent(out) :: info
532 end subroutine dstev
533 end interface lapack_stev
535 interface lapack_steqr
536 subroutine zsteqr (compz, n, d, e, z, ldz, work, info)
537 use, intrinsic :: iso_fortran_env
538 implicit none
539 character(1), intent(in) :: compz
540 integer, intent(in) :: n
541 real(real64), intent(inout) :: d, e
542 complex(real64), intent(inout) :: z
543 integer, intent(in) :: ldz
544 real(real64), intent(out) :: work
545 integer, intent(out) :: info
546 end subroutine zsteqr
547 end interface lapack_steqr
548
549
550end module lapack_oct_m
551
552!! Local Variables:
553!! mode: f90
554!! coding: utf-8
555!! End:
Computes for an complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or righ...
Definition: lapack.F90:238
Computes a QR factorization of a real matrix A:
Definition: lapack.F90:357
Computes all eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A.
Definition: lapack.F90:313
Computes all the eigenvalues, and optionally, the eigenvectors of a complex generalized Hermitian-def...
Definition: lapack.F90:194
Same as lapack_hegv but using the divide and conquer algorithm.
Definition: lapack.F90:208
Computes selected eigenvalues, and optionally, eigenvectors of a complex generalized Hermitian-defini...
Definition: lapack.F90:452
Generates an real matrix Q with orthonormal columns, which is defined as the first N columns of a pr...
Definition: lapack.F90:386
computes the Cholesky factorization of a real symmetric positive definite matrix A.
Definition: lapack.F90:137
Computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix A.
Definition: lapack.F90:299
Computes all the eigenvalues, and optionally, the eigenvectors of a real generalized symmetric-defini...
Definition: lapack.F90:164
Same as lapack_sygv but using the divide and conquer algorithm.
Definition: lapack.F90:177
Computes selected eigenvalues, and optionally, eigenvectors of a real generalized symmetric-definite ...
Definition: lapack.F90:414
This module contains interfaces for LAPACK routines.
Definition: lapack.F90:118