Mercurial > octave-nkf
comparison liboctave/CmplxSCHUR.cc @ 10822:23d2378512a0
implement rsf2csf
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 27 Jul 2010 11:26:43 +0200 |
parents | f7501986e42d |
children | 8a5e980da6aa |
comparison
equal
deleted
inserted
replaced
10821:693e22af08ae | 10822:23d2378512a0 |
---|---|
26 #endif | 26 #endif |
27 | 27 |
28 #include "CmplxSCHUR.h" | 28 #include "CmplxSCHUR.h" |
29 #include "f77-fcn.h" | 29 #include "f77-fcn.h" |
30 #include "lo-error.h" | 30 #include "lo-error.h" |
31 #include "oct-locbuf.h" | |
31 | 32 |
32 extern "C" | 33 extern "C" |
33 { | 34 { |
34 F77_RET_T | 35 F77_RET_T |
35 F77_FUNC (zgeesx, ZGEESX) (F77_CONST_CHAR_ARG_DECL, | 36 F77_FUNC (zgeesx, ZGEESX) (F77_CONST_CHAR_ARG_DECL, |
41 double&, Complex*, const octave_idx_type&, double*, octave_idx_type*, | 42 double&, Complex*, const octave_idx_type&, double*, octave_idx_type*, |
42 octave_idx_type& | 43 octave_idx_type& |
43 F77_CHAR_ARG_LEN_DECL | 44 F77_CHAR_ARG_LEN_DECL |
44 F77_CHAR_ARG_LEN_DECL | 45 F77_CHAR_ARG_LEN_DECL |
45 F77_CHAR_ARG_LEN_DECL); | 46 F77_CHAR_ARG_LEN_DECL); |
47 F77_RET_T | |
48 F77_FUNC (zrsf2csf, ZRSF2CSF) (const octave_idx_type&, | |
49 Complex *, Complex *, double *, double *); | |
46 } | 50 } |
47 | 51 |
48 static octave_idx_type | 52 static octave_idx_type |
49 select_ana (const Complex& a) | 53 select_ana (const Complex& a) |
50 { | 54 { |
138 F77_CHAR_ARG_LEN (1) | 142 F77_CHAR_ARG_LEN (1) |
139 F77_CHAR_ARG_LEN (1))); | 143 F77_CHAR_ARG_LEN (1))); |
140 | 144 |
141 return info; | 145 return info; |
142 } | 146 } |
147 | |
148 ComplexSCHUR::ComplexSCHUR (const ComplexMatrix& s, | |
149 const ComplexMatrix& u) | |
150 : schur_mat (s), unitary_mat (u) | |
151 { | |
152 octave_idx_type n = s.rows (); | |
153 if (s.columns () != n || u.rows () != n || u.columns () != n) | |
154 (*current_liboctave_error_handler) | |
155 ("schur: inconsistent matrix dimensions"); | |
156 } | |
157 | |
158 ComplexSCHUR::ComplexSCHUR (const SCHUR& s) | |
159 : schur_mat (s.schur_matrix ()), unitary_mat (s.unitary_matrix ()) | |
160 { | |
161 octave_idx_type n = schur_mat.rows (); | |
162 if (n > 0) | |
163 { | |
164 OCTAVE_LOCAL_BUFFER (double, c, n-1); | |
165 OCTAVE_LOCAL_BUFFER (double, sx, n-1); | |
166 | |
167 F77_XFCN (zrsf2csf, ZRSF2CSF, (n, schur_mat.fortran_vec (), | |
168 unitary_mat.fortran_vec (), c, sx)); | |
169 } | |
170 } |