Mercurial > hg > octave-nkf
comparison liboctave/numeric/oct-convn.cc @ 17696:92226d09f91a
Return correct convolution for valid shape argument in convn (bug #39314)
* oct-convn.cc: fix results for inner convolution (for shape option as valid)
and both input matrices have more than 2 dimensions.
* conv2.cc: add tests for convn.
author | Marco Cecchetti <mrcekets@gmail.com> |
---|---|
date | Sat, 19 Oct 2013 06:36:41 +0100 |
parents | 648dabbb4c6b |
children | d63878346099 |
comparison
equal
deleted
inserted
replaced
17695:d6f4b01075e0 | 17696:92226d09f91a |
---|---|
86 octave_idx_type ldc = ccd(nd-2); | 86 octave_idx_type ldc = ccd(nd-2); |
87 if (inner) | 87 if (inner) |
88 { | 88 { |
89 for (octave_idx_type ja = 0; ja < na - nb + 1; ja++) | 89 for (octave_idx_type ja = 0; ja < na - nb + 1; ja++) |
90 for (octave_idx_type jb = 0; jb < nb; jb++) | 90 for (octave_idx_type jb = 0; jb < nb; jb++) |
91 convolve_nd<T, R> (a + ma*(ja + jb), ad, acd, b + mb*jb, bd, bcd, | 91 convolve_nd<T, R> (a + ma*(ja+jb), ad, acd, b + mb*(nb-jb-1), bd, bcd, |
92 c + ldc*ja, ccd, nd-1, inner); | 92 c + ldc*ja, ccd, nd-1, inner); |
93 } | 93 } |
94 else | 94 else |
95 { | 95 { |
96 for (octave_idx_type ja = 0; ja < na; ja++) | 96 for (octave_idx_type ja = 0; ja < na; ja++) |