24 #if defined (HAVE_CONFIG_H) 41 return noperm ? (noscal ?
'N' :
'S') : (noscal ?
'P' :
'B');
50 : balanced_mat (
a),
scale (), ilo (), ihi (),
57 (
"aepbalance: requires square matrix");
63 F77_XFCN (dgebal, DGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1), n,
64 balanced_mat.fortran_vec (), n,
65 t_ilo, t_ihi,
scale.fortran_vec (), info
66 F77_CHAR_ARG_LEN (1)));
76 F77_INT n = to_f77_int (balanced_mat.rows ());
78 Matrix balancing_mat (n, n, 0.0);
80 balancing_mat.elem (
i ,
i) = 1.0;
83 F77_INT t_ilo = to_f77_int (ilo);
84 F77_INT t_ihi = to_f77_int (ihi);
88 F77_XFCN (dgebak, DGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
89 F77_CONST_CHAR_ARG2 (&side, 1),
90 n, t_ilo, t_ihi,
scale.data (), n,
91 balancing_mat.fortran_vec (), n, info
93 F77_CHAR_ARG_LEN (1)));
101 : balanced_mat (
a),
scale (), ilo (), ihi (),
108 (
"aepbalance: requires square matrix");
114 F77_XFCN (sgebal, SGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1), n,
115 balanced_mat.fortran_vec (), n, t_ilo,
116 t_ihi,
scale.fortran_vec (), info
117 F77_CHAR_ARG_LEN (1)));
127 F77_INT n = to_f77_int (balanced_mat.rows ());
131 balancing_mat.elem (
i ,
i) = 1.0;
134 F77_INT t_ilo = to_f77_int (ilo);
135 F77_INT t_ihi = to_f77_int (ihi);
139 F77_XFCN (sgebak, SGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
140 F77_CONST_CHAR_ARG2 (&side, 1),
141 n, t_ilo, t_ihi,
scale.data (), n,
142 balancing_mat.fortran_vec (), n, info
144 F77_CHAR_ARG_LEN (1)));
146 return balancing_mat;
152 : balanced_mat (
a),
scale (), ilo (), ihi (),
159 (
"aepbalance: requires square matrix");
165 F77_XFCN (zgebal, ZGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1), n,
167 n, t_ilo, t_ihi,
scale.fortran_vec (), info
168 F77_CHAR_ARG_LEN (1)));
178 F77_INT n = to_f77_int (balanced_mat.rows ());
182 balancing_mat.elem (
i,
i) = 1.0;
185 F77_INT t_ilo = to_f77_int (ilo);
186 F77_INT t_ihi = to_f77_int (ihi);
190 F77_XFCN (zgebak, ZGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
191 F77_CONST_CHAR_ARG2 (&side, 1),
192 n, t_ilo, t_ihi,
scale.data (), n,
196 F77_CHAR_ARG_LEN (1)));
198 return balancing_mat;
203 bool noperm,
bool noscal)
204 : balanced_mat (
a),
scale (), ilo (), ihi (),
211 (
"aepbalance: requires square matrix");
217 F77_XFCN (cgebal, CGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1), n,
219 n, t_ilo, t_ihi,
scale.fortran_vec (), info
220 F77_CHAR_ARG_LEN (1)));
230 F77_INT n = to_f77_int (balanced_mat.rows ());
234 balancing_mat.elem (
i,
i) = 1.0;
237 F77_INT t_ilo = to_f77_int (ilo);
238 F77_INT t_ihi = to_f77_int (ihi);
242 F77_XFCN (cgebak, CGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
243 F77_CONST_CHAR_ARG2 (&side, 1),
244 n, t_ilo, t_ihi,
scale.data (), n,
248 F77_CHAR_ARG_LEN (1)));
250 return balancing_mat;
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
#define F77_DBLE_CMPLX_ARG(x)
static char get_job(bool noperm, bool noscal)
#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
aepbalance(const Matrix &a, bool noperm, bool noscal)
Matrix balancing_matrix(void) const
octave_f77_int_type F77_INT
void scale(Matrix &m, double x, double y, double z)