23 #if defined (HAVE_CONFIG_H) 51 (
"GEPBALANCE requires square matrix");
53 if (
a.dims () !=
b.dims ())
65 double *p_balanced_mat = balanced_mat.fortran_vec ();
67 double *p_balanced_mat2 = balanced_mat2.fortran_vec ();
69 char job = balance_job[0];
71 F77_XFCN (dggbal, DGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
72 n, p_balanced_mat, n, p_balanced_mat2,
73 n, ilo, ihi, plscale, prscale, pwork, info
74 F77_CHAR_ARG_LEN (1)));
76 balancing_mat =
Matrix (n, n, 0.0);
77 balancing_mat2 =
Matrix (n, n, 0.0);
81 balancing_mat.elem (
i ,
i) = 1.0;
82 balancing_mat2.elem (
i ,
i) = 1.0;
85 double *p_balancing_mat = balancing_mat.fortran_vec ();
86 double *p_balancing_mat2 = balancing_mat2.fortran_vec ();
89 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
90 F77_CONST_CHAR_ARG2 (
"L", 1),
91 n, ilo, ihi, plscale, prscale,
92 n, p_balancing_mat, n, info
94 F77_CHAR_ARG_LEN (1)));
97 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
98 F77_CONST_CHAR_ARG2 (
"R", 1),
99 n, ilo, ihi, plscale, prscale,
100 n, p_balancing_mat2, n, info
102 F77_CHAR_ARG_LEN (1)));
116 (
"FloatGEPBALANCE requires square matrix");
118 if (
a.dims () !=
b.dims ())
120 n, n,
b.rows(),
b.cols());
131 float *p_balanced_mat = balanced_mat.fortran_vec ();
133 float *p_balanced_mat2 = balanced_mat2.fortran_vec ();
135 char job = balance_job[0];
137 F77_XFCN (sggbal, SGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
138 n, p_balanced_mat, n, p_balanced_mat2,
139 n, ilo, ihi, plscale, prscale, pwork, info
140 F77_CHAR_ARG_LEN (1)));
147 balancing_mat.elem (
i ,
i) = 1.0;
148 balancing_mat2.elem (
i ,
i) = 1.0;
151 float *p_balancing_mat = balancing_mat.fortran_vec ();
152 float *p_balancing_mat2 = balancing_mat2.fortran_vec ();
155 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
156 F77_CONST_CHAR_ARG2 (
"L", 1),
157 n, ilo, ihi, plscale, prscale,
158 n, p_balancing_mat, n, info
160 F77_CHAR_ARG_LEN (1)));
163 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
164 F77_CONST_CHAR_ARG2 (
"R", 1),
165 n, ilo, ihi, plscale, prscale,
166 n, p_balancing_mat2, n, info
168 F77_CHAR_ARG_LEN (1)));
183 (
"ComplexGEPBALANCE requires square matrix");
185 if (
a.dims () !=
b.dims ())
187 n, n,
b.rows(),
b.cols());
198 Complex *p_balanced_mat = balanced_mat.fortran_vec ();
200 Complex *p_balanced_mat2 = balanced_mat2.fortran_vec ();
202 char job = balance_job[0];
204 F77_XFCN (zggbal, ZGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
207 n, ilo, ihi, plscale, prscale, pwork, info
208 F77_CHAR_ARG_LEN (1)));
210 balancing_mat =
Matrix (n, n, 0.0);
211 balancing_mat2 =
Matrix (n, n, 0.0);
215 balancing_mat.elem (
i ,
i) = 1.0;
216 balancing_mat2.elem (
i ,
i) = 1.0;
219 double *p_balancing_mat = balancing_mat.fortran_vec ();
220 double *p_balancing_mat2 = balancing_mat2.fortran_vec ();
223 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
224 F77_CONST_CHAR_ARG2 (
"L", 1),
225 n, ilo, ihi, plscale, prscale,
226 n, p_balancing_mat, n, info
228 F77_CHAR_ARG_LEN (1)));
231 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
232 F77_CONST_CHAR_ARG2 (
"R", 1),
233 n, ilo, ihi, plscale, prscale,
234 n, p_balancing_mat2, n, info
236 F77_CHAR_ARG_LEN (1)));
251 (*current_liboctave_error_handler)
252 (
"FloatComplexGEPBALANCE requires square matrix");
256 if (
a.dims () !=
b.dims ())
258 n, n,
b.rows(),
b.cols());
269 FloatComplex *p_balanced_mat = balanced_mat.fortran_vec ();
271 FloatComplex *p_balanced_mat2 = balanced_mat2.fortran_vec ();
273 char job = balance_job[0];
275 F77_XFCN (cggbal, CGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
278 n, ilo, ihi, plscale, prscale, pwork, info
279 F77_CHAR_ARG_LEN (1)));
286 balancing_mat.elem (
i ,
i) = 1.0;
287 balancing_mat2.elem (
i ,
i) = 1.0;
290 float *p_balancing_mat = balancing_mat.fortran_vec ();
291 float *p_balancing_mat2 = balancing_mat2.fortran_vec ();
294 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
295 F77_CONST_CHAR_ARG2 (
"L", 1),
296 n, ilo, ihi, plscale, prscale,
297 n, p_balancing_mat, n, info
299 F77_CHAR_ARG_LEN (1)));
302 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
303 F77_CONST_CHAR_ARG2 (
"R", 1),
304 n, ilo, ihi, plscale, prscale,
305 n, p_balancing_mat2, n, info
307 F77_CHAR_ARG_LEN (1)));
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
#define F77_DBLE_CMPLX_ARG(x)
#define F77_XFCN(f, F, args)
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
octave_f77_int_type F77_INT
octave_idx_type init(const T &a, const T &b, const std::string &job)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
std::complex< float > FloatComplex
std::complex< double > Complex
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string