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);
109 (*current_liboctave_error_handler) (
"schur: requires square matrix");
113 m_schur_mat.clear ();
114 m_unitary_schur_mat.clear ();
130 char ord_char = (ord.empty () ?
'U' : ord[0]);
132 if (ord_char ==
'A' || ord_char ==
'D'
133 || ord_char ==
'a' || ord_char ==
'd')
137 if (ord_char ==
'A' || ord_char ==
'a')
139 else if (ord_char ==
'D' || ord_char ==
'd')
153 m_unitary_schur_mat.
clear (
n,
n);
155 double *s = m_schur_mat.fortran_vec ();
156 double *q = m_unitary_schur_mat.fortran_vec ();
162 double *pwi =
wi.fortran_vec ();
168 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 :
n;
175 F77_XFCN (dgeesx, DGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
176 F77_CONST_CHAR_ARG2 (&sort, 1),
178 F77_CONST_CHAR_ARG2 (&sense, 1),
179 n, s,
n, sdim, pwr, pwi, q,
n, rconde, rcondv,
180 pwork, lwork, piwork, liwork, pbwork, info
183 F77_CHAR_ARG_LEN (1)));
197 (*current_liboctave_error_handler) (
"SCHUR requires square matrix");
201 m_schur_mat.clear ();
202 m_unitary_schur_mat.clear ();
218 char ord_char = (ord.empty () ?
'U' : ord[0]);
220 if (ord_char ==
'A' || ord_char ==
'D'
221 || ord_char ==
'a' || ord_char ==
'd')
225 if (ord_char ==
'A' || ord_char ==
'a')
227 else if (ord_char ==
'D' || ord_char ==
'd')
241 m_unitary_schur_mat.
clear (
n,
n);
243 float *s = m_schur_mat.fortran_vec ();
244 float *q = m_unitary_schur_mat.fortran_vec ();
250 float *pwi =
wi.fortran_vec ();
256 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 :
n;
263 F77_XFCN (sgeesx, SGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
264 F77_CONST_CHAR_ARG2 (&sort, 1),
266 F77_CONST_CHAR_ARG2 (&sense, 1),
267 n, s,
n, sdim, pwr, pwi, q,
n, rconde, rcondv,
268 pwork, lwork, piwork, liwork, pbwork, info
271 F77_CHAR_ARG_LEN (1)));
285 (*current_liboctave_error_handler) (
"SCHUR requires square matrix");
289 m_schur_mat.clear ();
290 m_unitary_schur_mat.clear ();
306 char ord_char = (ord.empty () ?
'U' : ord[0]);
308 if (ord_char ==
'A' || ord_char ==
'D'
309 || ord_char ==
'a' || ord_char ==
'd')
313 if (ord_char ==
'A' || ord_char ==
'a')
315 else if (ord_char ==
'D' || ord_char ==
'd')
327 m_unitary_schur_mat.
clear (
n,
n);
329 Complex *s = m_schur_mat.fortran_vec ();
330 Complex *q = m_unitary_schur_mat.fortran_vec ();
342 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 :
n;
347 (F77_CONST_CHAR_ARG2 (&jobvs, 1),
348 F77_CONST_CHAR_ARG2 (&sort, 1),
350 F77_CONST_CHAR_ARG2 (&sense, 1),
356 F77_CHAR_ARG_LEN (1)));
371 (*current_liboctave_error_handler)
372 (
"rsf2csf: inconsistent matrix dimensions");
390 const std::string& ord,
bool calc_unitary)
396 (*current_liboctave_error_handler) (
"SCHUR requires square matrix");
400 m_schur_mat.clear ();
401 m_unitary_schur_mat.clear ();
417 char ord_char = (ord.empty () ?
'U' : ord[0]);
419 if (ord_char ==
'A' || ord_char ==
'D'
420 || ord_char ==
'a' || ord_char ==
'd')
424 if (ord_char ==
'A' || ord_char ==
'a')
426 else if (ord_char ==
'D' || ord_char ==
'd')
438 m_unitary_schur_mat.
clear (
n,
n);
453 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 :
n;
458 (F77_CONST_CHAR_ARG2 (&jobvs, 1),
459 F77_CONST_CHAR_ARG2 (&sort, 1),
461 F77_CONST_CHAR_ARG2 (&sense, 1),
468 F77_CHAR_ARG_LEN (1)));
484 (*current_liboctave_error_handler)
485 (
"rsf2csf: inconsistent matrix dimensions");
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type columns(void) const
OCTARRAY_API void clear(void)
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type rows(void) const
OCTARRAY_API T * fortran_vec(void)
Size of the specified dimension.
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type cols(void) const
Vector representing the dimensions (size) of an Array.
OCTAVE_API octave_f77_int_type init(const T &a, const std::string &ord, bool calc_unitary)
subroutine crsf2csf(n, t, u, c, s)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define F77_DBLE_CMPLX_ARG(x)
#define F77_XFCN(f, F, args)
double _Complex F77_DBLE_CMPLX
octave_f77_int_type F77_INT
OCTAVE_API schur< FloatComplexMatrix > rsf2csf< FloatComplexMatrix, FloatMatrix >(const FloatMatrix &s_arg, const FloatMatrix &u_arg)
static F77_INT select_dig(const double &a, const double &b)
OCTAVE_API schur< ComplexMatrix > rsf2csf< ComplexMatrix, Matrix >(const Matrix &s_arg, const Matrix &u_arg)
static F77_INT select_ana(const double &a, const double &)
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)
std::complex< double > Complex
std::complex< float > FloatComplex
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
subroutine zrsf2csf(n, t, u, c, s)