diff liboctave/dbleSCHUR.cc @ 10607:f7501986e42d

make schur more Matlab compatible
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 06 May 2010 09:49:36 +0200
parents 12884915a8e4
children 23d2378512a0
line wrap: on
line diff
--- a/liboctave/dbleSCHUR.cc	Wed May 05 21:14:18 2010 -0700
+++ b/liboctave/dbleSCHUR.cc	Thu May 06 09:49:36 2010 +0200
@@ -70,6 +70,12 @@
       (*current_liboctave_error_handler) ("SCHUR requires square matrix");
       return -1;
     }
+  else if (a_nr == 0)
+    {
+      schur_mat.clear ();
+      unitary_mat.clear ();
+      return 0;
+    }
 
   // Workspace requirements may need to be fixed if any of the
   // following change.
@@ -106,7 +112,7 @@
   schur_mat = a;
 
   if (calc_unitary)
-    unitary_mat.resize (n, n);
+    unitary_mat.clear (n, n);
 
   double *s = schur_mat.fortran_vec ();
   double *q = unitary_mat.fortran_vec ();