26 #if defined (HAVE_CONFIG_H)
45 return noperm ? (noscal ?
'N' :
'S') : (noscal ?
'P' :
'B');
52 : balanced_mat (a),
scale (), ilo (), ihi (),
58 (*current_liboctave_error_handler)
59 (
"aepbalance: requires square matrix");
65 F77_XFCN (dgebal, DGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
n,
66 balanced_mat.fortran_vec (),
n,
67 t_ilo, t_ihi,
scale.fortran_vec (), info
68 F77_CHAR_ARG_LEN (1)));
78 F77_INT n = to_f77_int (balanced_mat.rows ());
82 balancing_mat.
elem (i ,i) = 1.0;
85 F77_INT t_ilo = to_f77_int (ilo);
86 F77_INT t_ihi = to_f77_int (ihi);
90 F77_XFCN (dgebak, DGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
91 F77_CONST_CHAR_ARG2 (&side, 1),
92 n, t_ilo, t_ihi,
scale.data (),
n,
95 F77_CHAR_ARG_LEN (1)));
103 : balanced_mat (a),
scale (), ilo (), ihi (),
109 (*current_liboctave_error_handler)
110 (
"aepbalance: requires square matrix");
116 F77_XFCN (sgebal, SGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
n,
117 balanced_mat.fortran_vec (),
n, t_ilo,
118 t_ihi,
scale.fortran_vec (), info
119 F77_CHAR_ARG_LEN (1)));
129 F77_INT n = to_f77_int (balanced_mat.rows ());
133 balancing_mat.
elem (i,i) = 1.0;
136 F77_INT t_ilo = to_f77_int (ilo);
137 F77_INT t_ihi = to_f77_int (ihi);
141 F77_XFCN (sgebak, SGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
142 F77_CONST_CHAR_ARG2 (&side, 1),
143 n, t_ilo, t_ihi,
scale.data (),
n,
146 F77_CHAR_ARG_LEN (1)));
148 return balancing_mat;
154 : balanced_mat (a),
scale (), ilo (), ihi (),
160 (*current_liboctave_error_handler)
161 (
"aepbalance: requires square matrix");
167 F77_XFCN (zgebal, ZGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
n,
169 n, t_ilo, t_ihi,
scale.fortran_vec (), info
170 F77_CHAR_ARG_LEN (1)));
180 F77_INT n = to_f77_int (balanced_mat.rows ());
184 balancing_mat.
elem (i, i) = 1.0;
187 F77_INT t_ilo = to_f77_int (ilo);
188 F77_INT t_ihi = to_f77_int (ihi);
192 F77_XFCN (zgebak, ZGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
193 F77_CONST_CHAR_ARG2 (&side, 1),
194 n, t_ilo, t_ihi,
scale.data (),
n,
198 F77_CHAR_ARG_LEN (1)));
200 return balancing_mat;
205 bool noperm,
bool noscal)
206 : balanced_mat (a),
scale (), ilo (), ihi (),
212 (*current_liboctave_error_handler)
213 (
"aepbalance: requires square matrix");
219 F77_XFCN (cgebal, CGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
n,
221 n, t_ilo, t_ihi,
scale.fortran_vec (), info
222 F77_CHAR_ARG_LEN (1)));
232 F77_INT n = to_f77_int (balanced_mat.rows ());
236 balancing_mat.
elem (i, i) = 1.0;
239 F77_INT t_ilo = to_f77_int (ilo);
240 F77_INT t_ihi = to_f77_int (ihi);
244 F77_XFCN (cgebak, CGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
245 F77_CONST_CHAR_ARG2 (&side, 1),
246 n, t_ilo, t_ihi,
scale.data (),
n,
250 F77_CHAR_ARG_LEN (1)));
252 return balancing_mat;
T & elem(octave_idx_type n)
Size of the specified dimension.
octave_idx_type cols(void) const
octave_idx_type rows(void) const
const T * fortran_vec(void) const
Size of the specified dimension.
Matrix balancing_matrix(void) const
aepbalance(const Matrix &a, bool noperm, bool noscal)
#define F77_DBLE_CMPLX_ARG(x)
#define F77_XFCN(f, F, args)
octave_f77_int_type F77_INT
void scale(Matrix &m, double x, double y, double z)
static char get_job(bool noperm, bool noscal)