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 zdscal(n, da, dx, incx)
73 use, intrinsic :: iso_fortran_env
74 implicit none
75 integer, intent(in) :: n, incx
76 real(real64), intent(in) :: da
77 complex(real64), intent(inout) :: dx
78 end subroutine zdscal
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 implicit none
136 integer, intent(in) :: n, incx, incy
137 real(real64), intent(in) :: dx, dy
138 end function ddot
139
140 complex(real64) function zdotc(n, dx, incx, dy, incy)
141 use, intrinsic :: iso_fortran_env
142 implicit none
143 integer, intent(in) :: n, incx, incy
144 complex(real64), intent(in) :: dx, dy
145 end function zdotc
146 end interface blas_dot
147
148 interface blas_dotu
149 complex(real64) function zdotu(n, dx, incx, dy, incy)
150 use, intrinsic :: iso_fortran_env
151 implicit none
152 integer, intent(in) :: n, incx, incy
153 complex(real64), intent(in) :: dx, dy
154 end function zdotu
155 end interface blas_dotu
156
163 interface blas_nrm2
164 real(real64) function dnrm2(n, dx, incx)
165 use, intrinsic :: iso_fortran_env
166 implicit none
167 integer, intent(in) :: n, incx
168 real(real64), intent(in) :: dx
169 end function dnrm2
170
171 real(real64) function dznrm2(n, dx, incx)
172 use, intrinsic :: iso_fortran_env
173 implicit none
174 integer, intent(in) :: n, incx
175 complex(real64), intent(in) :: dx
176 end function dznrm2
177 end interface blas_nrm2
178
179
180 ! ------------------------------------------------------------------
181 ! BLAS level II
182 ! ------------------------------------------------------------------
183
193 interface blas_symv
194 subroutine dsymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
195 use, intrinsic :: iso_fortran_env
196 implicit none
197 character(1), intent(in) :: uplo
198 integer, intent(in) :: n, lda, incx, incy
199 real(real64), intent(in) :: alpha, beta
200 real(real64), intent(in) :: a
201 real(real64), intent(in) :: x
202 real(real64), intent(inout) :: y
203 end subroutine dsymv
204
205 subroutine zsymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
206 use, intrinsic :: iso_fortran_env
207 implicit none
208 character(1), intent(in) :: uplo
209 integer, intent(in) :: n, lda, incx, incy
210 complex(real64), intent(in) :: alpha, beta
211 complex(real64), intent(in) :: a
212 complex(real64), intent(in) :: x
213 complex(real64), intent(inout) :: y
214 end subroutine zsymv
215 end interface blas_symv
216
230 interface blas_gemv
231 subroutine dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
232 use, intrinsic :: iso_fortran_env
233 implicit none
234 character(1), intent(in) :: trans
235 integer, intent(in) :: m, n, lda, incx, incy
236 real(real64), intent(in) :: alpha, beta
237 real(real64), intent(in) :: a
238 real(real64), intent(in) :: x
239 real(real64), intent(inout) :: y
240 end subroutine dgemv
242 subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
243 use, intrinsic :: iso_fortran_env
244 implicit none
245 character(1), intent(in) :: trans
246 integer, intent(in) :: m, n, lda, incx, incy
247 complex(real64), intent(in) :: alpha, beta
248 complex(real64), intent(in) :: a
249 complex(real64), intent(in) :: x
250 complex(real64), intent(inout) :: y
251 end subroutine zgemv
252 end interface blas_gemv
253
254
255 ! ------------------------------------------------------------------
256 ! BLAS level III
257 ! ------------------------------------------------------------------
258
275 interface blas_gemm
276 subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
277 use, intrinsic :: iso_fortran_env
278 implicit none
279 character(1), intent(in) :: transa, transb
280 integer, intent(in) :: m, n, k, lda, ldb, ldc
281 real(real64), intent(in) :: alpha, beta
282 real(real64), intent(in) :: a
283 real(real64), intent(in) :: b
284 real(real64), intent(inout) :: c
285 end subroutine dgemm
287 subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
288 use, intrinsic :: iso_fortran_env
289 implicit none
290 character(1), intent(in) :: transa, transb
291 integer, intent(in) :: m, n, k, lda, ldb, ldc
292 complex(real64), intent(in) :: alpha, beta
293 complex(real64), intent(in) :: a
294 complex(real64), intent(in) :: b
295 complex(real64), intent(inout) :: c
296 end subroutine zgemm
297
298 subroutine zdgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
299 use, intrinsic :: iso_fortran_env
300 implicit none
301 character(1), intent(in) :: transa, transb
302 integer, intent(in) :: m, n, k, lda, ldb, ldc
303 real(real64), intent(in) :: alpha, beta
304 complex(real64), intent(in) :: a
305 real(real64), intent(in) :: b
306 complex(real64), intent(inout) :: c
307 end subroutine zdgemm
308 end interface
309
324 interface blas_trmm
325 subroutine dtrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
326 use, intrinsic :: iso_fortran_env
327 implicit none
328 character(1), intent(in) :: side, uplo, transa, diag
329 integer, intent(in) :: m, n, lda, ldb
330 real(real64), intent(in) :: a, alpha
331 real(real64), intent(inout) :: b
332 end subroutine dtrmm
333
334 subroutine ztrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
335 use, intrinsic :: iso_fortran_env
336 implicit none
337 character(1), intent(in) :: side, uplo, transa, diag
338 integer, intent(in) :: m, n, lda, ldb
339 complex(real64), intent(in) :: a, alpha
340 complex(real64), intent(inout) :: b
341 end subroutine ztrmm
342 end interface blas_trmm
343
359 interface blas_symm
360 subroutine dsymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
361 use, intrinsic :: iso_fortran_env
362 implicit none
363 character(1), intent(in) :: side, uplo
364 integer, intent(in) :: m, n, lda, ldb, ldc
365 real(real64), intent(in) :: alpha, beta, a, b
366 real(real64), intent(inout) :: c
367 end subroutine dsymm
369 subroutine zsymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
370 use, intrinsic :: iso_fortran_env
371 implicit none
372 character(1), intent(in) :: side, uplo
373 integer, intent(in) :: m, n, lda, ldb, ldc
374 complex(real64), intent(in) :: alpha, beta, a, b
375 complex(real64), intent(inout) :: c
376 end subroutine zsymm
377 end interface blas_symm
378
395 interface blas_herk
396 subroutine dsyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
397 use, intrinsic :: iso_fortran_env
398 implicit none
399 character(1), intent(in) :: uplo, trans
400 integer, intent(in) :: n, k, lda, ldc
401 real(real64), intent(in) :: alpha, beta, a
402 real(real64), intent(inout) :: c
403 end subroutine dsyrk
404
405 subroutine zherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
406 use, intrinsic :: iso_fortran_env
407 implicit none
408 character(1), intent(in) :: uplo, trans
409 integer, intent(in) :: n, k, lda, ldc
410 real(real64), intent(in) :: alpha, beta
411 complex(real64), intent(in) :: a
412 complex(real64), intent(inout) :: c
413 end subroutine zherk
414 end interface blas_herk
415
436 interface blas_trsm
437 subroutine dtrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
438 use, intrinsic :: iso_fortran_env
439 implicit none
440 character(1), intent(in) :: side
441 character(1), intent(in) :: uplo
442 character(1), intent(in) :: transa
443 character(1), intent(in) :: diag
444 integer, intent(in) :: m
445 integer, intent(in) :: n
446 real(real64), intent(in) :: alpha
447 real(real64), intent(in) :: a
448 integer, intent(in) :: lda
449 real(real64), intent(inout) :: b
450 integer, intent(in) :: ldb
451 end subroutine dtrsm
453 subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
454 use, intrinsic :: iso_fortran_env
455 implicit none
456 character(1), intent(in) :: side
457 character(1), intent(in) :: uplo
458 character(1), intent(in) :: transa
459 character(1), intent(in) :: diag
460 integer, intent(in) :: m
461 integer, intent(in) :: n
462 complex(real64), intent(in) :: alpha
463 complex(real64), intent(in) :: a
464 integer, intent(in) :: lda
465 complex(real64), intent(inout) :: b
466 integer, intent(in) :: ldb
467 end subroutine ztrsm
468 end interface blas_trsm
469
470end module blas_oct_m
471
472
473!! Local Variables:
474!! mode: f90
475!! coding: utf-8
476!! 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:368
--------------— gemv ---------------— SGEMV performs one of the matrix-vector operations
Definition: blas.F90:323
--------------— syrk, herk ---------------— performs one of the symmetric rank k operations
Definition: blas.F90:488
--------------— nrm2 ---------------— Returns the euclidean norm of a vector via the function name,...
Definition: blas.F90:256
--------------— 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:452
--------------— symv ---------------— performs the matrix-vector operation
Definition: blas.F90:286
--------------— trmm ---------------— Performs one of the matrix-matrix operations
Definition: blas.F90:417
--------------------—trsm----------------------— Solves one of the matrix equations
Definition: blas.F90:529
This module contains interfaces for BLAS routines You should not use these routines directly....
Definition: blas.F90:118