1
c Copyright (C) 2010-2013 VZLU Prague, a.s., Czech Republic
3
c Author: Jaroslav Hajek <highegg@gmail.com>
5
c This file is part of Octave.
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.
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.
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/>.
21
subroutine zconv2o(ma,na,a,mb,nb,b,c)
22
c purpose: a 2-dimensional outer additive convolution.
23
c equivalent to the following:
26
c c(i:i+mb-1,j:j+mb-1) += a(i,j)*b
30
c ma,na (in) dimensions of a
32
c mb,nb (in) dimensions of b
34
c c (inout) accumulator matrix, size (ma+mb-1, na+nb-1)
37
double complex a(ma,na),b(mb,nb)
38
double complex c(ma+mb-1,na+nb-1)
44
call zaxpy(ma,b(i,j),a(1,k),1,c(i,j+k-1),1)
50
subroutine zconv2i(ma,na,a,mb,nb,b,c)
51
c purpose: a 2-dimensional inner additive convolution.
52
c equivalent to the following:
55
c c(i,j) = sum (sum (a(i+mb-1:-1:i,j+nb-1:-1:j) .* b))
59
c ma,na (in) dimensions of a
61
c mb,nb (in) dimensions of b
63
c c (inout) accumulator matrix, size (ma+mb-1, na+nb-1)
66
double complex a(ma,na),b(mb,nb)
67
double complex c(ma-mb+1,na-nb+1)
73
call zaxpy(ma-mb+1,b(i,j),a(mb+1-i,k+nb-j),1,c(1,k),1)