diff src/OPERATORS/op-scm-s.cc @ 8835:1685c61542f8

Don't perform narrowing to full matrices in mixed spare scalar operators
author David Bateman <dbateman@free.fr>
date Sat, 21 Feb 2009 01:27:23 +0100
parents a1dbe9d80eee
children eb63fbe60fab
line wrap: on
line diff
--- a/src/OPERATORS/op-scm-s.cc
+++ b/src/OPERATORS/op-scm-s.cc
@@ -56,13 +56,9 @@
   octave_value retval;
 
   if (d == 0.0)
-    {
-      gripe_divide_by_zero ();
+    gripe_divide_by_zero ();
 
-      retval = octave_value (v1.complex_matrix_value () / d);
-    }
-  else
-    retval = octave_value (v1.sparse_complex_matrix_value () / d);
+  retval = octave_value (v1.sparse_complex_matrix_value () / d);
 
   return retval;
 }
@@ -90,7 +86,7 @@
       if (d == 0.0)
 	gripe_divide_by_zero ();
 
-      return octave_value (v2.scalar_value () / d);
+      return octave_value (SparseComplexMatrix (1, 1, v2.scalar_value () / d));
     }
   else
     {
@@ -121,13 +117,9 @@
   octave_value retval;
 
   if (d == 0.0)
-    {
-      gripe_divide_by_zero ();
+    gripe_divide_by_zero ();
 
-      retval = octave_value (v1.complex_matrix_value () / d);
-    }
-  else
-    retval = octave_value (v1.sparse_complex_matrix_value () / d);
+  retval = octave_value (v1.sparse_complex_matrix_value () / d);
 
   return retval;
 }