GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
zconv2.f
Go to the documentation of this file.
1c Copyright (C) 2010-2025 The Octave Project Developers
2c
3c See the file COPYRIGHT.md in the top-level directory of this
4c distribution or <https://octave.org/copyright/>.
5c
6c This file is part of Octave.
7c
8c Octave is free software: you can redistribute it and/or modify it
9c under the terms of the GNU General Public License as published by
10c the Free Software Foundation, either version 3 of the License, or
11c (at your option) any later version.
12c
13c Octave is distributed in the hope that it will be useful, but
14c WITHOUT ANY WARRANTY; without even the implied warranty of
15c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16c GNU General Public License for more details.
17c
18c You should have received a copy of the GNU General Public License
19c along with Octave; see the file COPYING. If not, see
20c <https://www.gnu.org/licenses/>.
21c
22 subroutine zconv2o(ma,na,a,mb,nb,b,c)
23c purpose: a 2-dimensional outer additive convolution.
24c equivalent to the following:
25c for i = 1:ma
26c for j = 1:na
27c c(i:i+mb-1,j:j+mb-1) += a(i,j)*b
28c endfor
29c endfor
30c arguments:
31c ma,na (in) dimensions of a
32c a (in) 1st matrix
33c mb,nb (in) dimensions of b
34c b (in) 2nd matrix
35c c (inout) accumulator matrix, size (ma+mb-1, na+nb-1)
36c
37 integer ma,na,mb,nb
38 double complex a(ma,na),b(mb,nb)
39 double complex c(ma+mb-1,na+nb-1)
40 integer i,j,k
41 external zaxpy
42 do k = 1,na
43 do j = 1,nb
44 do i = 1,mb
45 call zaxpy(ma,b(i,j),a(1,k),1,c(i,j+k-1),1)
46 end do
47 end do
48 end do
49 end subroutine
50
51 subroutine zconv2i(ma,na,a,mb,nb,b,c)
52c purpose: a 2-dimensional inner additive convolution.
53c equivalent to the following:
54c for i = 1:ma-mb+1
55c for j = 1:na-nb+1
56c c(i,j) = sum (sum (a(i+mb-1:-1:i,j+nb-1:-1:j) .* b))
57c endfor
58c endfor
59c arguments:
60c ma,na (in) dimensions of a
61c a (in) 1st matrix
62c mb,nb (in) dimensions of b
63c b (in) 2nd matrix
64c c (inout) accumulator matrix, size (ma+mb-1, na+nb-1)
65c
66 integer ma,na,mb,nb
67 double complex a(ma,na),b(mb,nb)
68 double complex c(ma-mb+1,na-nb+1)
69 integer i,j,k
70 external zaxpy
71 do k = 1,na-nb+1
72 do j = 1,nb
73 do i = 1,mb
74 call zaxpy(ma-mb+1,b(i,j),a(mb+1-i,k+nb-j),1,c(1,k),1)
75 end do
76 end do
77 end do
78 end subroutine
subroutine zconv2i(ma, na, a, mb, nb, b, c)
Definition zconv2.f:52
subroutine zconv2o(ma, na, a, mb, nb, b, c)
Definition zconv2.f:23