diff src/ov-bool-mat.cc @ 4513:508238e65af7

[project @ 2003-09-19 21:40:57 by jwe]
author jwe
date Fri, 19 Sep 2003 21:41:21 +0000
parents d7d9ca19960a
children d44675070f1a
line wrap: on
line diff
--- a/src/ov-bool-mat.cc
+++ b/src/ov-bool-mat.cc
@@ -44,7 +44,7 @@
 #include "ov-re-mat.h"
 #include "pr-output.h"
 
-template class octave_base_matrix<boolMatrix>;
+template class octave_base_matrix<boolNDArray>;
 
 DEFINE_OCTAVE_ALLOCATOR (octave_bool_matrix);
 
@@ -69,11 +69,16 @@
 {
   octave_value *retval = 0;
 
-  int nr = matrix.rows ();
-  int nc = matrix.cols ();
+  if (matrix.ndims () == 2)
+    {
+      boolMatrix bm = matrix.matrix_value ();
 
-  if (nr == 1 && nc == 1)
-    retval = new octave_bool (matrix (0, 0));
+      int nr = bm.rows ();
+      int nc = bm.cols ();
+
+      if (nr == 1 && nc == 1)
+	retval = new octave_bool (bm (0, 0));
+    }
 
   return retval;
 }