annotate liboctave/external/blas-xtra/zdconv2.f @ 31706:597f3ee61a48 stable

update Octave Project Developers copyright for the new year
author John W. Eaton <jwe@octave.org>
date Fri, 06 Jan 2023 13:11:27 -0500
parents 796f54d4ddbf
children 2e484f9f1f18
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31706
597f3ee61a48 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
1 c Copyright (C) 2010-2023 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
2 c
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 c See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 c distribution or <https://octave.org/copyright/>.
10388
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
5 c
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
6 c This file is part of Octave.
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
7 c
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23434
diff changeset
8 c Octave is free software: you can redistribute it and/or modify it
22802
0dcff7695e26 maint: Update more Copyright statements to use standard form.
Rik <rik@octave.org>
parents: 22323
diff changeset
9 c under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23434
diff changeset
10 c the Free Software Foundation, either version 3 of the License, or
10388
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
11 c (at your option) any later version.
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
12 c
22802
0dcff7695e26 maint: Update more Copyright statements to use standard form.
Rik <rik@octave.org>
parents: 22323
diff changeset
13 c Octave is distributed in the hope that it will be useful, but
0dcff7695e26 maint: Update more Copyright statements to use standard form.
Rik <rik@octave.org>
parents: 22323
diff changeset
14 c WITHOUT ANY WARRANTY; without even the implied warranty of
10388
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
15 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
16 c GNU General Public License for more details.
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
17 c
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
18 c You should have received a copy of the GNU General Public License
22802
0dcff7695e26 maint: Update more Copyright statements to use standard form.
Rik <rik@octave.org>
parents: 22323
diff changeset
19 c along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23434
diff changeset
20 c <https://www.gnu.org/licenses/>.
10388
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
21 c
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
22 subroutine zdconv2o(ma,na,a,mb,nb,b,c)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
23 c purpose: a 2-dimensional outer additive convolution.
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
24 c equivalent to the following:
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
25 c for i = 1:ma
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
26 c for j = 1:na
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
27 c c(i:i+mb-1,j:j+mb-1) += a(i,j)*b
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
28 c endfor
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
29 c endfor
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
30 c arguments:
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
31 c ma,na (in) dimensions of a
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
32 c a (in) 1st matrix
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
33 c mb,nb (in) dimensions of b
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
34 c b (in) 2nd matrix
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
35 c c (inout) accumulator matrix, size (ma+mb-1, na+nb-1)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
36 c
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
37 integer ma,na,mb,nb
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
38 double complex a(ma,na)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
39 double precision b(mb,nb)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
40 double complex c(ma+mb-1,na+nb-1)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
41 double complex btmp
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
42 integer i,j,k
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
43 external zaxpy
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
44 do k = 1,na
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
45 do j = 1,nb
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
46 do i = 1,mb
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
47 btmp = b(i,j)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
48 call zaxpy(ma,btmp,a(1,k),1,c(i,j+k-1),1)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
49 end do
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
50 end do
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
51 end do
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
52 end subroutine
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
53
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
54 subroutine zdconv2i(ma,na,a,mb,nb,b,c)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
55 c purpose: a 2-dimensional inner additive convolution.
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
56 c equivalent to the following:
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
57 c for i = 1:ma-mb+1
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
58 c for j = 1:na-nb+1
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
59 c c(i,j) = sum (sum (a(i:i+mb-1,j:j+nb-1) .* b))
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
60 c endfor
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
61 c endfor
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
62 c arguments:
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
63 c ma,na (in) dimensions of a
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
64 c a (in) 1st matrix
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
65 c mb,nb (in) dimensions of b
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
66 c b (in) 2nd matrix
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
67 c c (inout) accumulator matrix, size (ma+mb-1, na+nb-1)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
68 c
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
69 integer ma,na,mb,nb
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
70 double complex a(ma,na)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
71 double precision b(mb,nb)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
72 double complex c(ma-mb+1,na-nb+1)
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
73 double complex btmp
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
74 integer i,j,k
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
75 external zaxpy
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
76 do k = 1,na-nb+1
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
77 do j = 1,nb
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
78 do i = 1,mb
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
79 btmp = b(i,j)
14596
ad1d7a53b1ca perform convolution properly independently of matrix orientation (bug #34893)
Sunghyun Cho <sodomau@gmail.com>
parents: 14138
diff changeset
80 call zaxpy(ma-mb+1,btmp,a(mb+1-i,k+nb-j),1,c(1,k),1)
10388
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
81 end do
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
82 end do
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
83 end do
5af0b4bb384d rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
84 end subroutine