diff liboctave/CmplxSCHUR.cc @ 5008:c2bb27ada496

[project @ 2004-09-17 14:45:39 by jwe]
author jwe
date Fri, 17 Sep 2004 14:45:39 +0000
parents 6f3382e08a52
children e35b034d3523
line wrap: on
line diff
--- a/liboctave/CmplxSCHUR.cc
+++ b/liboctave/CmplxSCHUR.cc
@@ -61,7 +61,8 @@
 }
 
 int
-ComplexSCHUR::init (const ComplexMatrix& a, const std::string& ord)
+ComplexSCHUR::init (const ComplexMatrix& a, const std::string& ord, 
+		    bool calc_unitary)
 {
   int a_nr = a.rows ();
   int a_nc = a.cols ();
@@ -76,10 +77,15 @@
   // Workspace requirements may need to be fixed if any of the
   // following change.
 
-  char jobvs = 'V';
+  char jobvs;
   char sense = 'N';
   char sort = 'N';
 
+  if (calc_unitary)
+    jobvs = 'V';
+  else
+    jobvs = 'N';
+
   char ord_char = ord.empty () ? 'U' : ord[0];
 
   if (ord_char == 'A' || ord_char == 'D' || ord_char == 'a' || ord_char == 'd')
@@ -100,7 +106,8 @@
   double rcondv;
 
   schur_mat = a;
-  unitary_mat.resize (n, n);
+  if (calc_unitary)
+    unitary_mat.resize (n, n);
 
   Complex *s = schur_mat.fortran_vec ();
   Complex *q = unitary_mat.fortran_vec ();