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
88 interface lapack_hegv
89 subroutine zhegv(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, info)
90 use, intrinsic :: iso_fortran_env
91 implicit none
92 character(1), intent(in) :: jobz, uplo
93 integer, intent(in) :: n, itype, lda, ldb, lwork
94 complex(real64), intent(inout) :: a, b
95 real(real64), intent(out) :: w, rwork
96 complex(real64), intent(out) :: work
97 integer, intent(out) :: info
98 end subroutine zhegv
99 end interface lapack_hegv
100
117 interface
118 subroutine dgeev(jobvl, jobvr, n, a, lda, wr, wi, vl, ldvl, vr, ldvr, work, lwork, rwork, info)
119 use, intrinsic :: iso_fortran_env
120 implicit none
121 character(1), intent(in) :: jobvl, jobvr
122 integer, intent(in) :: n, lda, ldvl, ldvr, lwork
123 real(real64), intent(inout) :: a
124 real(real64), intent(out) :: wr, wi, vl, vr
125 real(real64), intent(out) :: rwork
126 real(real64), intent(out) :: work
127 integer, intent(out) :: info
128 end subroutine dgeev
129
130 subroutine zgeev(jobvl, jobvr, n, a, lda, w, vl, ldvl, vr, ldvr, work, lwork, rwork, info)
131 use, intrinsic :: iso_fortran_env
132 implicit none
133 character(1), intent(in) :: jobvl, jobvr
134 integer, intent(in) :: n, lda, ldvl, ldvr, lwork
135 complex(real64), intent(inout) :: a
136 complex(real64), intent(out) :: w, vl, vr
137 real(real64), intent(out) :: rwork
138 complex(real64), intent(out) :: work
139 integer, intent(out) :: info
140 end subroutine zgeev
141 end interface
142
143 interface lapack_gesvx
144 subroutine dgesvx(fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, &
145 c, b, ldb, x, ldx, rcond, ferr, berr, work, iwork, info)
146 use, intrinsic :: iso_fortran_env
147 implicit none
148 character(1), intent(in) :: fact, trans
149 integer, intent(in) :: n, nrhs, lda, ldaf, ldb, ldx
150 real(real64), intent(inout) :: a, af, r, c, b
151 integer, intent(inout) :: ipiv
152 real(real64), intent(out) :: x, ferr, berr, work
153 real(real64), intent(out) :: rcond
154 character(1), intent(inout) :: equed
155 integer, intent(out) :: iwork
156 integer, intent(out) :: info
157 end subroutine dgesvx
158
159 subroutine zgesvx (fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, &
160 c, b, ldb, x, ldx, rcond, ferr, berr, work, rwork, info)
161 use, intrinsic :: iso_fortran_env
162 implicit none
163 character(1), intent(in) :: fact, trans
164 integer, intent(in) :: n, nrhs, lda, ldaf, ldb, ldx
165 complex(real64), intent(inout) :: a, af, b
166 real(real64), intent(inout) :: r, c
167 integer, intent(inout) :: ipiv
168 real(real64), intent(out) :: ferr, berr
169 real(real64), intent(out) :: rcond
170 complex(real64), intent(out) :: x, work
171 character(1), intent(inout) :: equed
172 real(real64), intent(out) :: rwork
173 integer, intent(out) :: info
174 end subroutine zgesvx
175 end interface lapack_gesvx
176
179 interface lapack_syev
180 subroutine dsyev(jobz, uplo, n, a, lda, w, work, lwork, info)
181 use, intrinsic :: iso_fortran_env
182 implicit none
183 character(1), intent(in) :: jobz, uplo
184 integer, intent(in) :: n, lda, lwork
185 real(real64), intent(inout) :: a
186 real(real64), intent(out) :: w, work
187 integer, intent(out) :: info
188 end subroutine dsyev
189 end interface lapack_syev
190
193 interface lapack_heev
194 subroutine zheev(jobz, uplo, n, a, lda, w, work, lwork, rwork, info)
195 use, intrinsic :: iso_fortran_env
196 implicit none
197 character(1), intent(in) :: jobz, uplo
198 integer, intent(in) :: n, lda, lwork
199 complex(real64), intent(inout) :: a
200 real(real64), intent(out) :: w, rwork
201 complex(real64), intent(out) :: work
202 integer, intent(out) :: info
203 end subroutine zheev
204 end interface lapack_heev
205
206 interface
207 subroutine dsyevx(jobz, range, uplo, n, a, lda, &
208 vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, iwork, ifail, info)
209 use, intrinsic :: iso_fortran_env
210 implicit none
211 integer, intent(in) :: n, lda, il, iu, ldz, lwork
212 character(1), intent(in) :: jobz, range, uplo
213 integer, intent(out) :: m, iwork, ifail, info
214 real(real64), intent(in) :: vl, vu, abstol
215 real(real64), intent(inout) :: a
216 real(real64), intent(out) :: w, z, work
217 end subroutine dsyevx
218
219 subroutine zheevx(jobz, range, uplo, n, a, lda, &
220 vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, iwork, ifail, info)
221 use, intrinsic :: iso_fortran_env
222 implicit none
223 integer, intent(in) :: n, lda, il, iu, ldz, lwork
224 character(1), intent(in) :: jobz, range, uplo
225 integer, intent(out) :: m, iwork, ifail, info
226 real(real64), intent(in) :: vl, vu, abstol
227 real(real64), intent(out) :: w
228 complex(real64), intent(inout) :: a
229 complex(real64), intent(out) :: z, work
230 end subroutine zheevx
231 end interface
232
237 interface lapack_geqrf
238 subroutine dgeqrf(m, n, a, lda, tau, work, lwork, info)
239 use, intrinsic :: iso_fortran_env
240 implicit none
241 integer, intent(in) :: lda, lwork, m, n
242 real(real64), intent(inout) :: a
243 real(real64), intent(out) :: tau, work
244 integer, intent(out) :: info
245 end subroutine dgeqrf
246
247 subroutine zgeqrf(m, n, a, lda, tau, work, lwork, info)
248 use, intrinsic :: iso_fortran_env
249 implicit none
250 integer, intent(in) :: lda, lwork, m, n
251 complex(real64), intent(inout) :: a
252 complex(real64), intent(out) :: tau, work
253 integer, intent(out) :: info
254 end subroutine zgeqrf
255 end interface lapack_geqrf
256
266 interface lapack_orgqr
267 subroutine dorgqr(m, n, k, a, lda, tau, work, lwork, info)
268 use, intrinsic :: iso_fortran_env
269 implicit none
270 integer, intent(in) :: k, lda, lwork, m, n
271 real(real64), intent(in) :: tau
272 real(real64), intent(inout) :: a
273 real(real64), intent(out) :: work
274 integer, intent(out) :: info
275 end subroutine dorgqr
276
277 subroutine zungqr(m, n, k, a, lda, tau, work, lwork, info)
278 use, intrinsic :: iso_fortran_env
279 implicit none
280 integer, intent(in) :: k, lda, lwork, m, n
281 complex(real64), intent(in) :: tau
282 complex(real64), intent(inout) :: a
283 complex(real64), intent(out) :: work
284 integer, intent(out) :: info
285 end subroutine zungqr
286 end interface lapack_orgqr
294 interface lapack_sygvx
295 subroutine dsygvx(itype, jobz, range, uplo, n, a, lda, b, ldb, vl, vu, il, iu, abstol, &
296 m, w, z, ldz, work, lwork, iwork, ifail, info)
297 use, intrinsic :: iso_fortran_env
298 implicit none
299
300 integer, intent(in) :: itype
301 character(len=1), intent(in) :: jobz
302 character(len=1), intent(in) :: range
303 character(len=1), intent(in) :: uplo
304 integer, intent(in) :: n
305 real(real64), intent(inout) :: a
306 integer, intent(in) :: lda
307 real(real64), intent(inout) :: b
308 integer, intent(in) :: ldb
309 real(real64), intent(in) :: vl
310 real(real64), intent(in) :: vu
311 integer, intent(in) :: il
312 integer, intent(in) :: iu
313 real(real64), intent(in) :: abstol
314 integer, intent(out) :: m
315 real(real64), intent(out) :: w
316 real(real64), intent(out) :: z
317 integer, intent(in) :: ldz
318 real(real64), intent(out) :: work
319 integer, intent(in) :: lwork
320 integer, intent(out) :: iwork
321 integer, intent(out) :: ifail
322 integer, intent(out) :: info
323 end subroutine dsygvx
324 end interface lapack_sygvx
325
332 interface lapack_hegvx
333 subroutine zhegvx(itype, jobz, range, uplo, n, a, lda, b, ldb, vl, vu, il, iu, abstol, &
334 m, w, z, ldz, work, lwork, rwork, iwork, ifail, info)
335 use, intrinsic :: iso_fortran_env
336 implicit none
337
338 integer, intent(in) :: itype
339 character(len=1), intent(in) :: jobz
340 character(len=1), intent(in) :: range
341 character(len=1), intent(in) :: uplo
342 integer, intent(in) :: n
343 complex(real64), intent(inout) :: a
344 integer, intent(in) :: lda
345 complex(real64), intent(inout) :: b
346 integer, intent(in) :: ldb
347 real(real64), intent(in) :: vl
348 real(real64), intent(in) :: vu
349 integer, intent(in) :: il
350 integer, intent(in) :: iu
351 real(real64), intent(in) :: abstol
352 integer, intent(out) :: m
353 real(real64), intent(out) :: w
354 complex(real64), intent(out) :: z
355 integer, intent(in) :: ldz
356 complex(real64), intent(out) :: work
357 integer, intent(in) :: lwork
358 real(real64), intent(out) :: rwork
359 integer, intent(out) :: iwork
360 integer, intent(out) :: ifail
361 integer, intent(out) :: info
362 end subroutine zhegvx
363 end interface lapack_hegvx
364
365 interface lapack_gelss
366 subroutine dgelss(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, info)
367 use, intrinsic :: iso_fortran_env
368 implicit none
369 integer, intent(in) :: m
370 integer, intent(in) :: n
371 integer, intent(in) :: nrhs
372 real(real64),intent(inout) :: a
373 integer, intent(in) :: lda
374 real(real64),intent(inout) :: b
375 integer, intent(in) :: ldb
376 real(real64),intent(out) :: s
377 real(real64),intent(in) :: rcond
378 integer, intent(out) :: rank
379 real(real64),intent(out) :: work
380 integer, intent(in) :: lwork
381 integer, intent(out) :: info
382 end subroutine dgelss
383
384 subroutine zgelss(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, rwork, info)
385 use, intrinsic :: iso_fortran_env
386 implicit none
387 integer, intent(in) :: m
388 integer, intent(in) :: n
389 integer, intent(in) :: nrhs
390 complex(real64), intent(inout) :: a
391 integer, intent(in) :: lda
392 complex(real64), intent(inout) :: b
393 integer, intent(in) :: ldb
394 real(real64),intent(out) :: s
395 real(real64),intent(in) :: rcond
396 integer, intent(out) :: rank
397 complex(real64), intent(out) :: work
398 integer, intent(in) :: lwork
399 real(real64),intent(out) :: rwork
400 integer, intent(out) :: info
401 end subroutine zgelss
402 end interface lapack_gelss
403
404 interface lapack_getrf
405 subroutine dgetrf (m, n, a, lda, ipiv, info)
406 use, intrinsic :: iso_fortran_env
407 implicit none
408 integer, intent(in) :: m, n, lda
409 real(real64), intent(inout) :: a
410 integer, intent(out) :: ipiv
411 integer, intent(out) :: info
412 end subroutine dgetrf
413
414 subroutine zgetrf (m, n, a, lda, ipiv, info)
415 use, intrinsic :: iso_fortran_env
416 implicit none
417 integer, intent(in) :: m, n, lda
418 complex(real64), intent(inout) :: a
419 integer, intent(out) :: ipiv
420 integer, intent(out) :: info
421 end subroutine zgetrf
422 end interface lapack_getrf
423
424 interface lapack_getri
425 subroutine dgetri(n, a, lda, ipiv, work, lwork, info)
426 use, intrinsic :: iso_fortran_env
427 implicit none
428 integer, intent(in) :: n, lda, lwork
429 real(real64), intent(inout) :: a
430 integer, intent(in) :: ipiv
431 real(real64), intent(out) :: work
432 integer, intent(out) :: info
433 end subroutine dgetri
434
435 subroutine zgetri(n, a, lda, ipiv, work, lwork, info)
436 use, intrinsic :: iso_fortran_env
437 implicit none
438 integer, intent(in) :: n, lda, lwork
439 complex(real64), intent(inout) :: a
440 integer, intent(in) :: ipiv
441 complex(real64), intent(out) :: work
442 integer, intent(out) :: info
443 end subroutine zgetri
444 end interface lapack_getri
445
446 interface lapack_sytrf
447 subroutine dsytrf(uplo, n, a, lda, ipiv, work, lwork, info)
448 use, intrinsic :: iso_fortran_env
449 implicit none
450 character(1), intent(in) :: uplo
451 integer, intent(in) :: n, lda, lwork
452 real(real64), intent(inout) :: a
453 integer, intent(out) :: ipiv
454 real(real64), intent(out) :: work
455 integer, intent(out) :: info
456 end subroutine dsytrf
457
458 subroutine zsytrf(uplo, n, a, lda, ipiv, work, lwork, info)
459 use, intrinsic :: iso_fortran_env
460 implicit none
461 character(1), intent(in) :: uplo
462 integer, intent(in) :: n, lda, lwork
463 complex(real64), intent(inout) :: a
464 integer, intent(out) :: ipiv
465 complex(real64), intent(out) :: work
466 integer, intent(out) :: info
467 end subroutine zsytrf
468 end interface lapack_sytrf
469
470 interface lapack_sytri
471 subroutine dsytri (uplo, n, a, lda, ipiv, work, info)
472 use, intrinsic :: iso_fortran_env
473 implicit none
474 character(1), intent(in) :: uplo
475 integer, intent(in) :: n, lda
476 real(real64), intent(inout) :: a
477 integer, intent(in) :: ipiv
478 real(real64), intent(out) :: work
479 integer, intent(out) :: info
480 end subroutine dsytri
481
482 subroutine zsytri (uplo, n, a, lda, ipiv, work, info)
483 use, intrinsic :: iso_fortran_env
484 implicit none
485 character(1), intent(in) :: uplo
486 integer, intent(in) :: n, lda
487 complex(real64), intent(inout) :: a
488 integer, intent(in) :: ipiv
489 complex(real64), intent(out) :: work
490 integer, intent(out) :: info
491 end subroutine zsytri
492 end interface lapack_sytri
493
494
495end module lapack_oct_m
496
497!! Local Variables:
498!! mode: f90
499!! coding: utf-8
500!! End:
Computes for an complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or righ...
Definition: lapack.F90:211
Computes a QR factorization of a real matrix A:
Definition: lapack.F90:330
Computes all eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A.
Definition: lapack.F90:286
Computes all the eigenvalues, and optionally, the eigenvectors of a complex generalized Hermitian-def...
Definition: lapack.F90:181
Computes selected eigenvalues, and optionally, eigenvectors of a complex generalized Hermitian-defini...
Definition: lapack.F90:425
Generates an real matrix Q with orthonormal columns, which is defined as the first N columns of a pr...
Definition: lapack.F90:359
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:272
Computes all the eigenvalues, and optionally, the eigenvectors of a real generalized symmetric-defini...
Definition: lapack.F90:164
Computes selected eigenvalues, and optionally, eigenvectors of a real generalized symmetric-definite ...
Definition: lapack.F90:387
This module contains interfaces for LAPACK routines.
Definition: lapack.F90:118