GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
zdconv2.f
Go to the documentation of this file.
1 c Copyright (C) 2010-2015 VZLU Prague, a.s., Czech Republic
2 c
3 c Author: Jaroslav Hajek <[email protected]>
4 c
5 c This file is part of Octave.
6 c
7 c Octave is free software; you can redistribute it and/or modify
8 c it under the terms of the GNU General Public License as published by
9 c the Free Software Foundation; either version 3 of the License, or
10 c (at your option) any later version.
11 c
12 c This program is distributed in the hope that it will be useful,
13 c but WITHOUT ANY WARRANTY; without even the implied warranty of
14 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 c GNU General Public License for more details.
16 c
17 c You should have received a copy of the GNU General Public License
18 c along with this software; see the file COPYING. If not, see
19 c <http://www.gnu.org/licenses/>.
20 c
21  subroutine zdconv2o(ma,na,a,mb,nb,b,c)
22 c purpose: a 2-dimensional outer additive convolution.
23 c equivalent to the following:
24 c for i = 1:ma
25 c for j = 1:na
26 c c(i:i+mb-1,j:j+mb-1) += a(i,j)*b
27 c endfor
28 c endfor
29 c arguments:
30 c ma,na (in) dimensions of a
31 c a (in) 1st matrix
32 c mb,nb (in) dimensions of b
33 c b (in) 2nd matrix
34 c c (inout) accumulator matrix, size (ma+mb-1, na+nb-1)
35 c
36  integer ma,na,mb,nb
37  double complex a(ma,na)
38  double precision b(mb,nb)
39  double complex c(ma+mb-1,na+nb-1)
40  double complex btmp
41  integer i,j,k
42  external zaxpy
43  do k = 1,na
44  do j = 1,nb
45  do i = 1,mb
46  btmp = b(i,j)
47  call zaxpy(ma,btmp,a(1,k),1,c(i,j+k-1),1)
48  end do
49  end do
50  end do
51  end subroutine
52 
53  subroutine zdconv2i(ma,na,a,mb,nb,b,c)
54 c purpose: a 2-dimensional inner additive convolution.
55 c equivalent to the following:
56 c for i = 1:ma-mb+1
57 c for j = 1:na-nb+1
58 c c(i,j) = sum (sum (a(i:i+mb-1,j:j+nb-1) .* b))
59 c endfor
60 c endfor
61 c arguments:
62 c ma,na (in) dimensions of a
63 c a (in) 1st matrix
64 c mb,nb (in) dimensions of b
65 c b (in) 2nd matrix
66 c c (inout) accumulator matrix, size (ma+mb-1, na+nb-1)
67 c
68  integer ma,na,mb,nb
69  double complex a(ma,na)
70  double precision b(mb,nb)
71  double complex c(ma-mb+1,na-nb+1)
72  double complex btmp
73  integer i,j,k
74  external zaxpy
75  do k = 1,na-nb+1
76  do j = 1,nb
77  do i = 1,mb
78  btmp = b(i,j)
79  call zaxpy(ma-mb+1,btmp,a(mb+1-i,k+nb-j),1,c(1,k),1)
80  end do
81  end do
82  end do
83  end subroutine
subroutine zdconv2o(ma, na, a, mb, nb, b, c)
Definition: zdconv2.f:21
subroutine zdconv2i(ma, na, a, mb, nb, b, c)
Definition: zdconv2.f:53