comparison liboctave/oct-convn.cc @ 14209:846273dae16b stable

Return correct part of convolution for 'same' parameter in conv2, convn (Bug #34893). * oct-convn.cc: Fix off-by-1 index error for 'same' part of convolution. * conv2.cc (conv2, convn): Update documentation strings to be explicit about what part of the convolution is returned for each SHAPE parameter. Add new tests for conv2().
author Rik <octave@nomad.inbox5.com>
date Tue, 17 Jan 2012 14:37:45 -0800
parents 72c96de7a403
children 460a3c6d8bf1
comparison
equal deleted inserted replaced
14205:fe2ace7a35da 14209:846273dae16b
135 { 135 {
136 // Pick the relevant part. 136 // Pick the relevant part.
137 Array<idx_vector> sidx (dim_vector (nd, 1)); 137 Array<idx_vector> sidx (dim_vector (nd, 1));
138 138
139 for (int i = 0; i < nd; i++) 139 for (int i = 0; i < nd; i++)
140 sidx(i) = idx_vector::make_range ((bdims(i)-1)/2, 1, adims(i)); 140 sidx(i) = idx_vector::make_range (bdims(i)/2, 1, adims(i));
141 c = c.index (sidx); 141 c = c.index (sidx);
142 } 142 }
143 143
144 return c; 144 return c;
145 } 145 }