comparison liboctave/dbleSCHUR.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
comparison
equal deleted inserted replaced
5007:f8c27dad3643 5008:c2bb27ada496
61 { 61 {
62 return (hypot (a, b) < 1.0); 62 return (hypot (a, b) < 1.0);
63 } 63 }
64 64
65 int 65 int
66 SCHUR::init (const Matrix& a, const std::string& ord) 66 SCHUR::init (const Matrix& a, const std::string& ord, bool calc_unitary)
67 { 67 {
68 int a_nr = a.rows (); 68 int a_nr = a.rows ();
69 int a_nc = a.cols (); 69 int a_nc = a.cols ();
70 70
71 if (a_nr != a_nc) 71 if (a_nr != a_nc)
75 } 75 }
76 76
77 // Workspace requirements may need to be fixed if any of the 77 // Workspace requirements may need to be fixed if any of the
78 // following change. 78 // following change.
79 79
80 char jobvs = 'V'; 80 char jobvs;
81 char sense = 'N'; 81 char sense = 'N';
82 char sort = 'N'; 82 char sort = 'N';
83
84 if (calc_unitary)
85 jobvs = 'V';
86 else
87 jobvs = 'N';
83 88
84 char ord_char = ord.empty () ? 'U' : ord[0]; 89 char ord_char = ord.empty () ? 'U' : ord[0];
85 90
86 if (ord_char == 'A' || ord_char == 'D' || ord_char == 'a' || ord_char == 'd') 91 if (ord_char == 'A' || ord_char == 'D' || ord_char == 'a' || ord_char == 'd')
87 sort = 'S'; 92 sort = 'S';
100 int sdim; 105 int sdim;
101 double rconde; 106 double rconde;
102 double rcondv; 107 double rcondv;
103 108
104 schur_mat = a; 109 schur_mat = a;
105 unitary_mat.resize (n, n); 110
111 if (calc_unitary)
112 unitary_mat.resize (n, n);
106 113
107 double *s = schur_mat.fortran_vec (); 114 double *s = schur_mat.fortran_vec ();
108 double *q = unitary_mat.fortran_vec (); 115 double *q = unitary_mat.fortran_vec ();
109 116
110 Array<double> wr (n); 117 Array<double> wr (n);