26 #if defined (HAVE_CONFIG_H)
55 return (hypot (a, b) < 1.0);
67 return (hypot (a, b) < 1.0);
76 return a.real () < 0.0;
83 return (
abs (a) < 1.0);
90 return a.real () < 0.0;
97 return (
abs (a) < 1.0);
108 (*current_liboctave_error_handler) (
"schur: requires square matrix");
113 unitary_mat.clear ();
129 char ord_char = (ord.empty () ?
'U' : ord[0]);
131 if (ord_char ==
'A' || ord_char ==
'D' || ord_char ==
'a' || ord_char ==
'd')
135 if (ord_char ==
'A' || ord_char ==
'a')
137 else if (ord_char ==
'D' || ord_char ==
'd')
153 double *s = schur_mat.fortran_vec ();
154 double *q = unitary_mat.fortran_vec ();
160 double *pwi =
wi.fortran_vec ();
166 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 :
n;
173 F77_XFCN (dgeesx, DGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
174 F77_CONST_CHAR_ARG2 (&sort, 1),
176 F77_CONST_CHAR_ARG2 (&sense, 1),
177 n, s,
n, sdim, pwr, pwi, q,
n, rconde, rcondv,
178 pwork, lwork, piwork, liwork, pbwork, info
181 F77_CHAR_ARG_LEN (1)));
195 (*current_liboctave_error_handler) (
"SCHUR requires square matrix");
200 unitary_mat.clear ();
216 char ord_char = (ord.empty () ?
'U' : ord[0]);
218 if (ord_char ==
'A' || ord_char ==
'D' || ord_char ==
'a' || ord_char ==
'd')
222 if (ord_char ==
'A' || ord_char ==
'a')
224 else if (ord_char ==
'D' || ord_char ==
'd')
240 float *s = schur_mat.fortran_vec ();
241 float *q = unitary_mat.fortran_vec ();
247 float *pwi =
wi.fortran_vec ();
253 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 :
n;
260 F77_XFCN (sgeesx, SGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
261 F77_CONST_CHAR_ARG2 (&sort, 1),
263 F77_CONST_CHAR_ARG2 (&sense, 1),
264 n, s,
n, sdim, pwr, pwi, q,
n, rconde, rcondv,
265 pwork, lwork, piwork, liwork, pbwork, info
268 F77_CHAR_ARG_LEN (1)));
282 (*current_liboctave_error_handler) (
"SCHUR requires square matrix");
287 unitary_mat.clear ();
303 char ord_char = (ord.empty () ?
'U' : ord[0]);
305 if (ord_char ==
'A' || ord_char ==
'D' || ord_char ==
'a' || ord_char ==
'd')
309 if (ord_char ==
'A' || ord_char ==
'a')
311 else if (ord_char ==
'D' || ord_char ==
'd')
325 Complex *s = schur_mat.fortran_vec ();
326 Complex *q = unitary_mat.fortran_vec ();
338 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 :
n;
342 F77_XFCN (zgeesx, ZGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
343 F77_CONST_CHAR_ARG2 (&sort, 1),
345 F77_CONST_CHAR_ARG2 (&sense, 1),
351 F77_CHAR_ARG_LEN (1)));
365 if (s.columns () !=
n || u.rows () !=
n || u.columns () !=
n)
366 (*current_liboctave_error_handler)
367 (
"rsf2csf: inconsistent matrix dimensions");
384 const std::string& ord,
bool calc_unitary)
390 (*current_liboctave_error_handler) (
"SCHUR requires square matrix");
395 unitary_mat.clear ();
411 char ord_char = (ord.empty () ?
'U' : ord[0]);
413 if (ord_char ==
'A' || ord_char ==
'D' || ord_char ==
'a' || ord_char ==
'd')
417 if (ord_char ==
'A' || ord_char ==
'a')
419 else if (ord_char ==
'D' || ord_char ==
'd')
446 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 :
n;
450 F77_XFCN (cgeesx, CGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
451 F77_CONST_CHAR_ARG2 (&sort, 1),
453 F77_CONST_CHAR_ARG2 (&sense, 1),
459 F77_CHAR_ARG_LEN (1)));
474 if (s.columns () !=
n || u.rows () !=
n || u.columns () !=
n)
475 (*current_liboctave_error_handler)
476 (
"rsf2csf: inconsistent matrix dimensions");
octave_idx_type cols(void) const
octave_idx_type rows(void) const
const T * fortran_vec(void) const
Size of the specified dimension.
Vector representing the dimensions (size) of an Array.
octave_f77_int_type init(const T &a, const std::string &ord, bool calc_unitary)
subroutine crsf2csf(n, t, u, c, s)
#define F77_DBLE_CMPLX_ARG(x)
#define F77_XFCN(f, F, args)
double _Complex F77_DBLE_CMPLX
octave_f77_int_type F77_INT
F77_INT(* float_complex_selector)(const F77_CMPLX &)
F77_INT(* float_selector)(const F77_REAL &, const F77_REAL &)
F77_INT(* double_selector)(const F77_DBLE &, const F77_DBLE &)
F77_INT(* complex_selector)(const F77_DBLE_CMPLX &)
std::complex< double > w(std::complex< double > z, double relerr=0)
schur< FloatComplexMatrix > rsf2csf< FloatComplexMatrix, FloatMatrix >(const FloatMatrix &s_arg, const FloatMatrix &u_arg)
static F77_INT select_dig(const double &a, const double &b)
static F77_INT select_ana(const double &a, const double &)
schur< ComplexMatrix > rsf2csf< ComplexMatrix, Matrix >(const Matrix &s_arg, const Matrix &u_arg)
std::complex< double > Complex
std::complex< float > FloatComplex
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
subroutine zrsf2csf(n, t, u, c, s)