Mercurial > octave
annotate liboctave/external/blas-xtra/zconv2.f @ 29358:0a5b15007766 stable
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2021.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Feb 2021 09:52:15 -0500 |
parents | 9f9ac219896d |
children | 796f54d4ddbf |
rev | line source |
---|---|
29358
0a5b15007766
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27985
diff
changeset
|
1 c Copyright (C) 2010-2021 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 zconv2o(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),b(mb,nb) |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
39 double complex c(ma+mb-1,na+nb-1) |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
40 integer i,j,k |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
41 external zaxpy |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
42 do k = 1,na |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
43 do j = 1,nb |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
44 do i = 1,mb |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
45 call zaxpy(ma,b(i,j),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
|
46 end do |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
47 end do |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
48 end do |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
49 end subroutine |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
50 |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
51 subroutine zconv2i(ma,na,a,mb,nb,b,c) |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
52 c purpose: a 2-dimensional inner additive convolution. |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
53 c equivalent to the following: |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
54 c for i = 1:ma-mb+1 |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
55 c for j = 1:na-nb+1 |
10946
1094868ca10d
fix bugs in inner convolution
Jaroslav Hajek <highegg@gmail.com>
parents:
10388
diff
changeset
|
56 c c(i,j) = sum (sum (a(i+mb-1:-1:i,j+nb-1:-1:j) .* b)) |
10388
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
57 c endfor |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
58 c endfor |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
59 c arguments: |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
60 c ma,na (in) dimensions of a |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
61 c a (in) 1st matrix |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
62 c mb,nb (in) dimensions of b |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
63 c b (in) 2nd matrix |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
64 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
|
65 c |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
66 integer ma,na,mb,nb |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
67 double complex a(ma,na),b(mb,nb) |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
68 double complex c(ma-mb+1,na-nb+1) |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
69 integer i,j,k |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
70 external zaxpy |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
71 do k = 1,na-nb+1 |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
72 do j = 1,nb |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
73 do i = 1,mb |
14596
ad1d7a53b1ca
perform convolution properly independently of matrix orientation (bug #34893)
Sunghyun Cho <sodomau@gmail.com>
parents:
14138
diff
changeset
|
74 call zaxpy(ma-mb+1,b(i,j),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
|
75 end do |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
76 end do |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
77 end do |
5af0b4bb384d
rewrite convn optimizations based on xAXPY
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
78 end subroutine |