changeset 5055:51a4406317e9

[project @ 2004-10-22 14:46:52 by jwe]
author jwe
date Fri, 22 Oct 2004 14:46:52 +0000
parents d112fc15399c
children 9379d8716407
files src/DLD-FUNCTIONS/filter.cc
diffstat 1 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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");