Mercurial > hg > octave-lyh
changeset 14607:34f067bcac12
maint: Periodic merge of stable to default
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Mon, 07 May 2012 11:59:30 -0400 |
parents | 28e53daab1f8 (current diff) 6980b0f35df9 (diff) |
children | c2ca3b71cd7c 3edba8b5f430 82429f3c1005 |
files | src/DLD-FUNCTIONS/conv2.cc |
diffstat | 7 files changed, 16 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libcruft/blas-xtra/cconv2.f +++ b/libcruft/blas-xtra/cconv2.f @@ -70,7 +70,7 @@ do k = 1,na-nb+1 do j = 1,nb do i = 1,mb - call caxpy(ma-mb+1,b(i,j),a(mb+1-i,k+j-1),1,c(1,k),1) + call caxpy(ma-mb+1,b(i,j),a(mb+1-i,k+nb-j),1,c(1,k),1) end do end do end do
--- a/libcruft/blas-xtra/csconv2.f +++ b/libcruft/blas-xtra/csconv2.f @@ -76,7 +76,7 @@ do j = 1,nb do i = 1,mb btmp = b(i,j) - call caxpy(ma-mb+1,btmp,a(mb+1-i,k+j-1),1,c(1,k),1) + call caxpy(ma-mb+1,btmp,a(mb+1-i,k+nb-j),1,c(1,k),1) end do end do end do
--- a/libcruft/blas-xtra/dconv2.f +++ b/libcruft/blas-xtra/dconv2.f @@ -70,7 +70,7 @@ do k = 1,na-nb+1 do j = 1,nb do i = 1,mb - call daxpy(ma-mb+1,b(i,j),a(mb+1-i,k+j-1),1,c(1,k),1) + call daxpy(ma-mb+1,b(i,j),a(mb+1-i,k+nb-j),1,c(1,k),1) end do end do end do
--- a/libcruft/blas-xtra/sconv2.f +++ b/libcruft/blas-xtra/sconv2.f @@ -70,7 +70,7 @@ do k = 1,na-nb+1 do j = 1,nb do i = 1,mb - call saxpy(ma-mb+1,b(i,j),a(mb+1-i,k+j-1),1,c(1,k),1) + call saxpy(ma-mb+1,b(i,j),a(mb+1-i,k+nb-j),1,c(1,k),1) end do end do end do
--- a/libcruft/blas-xtra/zconv2.f +++ b/libcruft/blas-xtra/zconv2.f @@ -70,7 +70,7 @@ do k = 1,na-nb+1 do j = 1,nb do i = 1,mb - call zaxpy(ma-mb+1,b(i,j),a(mb+1-i,k+j-1),1,c(1,k),1) + call zaxpy(ma-mb+1,b(i,j),a(mb+1-i,k+nb-j),1,c(1,k),1) end do end do end do
--- a/libcruft/blas-xtra/zdconv2.f +++ b/libcruft/blas-xtra/zdconv2.f @@ -76,7 +76,7 @@ do j = 1,nb do i = 1,mb btmp = b(i,j) - call zaxpy(ma-mb+1,btmp,a(mb+1-i,k+j-1),1,c(1,k),1) + call zaxpy(ma-mb+1,btmp,a(mb+1-i,k+nb-j),1,c(1,k),1) end do end do end do
--- a/src/DLD-FUNCTIONS/conv2.cc +++ b/src/DLD-FUNCTIONS/conv2.cc @@ -262,9 +262,18 @@ %% Test cases from Bug #34893 %!assert (conv2 ([1:5;1:5], [1:2], "same"), [4 7 10 13 10; 4 7 10 13 10]) %!assert (conv2 ([1:5;1:5]', [1:2]', "same"), [4 7 10 13 10; 4 7 10 13 10]') -%!#assert (conv2 ([1:5;1:5], [1:2], "valid"), [4 7 10 13; 4 7 10 13]) +%!assert (conv2 ([1:5;1:5], [1:2], "valid"), [4 7 10 13; 4 7 10 13]) %!assert (conv2 ([1:5;1:5]', [1:2]', "valid"), [4 7 10 13; 4 7 10 13]') +%!test +%! rand ("seed", 42); +%! x = rand (100); +%! y = ones (5); +%! A = conv2 (x, y)(5:end-4,5:end-4); +%! B = conv2 (x, y, "valid"); +%! assert (B, A); ## Yes, this test is for *exact* equivalence. + + %% Test input validation %!error conv2 () %!error conv2 (1)