# HG changeset patch # User jwe # Date 1098456412 0 # Node ID 51a4406317e916a123b02315751003ddab1d1e2e # Parent d112fc15399c73b4f6deb851c8a1a8a21a011f2f [project @ 2004-10-22 14:46:52 by jwe] diff -r d112fc15399c -r 51a4406317e9 src/DLD-FUNCTIONS/filter.cc --- a/src/DLD-FUNCTIONS/filter.cc Thu Oct 21 06:30:39 2004 +0000 +++ b/src/DLD-FUNCTIONS/filter.cc Fri Oct 22 14:46:52 2004 +0000 @@ -88,7 +88,20 @@ return y; } - if (si_dims.length () != x_dims.length ()) + if (si_dims.length() == 1) + { + // Special case as x_dims.length() might be 2, but be a vector + if (x_dims.length() > 2 || + (x_dims.length () == 2 && ((x_dims(0) != 1 || + x_dims(1) != si_dims(0)) && + (x_dims(1) != 1 || + x_dims(0) != si_dims(0))))) + { + error ("filter: dimensionality of si and x must agree"); + return y; + } + } + else if (si_dims.length () != x_dims.length ()) { error ("filter: dimensionality of si and x must agree"); return y; @@ -99,7 +112,10 @@ { if (i == dim) continue; - + + if (x_dims(i) == 1) + continue; + if (si_dims (++si_dim) != x_dims (i)) { error ("filter: dimensionality of si and x must agree");