annotate liboctave/CmplxSCHUR.cc @ 14626:f947d2922feb stable rc-3-6-2-0

3.6.2-rc0 release candidate * configure.ac (AC_INIT): Version is now 3.6.2-rc0. (OCTAVE_RELEASE_DATE): Now 2012-05-11.
author John W. Eaton <jwe@octave.org>
date Fri, 11 May 2012 13:46:18 -0400
parents 72c96de7a403
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
1 /*
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
2
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
3 Copyright (C) 1994-2012 John W. Eaton
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
4
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
6
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
10 option) any later version.
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
11
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
15 for more details.
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
16
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
19 <http://www.gnu.org/licenses/>.
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
20
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
21 */
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
22
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
1192
b6360f2d4fa6 [project @ 1995-03-30 21:38:35 by jwe]
jwe
parents: 1011
diff changeset
24 #include <config.h>
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
25 #endif
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
26
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
27 #include "CmplxSCHUR.h"
1847
2ffe49eb95a5 [project @ 1996-02-03 12:47:55 by jwe]
jwe
parents: 1756
diff changeset
28 #include "f77-fcn.h"
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
29 #include "lo-error.h"
10822
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
30 #include "oct-locbuf.h"
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
31
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
32 extern "C"
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
33 {
4552
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
34 F77_RET_T
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
35 F77_FUNC (zgeesx, ZGEESX) (F77_CONST_CHAR_ARG_DECL,
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
36 F77_CONST_CHAR_ARG_DECL,
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
37 ComplexSCHUR::select_function,
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
38 F77_CONST_CHAR_ARG_DECL,
11495
8a5e980da6aa style fixes
John W. Eaton <jwe@octave.org>
parents: 10822
diff changeset
39 const octave_idx_type&, Complex*,
8a5e980da6aa style fixes
John W. Eaton <jwe@octave.org>
parents: 10822
diff changeset
40 const octave_idx_type&, octave_idx_type&,
8a5e980da6aa style fixes
John W. Eaton <jwe@octave.org>
parents: 10822
diff changeset
41 Complex*, Complex*, const octave_idx_type&,
8a5e980da6aa style fixes
John W. Eaton <jwe@octave.org>
parents: 10822
diff changeset
42 double&, double&, Complex*,
8a5e980da6aa style fixes
John W. Eaton <jwe@octave.org>
parents: 10822
diff changeset
43 const octave_idx_type&, double*,
8a5e980da6aa style fixes
John W. Eaton <jwe@octave.org>
parents: 10822
diff changeset
44 octave_idx_type*, octave_idx_type&
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
45 F77_CHAR_ARG_LEN_DECL
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
46 F77_CHAR_ARG_LEN_DECL
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
47 F77_CHAR_ARG_LEN_DECL);
11495
8a5e980da6aa style fixes
John W. Eaton <jwe@octave.org>
parents: 10822
diff changeset
48
10822
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
49 F77_RET_T
11495
8a5e980da6aa style fixes
John W. Eaton <jwe@octave.org>
parents: 10822
diff changeset
50 F77_FUNC (zrsf2csf, ZRSF2CSF) (const octave_idx_type&, Complex *,
8a5e980da6aa style fixes
John W. Eaton <jwe@octave.org>
parents: 10822
diff changeset
51 Complex *, double *, double *);
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
52 }
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
53
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
54 static octave_idx_type
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
55 select_ana (const Complex& a)
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
56 {
1251
97eac19837dc [project @ 1995-04-11 15:58:32 by jwe]
jwe
parents: 1192
diff changeset
57 return a.real () < 0.0;
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
58 }
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
59
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
60 static octave_idx_type
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
61 select_dig (const Complex& a)
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
62 {
1251
97eac19837dc [project @ 1995-04-11 15:58:32 by jwe]
jwe
parents: 1192
diff changeset
63 return (abs (a) < 1.0);
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
64 }
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
65
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
66 octave_idx_type
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
67 ComplexSCHUR::init (const ComplexMatrix& a, const std::string& ord,
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
68 bool calc_unitary)
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
69 {
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
70 octave_idx_type a_nr = a.rows ();
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
71 octave_idx_type a_nc = a.cols ();
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
72
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
73 if (a_nr != a_nc)
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
74 {
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
75 (*current_liboctave_error_handler)
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
76 ("ComplexSCHUR requires square matrix");
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
77 return -1;
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
78 }
10607
f7501986e42d make schur more Matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 10350
diff changeset
79 else if (a_nr == 0)
f7501986e42d make schur more Matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 10350
diff changeset
80 {
f7501986e42d make schur more Matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 10350
diff changeset
81 schur_mat.clear ();
f7501986e42d make schur more Matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 10350
diff changeset
82 unitary_mat.clear ();
f7501986e42d make schur more Matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 10350
diff changeset
83 return 0;
f7501986e42d make schur more Matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 10350
diff changeset
84 }
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
85
3334
5187390bfde6 [project @ 1999-11-03 20:41:16 by jwe]
jwe
parents: 2847
diff changeset
86 // Workspace requirements may need to be fixed if any of the
5187390bfde6 [project @ 1999-11-03 20:41:16 by jwe]
jwe
parents: 2847
diff changeset
87 // following change.
5187390bfde6 [project @ 1999-11-03 20:41:16 by jwe]
jwe
parents: 2847
diff changeset
88
5008
c2bb27ada496 [project @ 2004-09-17 14:45:39 by jwe]
jwe
parents: 4552
diff changeset
89 char jobvs;
1930
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1929
diff changeset
90 char sense = 'N';
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1929
diff changeset
91 char sort = 'N';
1756
1af643fa00e3 [project @ 1996-01-22 04:55:17 by jwe]
jwe
parents: 1368
diff changeset
92
5008
c2bb27ada496 [project @ 2004-09-17 14:45:39 by jwe]
jwe
parents: 4552
diff changeset
93 if (calc_unitary)
c2bb27ada496 [project @ 2004-09-17 14:45:39 by jwe]
jwe
parents: 4552
diff changeset
94 jobvs = 'V';
c2bb27ada496 [project @ 2004-09-17 14:45:39 by jwe]
jwe
parents: 4552
diff changeset
95 else
c2bb27ada496 [project @ 2004-09-17 14:45:39 by jwe]
jwe
parents: 4552
diff changeset
96 jobvs = 'N';
c2bb27ada496 [project @ 2004-09-17 14:45:39 by jwe]
jwe
parents: 4552
diff changeset
97
1756
1af643fa00e3 [project @ 1996-01-22 04:55:17 by jwe]
jwe
parents: 1368
diff changeset
98 char ord_char = ord.empty () ? 'U' : ord[0];
1af643fa00e3 [project @ 1996-01-22 04:55:17 by jwe]
jwe
parents: 1368
diff changeset
99
1af643fa00e3 [project @ 1996-01-22 04:55:17 by jwe]
jwe
parents: 1368
diff changeset
100 if (ord_char == 'A' || ord_char == 'D' || ord_char == 'a' || ord_char == 'd')
1930
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1929
diff changeset
101 sort = 'S';
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
102
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
103 if (ord_char == 'A' || ord_char == 'a')
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
104 selector = select_ana;
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
105 else if (ord_char == 'D' || ord_char == 'd')
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
106 selector = select_dig;
1930
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1929
diff changeset
107 else
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1929
diff changeset
108 selector = 0;
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
109
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
110 octave_idx_type n = a_nc;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
111 octave_idx_type lwork = 8 * n;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
112 octave_idx_type info;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
113 octave_idx_type sdim;
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
114 double rconde;
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
115 double rcondv;
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
116
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
117 schur_mat = a;
5008
c2bb27ada496 [project @ 2004-09-17 14:45:39 by jwe]
jwe
parents: 4552
diff changeset
118 if (calc_unitary)
10607
f7501986e42d make schur more Matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 10350
diff changeset
119 unitary_mat.clear (n, n);
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
120
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
121 Complex *s = schur_mat.fortran_vec ();
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
122 Complex *q = unitary_mat.fortran_vec ();
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
123
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
124 Array<double> rwork (dim_vector (n, 1));
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
125 double *prwork = rwork.fortran_vec ();
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
126
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
127 Array<Complex> w (dim_vector (n, 1));
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
128 Complex *pw = w.fortran_vec ();
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
129
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
130 Array<Complex> work (dim_vector (lwork, 1));
1929
908f5b6676d7 [project @ 1996-02-11 22:05:08 by jwe]
jwe
parents: 1882
diff changeset
131 Complex *pwork = work.fortran_vec ();
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
132
3334
5187390bfde6 [project @ 1999-11-03 20:41:16 by jwe]
jwe
parents: 2847
diff changeset
133 // BWORK is not referenced for non-ordered Schur.
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
134 octave_idx_type ntmp = (ord_char == 'N' || ord_char == 'n') ? 0 : n;
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
135 Array<octave_idx_type> bwork (dim_vector (ntmp, 1));
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
136 octave_idx_type *pbwork = bwork.fortran_vec ();
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
137
4552
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
138 F77_XFCN (zgeesx, ZGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
139 F77_CONST_CHAR_ARG2 (&sort, 1),
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
140 selector,
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
141 F77_CONST_CHAR_ARG2 (&sense, 1),
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
142 n, s, n, sdim, pw, q, n, rconde, rcondv,
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
143 pwork, lwork, prwork, pbwork, info
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
144 F77_CHAR_ARG_LEN (1)
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
145 F77_CHAR_ARG_LEN (1)
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
146 F77_CHAR_ARG_LEN (1)));
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
147
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
148 return info;
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
149 }
10822
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
150
11498
367bfee35ba0 data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 11495
diff changeset
151 ComplexSCHUR::ComplexSCHUR (const ComplexMatrix& s, const ComplexMatrix& u)
367bfee35ba0 data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 11495
diff changeset
152 : schur_mat (s), unitary_mat (u), selector (0)
10822
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
153 {
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
154 octave_idx_type n = s.rows ();
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
155 if (s.columns () != n || u.rows () != n || u.columns () != n)
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
156 (*current_liboctave_error_handler)
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
157 ("schur: inconsistent matrix dimensions");
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
158 }
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
159
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
160 ComplexSCHUR::ComplexSCHUR (const SCHUR& s)
11498
367bfee35ba0 data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 11495
diff changeset
161 : schur_mat (s.schur_matrix ()), unitary_mat (s.unitary_matrix ()),
367bfee35ba0 data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 11495
diff changeset
162 selector (0)
10822
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
163 {
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
164 octave_idx_type n = schur_mat.rows ();
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
165 if (n > 0)
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
166 {
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
167 OCTAVE_LOCAL_BUFFER (double, c, n-1);
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
168 OCTAVE_LOCAL_BUFFER (double, sx, n-1);
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
169
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
170 F77_XFCN (zrsf2csf, ZRSF2CSF, (n, schur_mat.fortran_vec (),
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
171 unitary_mat.fortran_vec (), c, sx));
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
172 }
23d2378512a0 implement rsf2csf
Jaroslav Hajek <highegg@gmail.com>
parents: 10607
diff changeset
173 }