Octopus
lalg_basic.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
22 use blas_oct_m
23 use debug_oct_m
24 use global_oct_m
25 use, intrinsic :: iso_fortran_env
28 use utils_oct_m
29
30 implicit none
31
32 private
33 public :: &
34 lalg_swap, &
35 lalg_scal, &
36 lalg_axpy, &
37 lalg_copy, &
38 lalg_nrm2, &
39 lalg_symv, &
40 lalg_gemv, &
41 lalg_gemm, &
44 lalg_trmm, &
46 ! ------------------------------------------------------------------
47 ! BLAS level I
48 ! ------------------------------------------------------------------
49
51 interface lalg_swap
52 module procedure swap_1_2
53 module procedure swap_2_2
54 module procedure swap_3_2
55 module procedure swap_4_2
56 module procedure swap_1_4
57 module procedure swap_2_4
58 module procedure swap_3_4
59 module procedure swap_4_4
60 end interface lalg_swap
61
63 interface lalg_scal
64 module procedure scal_1_2
65 module procedure scal_2_2
66 module procedure scal_3_2
67 module procedure scal_4_2
68 module procedure scal_1_4
69 module procedure scal_2_4
70 module procedure scal_3_4
71 module procedure scal_4_4
72 module procedure scal_5_4
73 module procedure scal_6_4
74 end interface lalg_scal
75
77 interface lalg_axpy
78 module procedure axpy_1_2
79 module procedure axpy_2_2
80 module procedure axpy_3_2
81 module procedure axpy_4_2
82 module procedure axpy_1_4
83 module procedure axpy_2_4
84 module procedure axpy_3_4
85 module procedure axpy_4_4
86 module procedure axpy_5_4
87 module procedure axpy_6_4
88 module procedure axpy_7_4
89 end interface lalg_axpy
90
92 interface lalg_copy
93 module procedure copy_1_2
94 module procedure copy_2_2
95 module procedure copy_3_2
96 module procedure copy_4_2
97 module procedure copy_1_4
98 module procedure copy_2_4
99 module procedure copy_3_4
100 module procedure copy_4_4
101 end interface lalg_copy
102
104 interface lalg_nrm2
105 module procedure nrm2_2
106 module procedure nrm2_4
107 end interface lalg_nrm2
108
109 ! ------------------------------------------------------------------
110 ! BLAS level II
111 ! ------------------------------------------------------------------
112
114 interface lalg_symv
115 module procedure symv_1_2
116 module procedure symv_1_4
117 module procedure symv_2_2
118 module procedure symv_2_4
119 end interface lalg_symv
120
121 interface lalg_gemv
122 module procedure gemv_1_2
123 module procedure gemv_1_4
124 module procedure gemv_2_2
125 module procedure gemv_2_4
126 end interface lalg_gemv
127
128 ! ------------------------------------------------------------------
129 ! BLAS level III
130 ! ------------------------------------------------------------------
131
133 interface lalg_gemm
134 module procedure gemm_1_2
135 module procedure gemm_1_4
136 module procedure gemm_2_2
137 module procedure gemm_2_4
138 end interface lalg_gemm
139
141 interface lalg_gemm_cn
142 module procedure gemm_cn_1_2
143 module procedure gemm_cn_1_4
144 module procedure gemm_cn_2_2
145 module procedure gemm_cn_2_4
146 end interface lalg_gemm_cn
147
149 interface lalg_gemm_nc
150 module procedure gemm_nc_1_2
151 module procedure gemm_nc_1_4
152 module procedure gemm_nc_2_2
153 module procedure gemm_nc_2_4
154 end interface lalg_gemm_nc
155
158 interface lalg_symm
159 module procedure symm_1_2
160 module procedure symm_1_4
161 end interface lalg_symm
162
164 interface lalg_trmm
165 module procedure trmm_1_2
166 module procedure trmm_1_4
167 end interface lalg_trmm
168
169
170contains
171
172# define N_ARG_TYPES 2
173# include "lalg_basic_blas_inc.F90"
174# undef N_ARG_TYPES
175
176# define N_ARG_TYPES 4
177# include "lalg_basic_blas_inc.F90"
178# undef N_ARG_TYPES
179
180end module lalg_basic_oct_m
181
182
183!! Local Variables:
184!! mode: f90
185!! coding: utf-8
186!! End:
constant times a vector plus a vector
Definition: lalg_basic.F90:170
Copies a vector x, to a vector y.
Definition: lalg_basic.F90:185
The same as above but with (Hermitian) transpose of A.
Definition: lalg_basic.F90:234
The same as lalg_gemm but with (Hermitian) transpose of B.
Definition: lalg_basic.F90:242
Matrix-matrix multiplication plus matrix.
Definition: lalg_basic.F90:226
Returns the euclidean norm of a vector.
Definition: lalg_basic.F90:197
scales a vector by a constant
Definition: lalg_basic.F90:156
The following matrix multiplications all expect upper triangular matrices for a. For real matrices,...
Definition: lalg_basic.F90:251
Matrix-vector multiplication plus vector.
Definition: lalg_basic.F90:207
Matrix-matrix multiplication.
Definition: lalg_basic.F90:257
This module contains interfaces for BLAS routines You should not use these routines directly....
Definition: blas.F90:118
subroutine symv_2_4(n1, n2, alpha, a, x, beta, y)
subroutine trmm_1_2(m, n, uplo, transa, side, alpha, a, b)
subroutine axpy_1_4(n1, da, dx, dy)
subroutine axpy_4_2(n1, n2, n3, n4, da, dx, dy)
Definition: lalg_basic.F90:574
subroutine swap_4_2(n1, n2, n3, n4, dx, dy)
Definition: lalg_basic.F90:362
subroutine copy_2_4(n1, n2, dx, dy)
subroutine swap_2_2(n1, n2, dx, dy)
Definition: lalg_basic.F90:315
subroutine gemm_1_2(m, n, k, alpha, a, b, beta, c)
Definition: lalg_basic.F90:840
subroutine gemm_2_4(m1, m2, n, k, alpha, a, b, beta, c)
subroutine axpy_6_4(n1, n2, da, dx, dy)
subroutine axpy_2_2(n1, n2, da, dx, dy)
Definition: lalg_basic.F90:503
subroutine trmm_1_4(m, n, uplo, transa, side, alpha, a, b)
subroutine swap_3_2(n1, n2, n3, dx, dy)
Definition: lalg_basic.F90:341
subroutine copy_3_2(n1, n2, n3, dx, dy)
Definition: lalg_basic.F90:666
subroutine scal_5_4(n1, da, dx)
subroutine copy_4_2(n1, n2, n3, n4, dx, dy)
Definition: lalg_basic.F90:691
subroutine swap_3_4(n1, n2, n3, dx, dy)
subroutine gemm_nc_2_2(m1, m2, n1, n2, k, alpha, a, b, beta, c)
Definition: lalg_basic.F90:954
subroutine scal_2_4(n1, n2, da, dx)
subroutine swap_4_4(n1, n2, n3, n4, dx, dy)
subroutine gemm_cn_1_2(m, n, k, alpha, a, b, beta, c)
The same as above but with (Hermitian) transpose of a.
Definition: lalg_basic.F90:886
subroutine gemm_cn_2_4(m1, m2, n1, n2, k, alpha, a, b, beta, c)
subroutine scal_1_2(n1, da, dx)
Definition: lalg_basic.F90:389
subroutine scal_4_4(n1, n2, n3, n4, da, dx)
subroutine swap_1_2(n1, dx, dy)
Definition: lalg_basic.F90:298
subroutine axpy_3_4(n1, n2, n3, da, dx, dy)
subroutine swap_1_4(n1, dx, dy)
subroutine axpy_4_4(n1, n2, n3, n4, da, dx, dy)
subroutine gemv_2_2(m1, m2, n, alpha, a, x, beta, y)
Definition: lalg_basic.F90:809
subroutine scal_6_4(n1, n2, da, dx)
subroutine gemm_2_2(m1, m2, n, k, alpha, a, b, beta, c)
Definition: lalg_basic.F90:861
subroutine scal_1_4(n1, da, dx)
subroutine copy_1_2(n1, dx, dy)
Definition: lalg_basic.F90:612
subroutine gemv_2_4(m1, m2, n, alpha, a, x, beta, y)
subroutine gemm_cn_2_2(m1, m2, n1, n2, k, alpha, a, b, beta, c)
Definition: lalg_basic.F90:907
subroutine scal_2_2(n1, n2, da, dx)
Definition: lalg_basic.F90:406
subroutine axpy_5_4(n1, da, dx, dy)
subroutine copy_2_2(n1, n2, dx, dy)
Definition: lalg_basic.F90:635
subroutine axpy_7_4(n1, n2, n3, da, dx, dy)
subroutine axpy_3_2(n1, n2, n3, da, dx, dy)
Definition: lalg_basic.F90:542
subroutine scal_3_4(n1, n2, n3, da, dx)
subroutine gemm_nc_2_4(m1, m2, n1, n2, k, alpha, a, b, beta, c)
subroutine axpy_1_2(n1, da, dx, dy)
Definition: lalg_basic.F90:474
real(real64) function nrm2_4(n, dx)
subroutine symv_1_2(n, alpha, a, x, beta, y)
Definition: lalg_basic.F90:750
subroutine gemm_1_4(m, n, k, alpha, a, b, beta, c)
subroutine gemv_1_2(m, n, alpha, a, x, beta, y)
Definition: lalg_basic.F90:790
subroutine copy_1_4(n1, dx, dy)
subroutine symm_1_4(m, n, side, alpha, a, b, beta, c)
The following matrix multiplications all expect upper triangular matrices for a. For real matrices,...
subroutine gemm_nc_1_2(m, n, k, alpha, a, b, beta, c)
The same as gemm but with (Hermitian) transpose of b.
Definition: lalg_basic.F90:933
subroutine symv_2_2(n1, n2, alpha, a, x, beta, y)
Definition: lalg_basic.F90:768
subroutine swap_2_4(n1, n2, dx, dy)
subroutine copy_4_4(n1, n2, n3, n4, dx, dy)
real(real64) function nrm2_2(n, dx)
Definition: lalg_basic.F90:722
subroutine gemm_cn_1_4(m, n, k, alpha, a, b, beta, c)
The same as above but with (Hermitian) transpose of a.
subroutine gemm_nc_1_4(m, n, k, alpha, a, b, beta, c)
The same as gemm but with (Hermitian) transpose of b.
subroutine symm_1_2(m, n, side, alpha, a, b, beta, c)
The following matrix multiplications all expect upper triangular matrices for a. For real matrices,...
Definition: lalg_basic.F90:981
subroutine axpy_2_4(n1, n2, da, dx, dy)
subroutine gemv_1_4(m, n, alpha, a, x, beta, y)
subroutine copy_3_4(n1, n2, n3, dx, dy)
subroutine scal_4_2(n1, n2, n3, n4, da, dx)
Definition: lalg_basic.F90:450
subroutine symv_1_4(n, alpha, a, x, beta, y)
subroutine scal_3_2(n1, n2, n3, da, dx)
Definition: lalg_basic.F90:431
This module is intended to contain simple general-purpose utility functions and procedures.
Definition: utils.F90:118