26 #if defined (HAVE_CONFIG_H)
48 const std::string& balance_job)
53 (*current_liboctave_error_handler)
54 (
"GEPBALANCE requires square matrix");
68 double *p_balanced_mat = balanced_mat.
fortran_vec ();
70 double *p_balanced_mat2 = balanced_mat2.
fortran_vec ();
72 char job = balance_job[0];
74 F77_XFCN (dggbal, DGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
75 n, p_balanced_mat,
n, p_balanced_mat2,
76 n, ilo, ihi, plscale, prscale, pwork, info
77 F77_CHAR_ARG_LEN (1)));
84 balancing_mat.elem (i,i) = 1.0;
85 balancing_mat2.elem (i,i) = 1.0;
88 double *p_balancing_mat = balancing_mat.fortran_vec ();
89 double *p_balancing_mat2 = balancing_mat2.fortran_vec ();
92 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
93 F77_CONST_CHAR_ARG2 (
"L", 1),
94 n, ilo, ihi, plscale, prscale,
95 n, p_balancing_mat,
n, info
97 F77_CHAR_ARG_LEN (1)));
100 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
101 F77_CONST_CHAR_ARG2 (
"R", 1),
102 n, ilo, ihi, plscale, prscale,
103 n, p_balancing_mat2,
n, info
105 F77_CHAR_ARG_LEN (1)));
113 const std::string& balance_job)
118 (*current_liboctave_error_handler)
119 (
"FloatGEPBALANCE requires square matrix");
134 float *p_balanced_mat = balanced_mat.
fortran_vec ();
136 float *p_balanced_mat2 = balanced_mat2.
fortran_vec ();
138 char job = balance_job[0];
140 F77_XFCN (sggbal, SGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
141 n, p_balanced_mat,
n, p_balanced_mat2,
142 n, ilo, ihi, plscale, prscale, pwork, info
143 F77_CHAR_ARG_LEN (1)));
150 balancing_mat.elem (i,i) = 1.0;
151 balancing_mat2.elem (i,i) = 1.0;
154 float *p_balancing_mat = balancing_mat.fortran_vec ();
155 float *p_balancing_mat2 = balancing_mat2.fortran_vec ();
158 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
159 F77_CONST_CHAR_ARG2 (
"L", 1),
160 n, ilo, ihi, plscale, prscale,
161 n, p_balancing_mat,
n, info
163 F77_CHAR_ARG_LEN (1)));
166 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
167 F77_CONST_CHAR_ARG2 (
"R", 1),
168 n, ilo, ihi, plscale, prscale,
169 n, p_balancing_mat2,
n, info
171 F77_CHAR_ARG_LEN (1)));
180 const std::string& balance_job)
185 (*current_liboctave_error_handler)
186 (
"ComplexGEPBALANCE requires square matrix");
205 char job = balance_job[0];
207 F77_XFCN (zggbal, ZGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
210 n, ilo, ihi, plscale, prscale, pwork, info
211 F77_CHAR_ARG_LEN (1)));
214 balancing_mat2 =
Matrix (
n,
n, 0.0);
218 balancing_mat.elem (i,i) = 1.0;
219 balancing_mat2.elem (i,i) = 1.0;
222 double *p_balancing_mat = balancing_mat.fortran_vec ();
223 double *p_balancing_mat2 = balancing_mat2.fortran_vec ();
226 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
227 F77_CONST_CHAR_ARG2 (
"L", 1),
228 n, ilo, ihi, plscale, prscale,
229 n, p_balancing_mat,
n, info
231 F77_CHAR_ARG_LEN (1)));
234 F77_XFCN (dggbak, DGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
235 F77_CONST_CHAR_ARG2 (
"R", 1),
236 n, ilo, ihi, plscale, prscale,
237 n, p_balancing_mat2,
n, info
239 F77_CHAR_ARG_LEN (1)));
248 const std::string& balance_job)
254 (*current_liboctave_error_handler)
255 (
"FloatComplexGEPBALANCE requires square matrix");
276 char job = balance_job[0];
278 F77_XFCN (cggbal, CGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
281 n, ilo, ihi, plscale, prscale, pwork, info
282 F77_CHAR_ARG_LEN (1)));
289 balancing_mat.elem (i,i) = 1.0;
290 balancing_mat2.elem (i,i) = 1.0;
293 float *p_balancing_mat = balancing_mat.fortran_vec ();
294 float *p_balancing_mat2 = balancing_mat2.fortran_vec ();
297 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
298 F77_CONST_CHAR_ARG2 (
"L", 1),
299 n, ilo, ihi, plscale, prscale,
300 n, p_balancing_mat,
n, info
302 F77_CHAR_ARG_LEN (1)));
305 F77_XFCN (sggbak, SGGBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
306 F77_CONST_CHAR_ARG2 (
"R", 1),
307 n, ilo, ihi, plscale, prscale,
308 n, p_balancing_mat2,
n, info
310 F77_CHAR_ARG_LEN (1)));
octave_idx_type cols(void) const
octave_idx_type rows(void) const
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
const T * fortran_vec(void) const
Size of the specified dimension.
octave_idx_type init(const T &a, const T &b, const std::string &job)
#define F77_DBLE_CMPLX_ARG(x)
#define F77_XFCN(f, F, args)
octave_f77_int_type F77_INT
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
std::complex< double > Complex
std::complex< float > FloatComplex
#define OCTAVE_LOCAL_BUFFER(T, buf, size)