Mercurial > octave-nkf
comparison liboctave/CmplxSCHUR.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 |
comparison
equal
deleted
inserted
replaced
10606:ec34c7acd057 | 10607:f7501986e42d |
---|---|
68 { | 68 { |
69 (*current_liboctave_error_handler) | 69 (*current_liboctave_error_handler) |
70 ("ComplexSCHUR requires square matrix"); | 70 ("ComplexSCHUR requires square matrix"); |
71 return -1; | 71 return -1; |
72 } | 72 } |
73 else if (a_nr == 0) | |
74 { | |
75 schur_mat.clear (); | |
76 unitary_mat.clear (); | |
77 return 0; | |
78 } | |
73 | 79 |
74 // Workspace requirements may need to be fixed if any of the | 80 // Workspace requirements may need to be fixed if any of the |
75 // following change. | 81 // following change. |
76 | 82 |
77 char jobvs; | 83 char jobvs; |
102 double rconde; | 108 double rconde; |
103 double rcondv; | 109 double rcondv; |
104 | 110 |
105 schur_mat = a; | 111 schur_mat = a; |
106 if (calc_unitary) | 112 if (calc_unitary) |
107 unitary_mat.resize (n, n); | 113 unitary_mat.clear (n, n); |
108 | 114 |
109 Complex *s = schur_mat.fortran_vec (); | 115 Complex *s = schur_mat.fortran_vec (); |
110 Complex *q = unitary_mat.fortran_vec (); | 116 Complex *q = unitary_mat.fortran_vec (); |
111 | 117 |
112 Array<double> rwork (n, 1); | 118 Array<double> rwork (n, 1); |