Mercurial > octave
annotate liboctave/numeric/gepbalance.cc @ 22327:d0562b3159c7
move more classes inside octave namespace
* ov-complex.cc, quit.h, lo-array-errwarn.h, lo-array-errwarn.cc,
lo-array-gripes.cc: Move classes inside octave namespace.
* NEWS, file-editor-tab.cc, Cell.cc, __qp__.cc, cellfun.cc, daspk.cc,
dasrt.cc, dassl.cc, data.cc, error.cc, error.h, errwarn.cc, errwarn.h,
file-io.cc, gcd.cc, graphics.cc, graphics.in.h, gripes.cc, gripes.h,
input.cc, interpreter.cc, interpreter.h, inv.cc, jit-typeinfo.cc,
load-path.cc, ls-mat-ascii.cc, ls-mat5.cc, lsode.cc, mex.cc,
oct-handle.h, oct-map.cc, oct-stream.cc, quad.cc, rand.cc,
sparse-xdiv.cc, sparse-xpow.cc, sparse.cc, sub2ind.cc, toplev.cc,
utils.cc, variables.cc, xdiv.cc, xpow.cc, __eigs__.cc,
__init_gnuplot__.cc, ov-base-diag.cc, ov-base-mat.cc,
ov-base-scalar.cc, ov-base-sparse.cc, ov-base.cc, ov-class.cc,
ov-classdef.cc, ov-complex.h, ov-complex.cc, ov-cx-mat.cc,
ov-cx-sparse.cc, ov-fcn-handle.cc, ov-float.cc, ov-float.h,
ov-flt-complex.h, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-java.cc,
ov-oncleanup.cc, ov-perm.cc, ov-range.cc, ov-re-diag.cc, ov-re-mat.cc,
ov-re-sparse.cc, ov-scalar.cc, ov-scalar.h, ov-str-mat.cc, ov.cc,
op-cs-cs.cc, op-fcs-fcs.cc, op-fs-fs.cc, op-int.h, op-s-s.cc, ops.h,
oct-parse.in.yy, pt-assign.cc, pt-eval.cc, pt-idx.cc, pt.cc,
Array-util.cc, Array.cc, CColVector.cc, CDiagMatrix.cc, CMatrix.cc,
CNDArray.cc, CRowVector.cc, CSparse.cc, DiagArray2.cc, MDiagArray2.cc,
MSparse.cc, PermMatrix.cc, Range.cc, Sparse.cc, dColVector.cc,
dDiagMatrix.cc, dMatrix.cc, dNDArray.cc, dRowVector.cc, dSparse.cc,
fCColVector.cc, fCDiagMatrix.cc, fCMatrix.cc, fCNDArray.cc,
fCRowVector.cc, fColVector.cc, fDiagMatrix.cc, fMatrix.cc,
fNDArray.cc, fRowVector.cc, idx-vector.cc, quit.cc, quit.h,
gepbalance.cc, Sparse-diag-op-defs.h, Sparse-op-defs.h,
Sparse-perm-op-defs.h, mx-inlines.cc, mx-op-defs.h, cmd-edit.cc,
lo-array-errwarn.cc, lo-array-errwarn.h, lo-array-gripes.cc,
lo-array-gripes.h, oct-binmap.h: Update to use namespace.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 17 Aug 2016 03:41:42 -0400 |
parents | bac0d6f07a3e |
children | 7f3c7a8bd131 |
rev | line source |
---|---|
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 /* |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
22323
bac0d6f07a3e
maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents:
22322
diff
changeset
|
3 Copyright (C) 1994-2016 John W. Eaton |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 This file is part of Octave. |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 option) any later version. |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 for more details. |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 */ |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
23 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21268
diff
changeset
|
24 # include "config.h" |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 #endif |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 #include <string> |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 #include <vector> |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 #include "Array-util.h" |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
31 #include "CMatrix.h" |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
32 #include "dMatrix.h" |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
33 #include "fCMatrix.h" |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
34 #include "fMatrix.h" |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
35 #include "gepbalance.h" |
22322
93b3cdd36854
move most f77 function decls to separate header files
John W. Eaton <jwe@octave.org>
parents:
22317
diff
changeset
|
36 #include "lo-lapack-proto.h" |
8377
25bc2d31e1bf
improve OCTAVE_LOCAL_BUFFER
Jaroslav Hajek <highegg@gmail.com>
parents:
7792
diff
changeset
|
37 #include "oct-locbuf.h" |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 |
22317
6ca3acf5fad8
move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents:
22135
diff
changeset
|
39 namespace octave |
6ca3acf5fad8
move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents:
22135
diff
changeset
|
40 { |
6ca3acf5fad8
move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents:
22135
diff
changeset
|
41 namespace math |
6ca3acf5fad8
move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents:
22135
diff
changeset
|
42 { |
6ca3acf5fad8
move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents:
22135
diff
changeset
|
43 |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
44 template <> |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 octave_idx_type |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
46 gepbalance<Matrix>::init (const Matrix& a, const Matrix& b, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
47 const std::string& balance_job) |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 { |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 octave_idx_type n = a.cols (); |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 if (a.rows () != n) |
21136
7cac4e7458f2
maint: clean up code around calls to current_liboctave_error_handler.
Rik <rik@octave.org>
parents:
21129
diff
changeset
|
52 (*current_liboctave_error_handler) ("GEPBALANCE requires square matrix"); |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
54 if (a.dims () != b.dims ()) |
22327
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
55 octave::err_nonconformant ("GEPBALANCE", n, n, b.rows(), b.cols()); |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 octave_idx_type info; |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 octave_idx_type ilo; |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 octave_idx_type ihi; |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 OCTAVE_LOCAL_BUFFER (double, plscale, n); |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 OCTAVE_LOCAL_BUFFER (double, prscale, n); |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 OCTAVE_LOCAL_BUFFER (double, pwork, 6 * n); |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 balanced_mat = a; |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 double *p_balanced_mat = balanced_mat.fortran_vec (); |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 balanced_mat2 = b; |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 double *p_balanced_mat2 = balanced_mat2.fortran_vec (); |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 char job = balance_job[0]; |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 F77_XFCN (dggbal, DGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1), |
10314
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
73 n, p_balanced_mat, n, p_balanced_mat2, |
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
74 n, ilo, ihi, plscale, prscale, pwork, info |
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
75 F77_CHAR_ARG_LEN (1))); |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 balancing_mat = Matrix (n, n, 0.0); |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
78 balancing_mat2 = Matrix (n, n, 0.0); |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 for (octave_idx_type i = 0; i < n; i++) |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 { |
10142
829e69ec3110
make OCTAVE_QUIT a function
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
81 octave_quit (); |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 balancing_mat.elem (i ,i) = 1.0; |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 balancing_mat2.elem (i ,i) = 1.0; |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
84 } |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
86 double *p_balancing_mat = balancing_mat.fortran_vec (); |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
87 double *p_balancing_mat2 = balancing_mat2.fortran_vec (); |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
88 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
89 // first left |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
90 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1), |
10314
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
91 F77_CONST_CHAR_ARG2 ("L", 1), |
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
92 n, ilo, ihi, plscale, prscale, |
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
93 n, p_balancing_mat, n, info |
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
94 F77_CHAR_ARG_LEN (1) |
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
95 F77_CHAR_ARG_LEN (1))); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
96 |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
97 // then right |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
98 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1), |
10314
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
99 F77_CONST_CHAR_ARG2 ("R", 1), |
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
100 n, ilo, ihi, plscale, prscale, |
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
101 n, p_balancing_mat2, n, info |
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
102 F77_CHAR_ARG_LEN (1) |
07ebe522dac2
untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
103 F77_CHAR_ARG_LEN (1))); |
7792
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
104 |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
105 return info; |
39c1026191e9
add missing files from single-precision merge
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
106 } |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
107 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
108 template <> |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
109 octave_idx_type |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
110 gepbalance<FloatMatrix>::init (const FloatMatrix& a, const FloatMatrix& b, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
111 const std::string& balance_job) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
112 { |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
113 octave_idx_type n = a.cols (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
114 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
115 if (a.rows () != n) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
116 (*current_liboctave_error_handler) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
117 ("FloatGEPBALANCE requires square matrix"); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
118 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
119 if (a.dims () != b.dims ()) |
22327
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
120 octave::err_nonconformant ("FloatGEPBALANCE", n, n, b.rows(), b.cols()); |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
121 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
122 octave_idx_type info; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
123 octave_idx_type ilo; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
124 octave_idx_type ihi; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
125 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
126 OCTAVE_LOCAL_BUFFER (float, plscale, n); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
127 OCTAVE_LOCAL_BUFFER (float, prscale, n); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
128 OCTAVE_LOCAL_BUFFER (float, pwork, 6 * n); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
129 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
130 balanced_mat = a; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
131 float *p_balanced_mat = balanced_mat.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
132 balanced_mat2 = b; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
133 float *p_balanced_mat2 = balanced_mat2.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
134 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
135 char job = balance_job[0]; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
136 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
137 F77_XFCN (sggbal, SGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
138 n, p_balanced_mat, n, p_balanced_mat2, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
139 n, ilo, ihi, plscale, prscale, pwork, info |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
140 F77_CHAR_ARG_LEN (1))); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
141 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
142 balancing_mat = FloatMatrix (n, n, 0.0); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
143 balancing_mat2 = FloatMatrix (n, n, 0.0); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
144 for (octave_idx_type i = 0; i < n; i++) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
145 { |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
146 octave_quit (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
147 balancing_mat.elem (i ,i) = 1.0; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
148 balancing_mat2.elem (i ,i) = 1.0; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
149 } |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
150 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
151 float *p_balancing_mat = balancing_mat.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
152 float *p_balancing_mat2 = balancing_mat2.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
153 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
154 // first left |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
155 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
156 F77_CONST_CHAR_ARG2 ("L", 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
157 n, ilo, ihi, plscale, prscale, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
158 n, p_balancing_mat, n, info |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
159 F77_CHAR_ARG_LEN (1) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
160 F77_CHAR_ARG_LEN (1))); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
161 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
162 // then right |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
163 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
164 F77_CONST_CHAR_ARG2 ("R", 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
165 n, ilo, ihi, plscale, prscale, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
166 n, p_balancing_mat2, n, info |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
167 F77_CHAR_ARG_LEN (1) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
168 F77_CHAR_ARG_LEN (1))); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
169 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
170 return info; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
171 } |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
172 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
173 template <> |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
174 octave_idx_type |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
175 gepbalance<ComplexMatrix>::init (const ComplexMatrix& a, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
176 const ComplexMatrix& b, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
177 const std::string& balance_job) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
178 { |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
179 octave_idx_type n = a.cols (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
180 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
181 if (a.rows () != n) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
182 (*current_liboctave_error_handler) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
183 ("ComplexGEPBALANCE requires square matrix"); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
184 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
185 if (a.dims () != b.dims ()) |
22327
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
186 octave::err_nonconformant ("ComplexGEPBALANCE", n, n, b.rows(), b.cols()); |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
187 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
188 octave_idx_type info; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
189 octave_idx_type ilo; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
190 octave_idx_type ihi; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
191 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
192 OCTAVE_LOCAL_BUFFER (double, plscale, n); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
193 OCTAVE_LOCAL_BUFFER (double, prscale, n); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
194 OCTAVE_LOCAL_BUFFER (double, pwork, 6 * n); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
195 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
196 balanced_mat = a; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
197 Complex *p_balanced_mat = balanced_mat.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
198 balanced_mat2 = b; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
199 Complex *p_balanced_mat2 = balanced_mat2.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
200 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
201 char job = balance_job[0]; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
202 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
203 F77_XFCN (zggbal, ZGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1), |
22135
407c66ae1e20
reduce warnings from GCC's link-time optimization feature (bug #48531)
John W. Eaton <jwe@octave.org>
parents:
22133
diff
changeset
|
204 n, F77_DBLE_CMPLX_ARG (p_balanced_mat), n, F77_DBLE_CMPLX_ARG (p_balanced_mat2), |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
205 n, ilo, ihi, plscale, prscale, pwork, info |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
206 F77_CHAR_ARG_LEN (1))); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
207 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
208 balancing_mat = Matrix (n, n, 0.0); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
209 balancing_mat2 = Matrix (n, n, 0.0); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
210 for (octave_idx_type i = 0; i < n; i++) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
211 { |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
212 octave_quit (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
213 balancing_mat.elem (i ,i) = 1.0; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
214 balancing_mat2.elem (i ,i) = 1.0; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
215 } |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
216 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
217 double *p_balancing_mat = balancing_mat.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
218 double *p_balancing_mat2 = balancing_mat2.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
219 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
220 // first left |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
221 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
222 F77_CONST_CHAR_ARG2 ("L", 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
223 n, ilo, ihi, plscale, prscale, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
224 n, p_balancing_mat, n, info |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
225 F77_CHAR_ARG_LEN (1) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
226 F77_CHAR_ARG_LEN (1))); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
227 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
228 // then right |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
229 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
230 F77_CONST_CHAR_ARG2 ("R", 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
231 n, ilo, ihi, plscale, prscale, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
232 n, p_balancing_mat2, n, info |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
233 F77_CHAR_ARG_LEN (1) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
234 F77_CHAR_ARG_LEN (1))); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
235 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
236 return info; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
237 } |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
238 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
239 template <> |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
240 octave_idx_type |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
241 gepbalance<FloatComplexMatrix>::init (const FloatComplexMatrix& a, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
242 const FloatComplexMatrix& b, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
243 const std::string& balance_job) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
244 { |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
245 octave_idx_type n = a.cols (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
246 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
247 if (a.rows () != n) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
248 { |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
249 (*current_liboctave_error_handler) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
250 ("FloatComplexGEPBALANCE requires square matrix"); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
251 return -1; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
252 } |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
253 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
254 if (a.dims () != b.dims ()) |
22327
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
255 octave::err_nonconformant ("FloatComplexGEPBALANCE", n, n, b.rows(), b.cols()); |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
256 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
257 octave_idx_type info; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
258 octave_idx_type ilo; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
259 octave_idx_type ihi; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
260 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
261 OCTAVE_LOCAL_BUFFER (float, plscale, n); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
262 OCTAVE_LOCAL_BUFFER (float, prscale, n); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
263 OCTAVE_LOCAL_BUFFER (float, pwork, 6 * n); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
264 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
265 balanced_mat = a; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
266 FloatComplex *p_balanced_mat = balanced_mat.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
267 balanced_mat2 = b; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
268 FloatComplex *p_balanced_mat2 = balanced_mat2.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
269 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
270 char job = balance_job[0]; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
271 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
272 F77_XFCN (cggbal, CGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1), |
22135
407c66ae1e20
reduce warnings from GCC's link-time optimization feature (bug #48531)
John W. Eaton <jwe@octave.org>
parents:
22133
diff
changeset
|
273 n, F77_CMPLX_ARG (p_balanced_mat), n, F77_CMPLX_ARG (p_balanced_mat2), |
407c66ae1e20
reduce warnings from GCC's link-time optimization feature (bug #48531)
John W. Eaton <jwe@octave.org>
parents:
22133
diff
changeset
|
274 n, ilo, ihi, plscale, prscale, pwork, info |
21268
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
275 F77_CHAR_ARG_LEN (1))); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
276 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
277 balancing_mat = FloatMatrix (n, n, 0.0); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
278 balancing_mat2 = FloatMatrix (n, n, 0.0); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
279 for (octave_idx_type i = 0; i < n; i++) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
280 { |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
281 octave_quit (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
282 balancing_mat.elem (i ,i) = 1.0; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
283 balancing_mat2.elem (i ,i) = 1.0; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
284 } |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
285 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
286 float *p_balancing_mat = balancing_mat.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
287 float *p_balancing_mat2 = balancing_mat2.fortran_vec (); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
288 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
289 // first left |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
290 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
291 F77_CONST_CHAR_ARG2 ("L", 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
292 n, ilo, ihi, plscale, prscale, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
293 n, p_balancing_mat, n, info |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
294 F77_CHAR_ARG_LEN (1) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
295 F77_CHAR_ARG_LEN (1))); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
296 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
297 // then right |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
298 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
299 F77_CONST_CHAR_ARG2 ("R", 1), |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
300 n, ilo, ihi, plscale, prscale, |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
301 n, p_balancing_mat2, n, info |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
302 F77_CHAR_ARG_LEN (1) |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
303 F77_CHAR_ARG_LEN (1))); |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
304 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
305 return info; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
306 } |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
307 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
308 // Instantiations we need. |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
309 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
310 template class gepbalance<Matrix>; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
311 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
312 template class gepbalance<FloatMatrix>; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
313 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
314 template class gepbalance<ComplexMatrix>; |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
315 |
f08ae27289e4
better use of templates for balance classes
John W. Eaton <jwe@octave.org>
parents:
21202
diff
changeset
|
316 template class gepbalance<FloatComplexMatrix>; |
22317
6ca3acf5fad8
move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents:
22135
diff
changeset
|
317 |
6ca3acf5fad8
move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents:
22135
diff
changeset
|
318 } |
6ca3acf5fad8
move some new numeric classes to namespace octave::math
John W. Eaton <jwe@octave.org>
parents:
22135
diff
changeset
|
319 } |