Mercurial > octave-nkf
comparison liboctave/floatSCHUR.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 if (a_nr != a_nc) | 68 if (a_nr != a_nc) |
69 { | 69 { |
70 (*current_liboctave_error_handler) ("FloatSCHUR requires square matrix"); | 70 (*current_liboctave_error_handler) ("FloatSCHUR 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; |
104 float rcondv; | 110 float rcondv; |
105 | 111 |
106 schur_mat = a; | 112 schur_mat = a; |
107 | 113 |
108 if (calc_unitary) | 114 if (calc_unitary) |
109 unitary_mat.resize (n, n); | 115 unitary_mat.clear (n, n); |
110 | 116 |
111 float *s = schur_mat.fortran_vec (); | 117 float *s = schur_mat.fortran_vec (); |
112 float *q = unitary_mat.fortran_vec (); | 118 float *q = unitary_mat.fortran_vec (); |
113 | 119 |
114 Array<float> wr (n, 1); | 120 Array<float> wr (n, 1); |