Octopus
blas.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
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! -----------------------------------------------------------------------
24! -----------------------------------------------------------------------
25module blas_oct_m
26
27 implicit none
28
29 public ! only interfaces in this module
30
31 ! ---------------------------------------------------------------------
32 ! BLAS level I
33 ! ---------------------------------------------------------------------
34
37 interface blas_swap
38 subroutine dswap(n, dx, incx, dy, incy)
39 use, intrinsic :: iso_fortran_env
40 implicit none
41 integer, intent(in) :: n, incx, incy
42 real(real64), intent(inout) :: dx, dy
43 end subroutine dswap
44
45 subroutine zswap(n, dx, incx, dy, incy)
46 use, intrinsic :: iso_fortran_env
47 implicit none
48 integer, intent(in) :: n, incx, incy
49 complex(real64), intent(inout) :: dx, dy
50 end subroutine zswap
51 end interface blas_swap
52
55 interface blas_scal
56 subroutine dscal(n, da, dx, incx)
57 use, intrinsic :: iso_fortran_env
58 implicit none
59 integer, intent(in) :: n, incx
60 real(real64), intent(in) :: da
61 real(real64), intent(inout) :: dx
62 end subroutine dscal
63
64 subroutine zscal(n, da, dx, incx)
65 use, intrinsic :: iso_fortran_env
66 implicit none
67 integer, intent(in) :: n, incx
68 complex(real64), intent(in) :: da
69 complex(real64), intent(inout) :: dx
70 end subroutine zscal
71
72 subroutine dazscal(n, da, dx)
73 use, intrinsic :: iso_fortran_env
74 implicit none
75 integer, intent(in) :: n
76 real(real64), intent(in) :: da
77 complex(real64), intent(inout) :: dx
78 end subroutine dazscal
79 end interface blas_scal
80
83 interface blas_axpy
84 subroutine daxpy (n, da, dx, incx, dy, incy)
85 use, intrinsic :: iso_fortran_env
86 implicit none
87 integer, intent(in) :: n, incx, incy
88 real(real64), intent(in) :: da, dx
89 real(real64), intent(inout) :: dy
90 end subroutine daxpy
91
92 subroutine zaxpy (n, da, dx, incx, dy, incy)
93 use, intrinsic :: iso_fortran_env
94 implicit none
95 integer, intent(in) :: n, incx, incy
96 complex(real64), intent(in) :: da, dx
97 complex(real64), intent(inout) :: dy
98 end subroutine zaxpy
99
100 subroutine dazaxpy (n, da, dx, dy)
101 use, intrinsic :: iso_fortran_env
102 implicit none
103 integer, intent(in) :: n
104 real(real64), intent(in) :: da
105 complex(real64), intent(in) :: dx
106 complex(real64), intent(inout) :: dy
107 end subroutine dazaxpy
108 end interface blas_axpy
109
112 interface blas_copy
113 subroutine dcopy(n, dx, incx, dy, incy)
114 use, intrinsic :: iso_fortran_env
115 implicit none
116 integer, intent(in) :: n, incx, incy
117 real(real64), intent(in) :: dx
118 real(real64), intent(out) :: dy
119 end subroutine dcopy
120
121 subroutine zcopy(n, dx, incx, dy, incy)
122 use, intrinsic :: iso_fortran_env
123 implicit none
124 integer, intent(in) :: n, incx, incy
125 complex(real64), intent(in) :: dx
126 complex(real64), intent(out) :: dy
127 end subroutine zcopy
128 end interface blas_copy
129
132 interface blas_dot
133 real(real64) function ddot(n, dx, incx, dy, incy)
134 use, intrinsic :: iso_fortran_env
135 integer, intent(in) :: n, incx, incy
136 real(real64), intent(in) :: dx, dy
137 end function ddot
139 complex(real64) function zdotc(n, dx, incx, dy, incy)
140 use, intrinsic :: iso_fortran_env
141 integer, intent(in) :: n, incx, incy
142 complex(real64), intent(in) :: dx, dy
143 end function zdotc
144 end interface blas_dot
145
146 interface blas_dotu
147 complex(real64) function zdotu(n, dx, incx, dy, incy)
148 use, intrinsic :: iso_fortran_env
149 integer, intent(in) :: n, incx, incy
150 complex(real64), intent(in) :: dx, dy
151 end function zdotu
152 end interface blas_dotu
153
160 interface blas_nrm2
161 real(real64) function dnrm2(n, dx, incx)
162 use, intrinsic :: iso_fortran_env
163 integer, intent(in) :: n, incx
164 real(real64), intent(in) :: dx
165 end function dnrm2
166
167 real(real64) function dznrm2(n, dx, incx)
168 use, intrinsic :: iso_fortran_env
169 integer, intent(in) :: n, incx
170 complex(real64), intent(in) :: dx
171 end function dznrm2
172 end interface blas_nrm2
173
174
175 ! ------------------------------------------------------------------
176 ! BLAS level II
177 ! ------------------------------------------------------------------
178
188 interface blas_symv
189 subroutine dsymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
190 use, intrinsic :: iso_fortran_env
191 implicit none
192 character(1), intent(in) :: uplo
193 integer, intent(in) :: n, lda, incx, incy
194 real(real64), intent(in) :: alpha, beta
195 real(real64), intent(in) :: a
196 real(real64), intent(in) :: x
197 real(real64), intent(inout) :: y
198 end subroutine dsymv
199
200 subroutine zsymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
201 use, intrinsic :: iso_fortran_env
202 implicit none
203 character(1), intent(in) :: uplo
204 integer, intent(in) :: n, lda, incx, incy
205 complex(real64), intent(in) :: alpha, beta
206 complex(real64), intent(in) :: a
207 complex(real64), intent(in) :: x
208 complex(real64), intent(inout) :: y
209 end subroutine zsymv
210 end interface blas_symv
211
225 interface blas_gemv
226 subroutine dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
227 use, intrinsic :: iso_fortran_env
228 implicit none
229 character(1), intent(in) :: trans
230 integer, intent(in) :: m, n, lda, incx, incy
231 real(real64), intent(in) :: alpha, beta
232 real(real64), intent(in) :: a
233 real(real64), intent(in) :: x
234 real(real64), intent(inout) :: y
235 end subroutine dgemv
236
237 subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
238 use, intrinsic :: iso_fortran_env
239 implicit none
240 character(1), intent(in) :: trans
241 integer, intent(in) :: m, n, lda, incx, incy
242 complex(real64), intent(in) :: alpha, beta
243 complex(real64), intent(in) :: a
244 complex(real64), intent(in) :: x
245 complex(real64), intent(inout) :: y
246 end subroutine zgemv
247 end interface blas_gemv
248
249
250 ! ------------------------------------------------------------------
251 ! BLAS level III
252 ! ------------------------------------------------------------------
270 interface blas_gemm
271 subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
272 use, intrinsic :: iso_fortran_env
273 implicit none
274 character(1), intent(in) :: transa, transb
275 integer, intent(in) :: m, n, k, lda, ldb, ldc
276 real(real64), intent(in) :: alpha, beta
277 real(real64), intent(in) :: a
278 real(real64), intent(in) :: b
279 real(real64), intent(inout) :: c
280 end subroutine dgemm
282 subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
283 use, intrinsic :: iso_fortran_env
284 implicit none
285 character(1), intent(in) :: transa, transb
286 integer, intent(in) :: m, n, k, lda, ldb, ldc
287 complex(real64), intent(in) :: alpha, beta
288 complex(real64), intent(in) :: a
289 complex(real64), intent(in) :: b
290 complex(real64), intent(inout) :: c
291 end subroutine zgemm
292
293 subroutine zdgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
294 use, intrinsic :: iso_fortran_env
295 implicit none
296 character(1), intent(in) :: transa, transb
297 integer, intent(in) :: m, n, k, lda, ldb, ldc
298 real(real64), intent(in) :: alpha, beta
299 complex(real64), intent(in) :: a
300 real(real64), intent(in) :: b
301 complex(real64), intent(inout) :: c
302 end subroutine zdgemm
303 end interface
304
319 interface blas_trmm
320 subroutine dtrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
321 use, intrinsic :: iso_fortran_env
322 implicit none
323 character(1), intent(in) :: side, uplo, transa, diag
324 integer, intent(in) :: m, n, lda, ldb
325 real(real64), intent(in) :: a, alpha
326 real(real64), intent(inout) :: b
327 end subroutine dtrmm
328
329 subroutine ztrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
330 use, intrinsic :: iso_fortran_env
331 use, intrinsic :: iso_fortran_env
332 implicit none
333 character(1), intent(in) :: side, uplo, transa, diag
334 integer, intent(in) :: m, n, lda, ldb
335 complex(real64), intent(in) :: a, alpha
336 complex(real64), intent(inout) :: b
337 end subroutine ztrmm
338 end interface blas_trmm
339
355 interface blas_symm
356 subroutine dsymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
357 use, intrinsic :: iso_fortran_env
358 implicit none
359 character(1), intent(in) :: side, uplo
360 integer, intent(in) :: m, n, lda, ldb, ldc
361 real(real64), intent(in) :: alpha, beta, a, b
362 real(real64), intent(inout) :: c
363 end subroutine dsymm
365 subroutine zsymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
366 use, intrinsic :: iso_fortran_env
367 implicit none
368 character(1), intent(in) :: side, uplo
369 integer, intent(in) :: m, n, lda, ldb, ldc
370 complex(real64), intent(in) :: alpha, beta, a, b
371 complex(real64), intent(inout) :: c
372 end subroutine zsymm
373 end interface blas_symm
374
391 interface blas_herk
392 subroutine dsyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
393 use, intrinsic :: iso_fortran_env
394 implicit none
395 character(1), intent(in) :: uplo, trans
396 integer, intent(in) :: n, k, lda, ldc
397 real(real64), intent(in) :: alpha, beta, a
398 real(real64), intent(inout) :: c
399 end subroutine dsyrk
400
401 subroutine zherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
402 use, intrinsic :: iso_fortran_env
403 implicit none
404 character(1), intent(in) :: uplo, trans
405 integer, intent(in) :: n, k, lda, ldc
406 real(real64), intent(in) :: alpha, beta
407 complex(real64), intent(in) :: a
408 complex(real64), intent(inout) :: c
409 end subroutine zherk
410 end interface blas_herk
411
432 interface blas_trsm
433 subroutine dtrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
434 use, intrinsic :: iso_fortran_env
435 implicit none
436 character(1), intent(in) :: side
437 character(1), intent(in) :: uplo
438 character(1), intent(in) :: transa
439 character(1), intent(in) :: diag
440 integer, intent(in) :: m
441 integer, intent(in) :: n
442 real(real64), intent(in) :: alpha
443 real(real64), intent(in) :: a
444 integer, intent(in) :: lda
445 real(real64), intent(inout) :: b
446 integer, intent(in) :: ldb
447 end subroutine dtrsm
449 subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
450 use, intrinsic :: iso_fortran_env
451 implicit none
452 character(1), intent(in) :: side
453 character(1), intent(in) :: uplo
454 character(1), intent(in) :: transa
455 character(1), intent(in) :: diag
456 integer, intent(in) :: m
457 integer, intent(in) :: n
458 complex(real64), intent(in) :: alpha
459 complex(real64), intent(in) :: a
460 integer, intent(in) :: lda
461 complex(real64), intent(inout) :: b
462 integer, intent(in) :: ldb
463 end subroutine ztrsm
464 end interface blas_trsm
465
466end module blas_oct_m
467
468
469!! Local Variables:
470!! mode: f90
471!! coding: utf-8
472!! End:
--------------— axpy ---------------— Constant times a vector plus a vector.
Definition: blas.F90:176
--------------— copy ---------------— Copies a vector, x, to a vector, y.
Definition: blas.F90:205
--------------— dot ---------------— Forms the dot product of two vectors.
Definition: blas.F90:225
--------------— gemm ---------------— performs one of the matrix-matrix operations
Definition: blas.F90:363
--------------— gemv ---------------— SGEMV performs one of the matrix-vector operations
Definition: blas.F90:318
--------------— syrk, herk ---------------— performs one of the symmetric rank k operations
Definition: blas.F90:484
--------------— nrm2 ---------------— Returns the euclidean norm of a vector via the function name,...
Definition: blas.F90:253
--------------— scal ---------------— Scales a vector by a constant.
Definition: blas.F90:148
--------------— swap ---------------— Interchanges two vectors.
Definition: blas.F90:130
--------------— symm, hemm ---------------— performs one of the matrix-matrix operations
Definition: blas.F90:448
--------------— symv ---------------— performs the matrix-vector operation
Definition: blas.F90:281
--------------— trmm ---------------— Performs one of the matrix-matrix operations
Definition: blas.F90:412
--------------------—trsm----------------------— Solves one of the matrix equations
Definition: blas.F90:525
This module contains interfaces for BLAS routines You should not use these routines directly....
Definition: blas.F90:118