26#if defined (HAVE_CONFIG_H)
47select_ana (
const double& a,
const double&)
53select_dig (
const double& a,
const double& b)
55 return (hypot (a, b) < 1.0);
59select_ana (
const float& a,
const float&)
65select_dig (
const float& a,
const float& b)
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')
138 selector = select_ana;
139 else if (ord_char ==
'D' || ord_char ==
'd')
140 selector = select_dig;
153 m_unitary_schur_mat.
clear (n, n);
155 double *s = m_schur_mat.rwdata ();
156 double *q = m_unitary_schur_mat.rwdata ();
159 double *pwr = wr.rwdata ();
162 double *pwi = wi.rwdata ();
165 double *pwork = work.rwdata ();
168 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 : n;
170 F77_INT *pbwork = bwork.rwdata ();
173 F77_INT *piwork = iwork.rwdata ();
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')
226 selector = select_ana;
227 else if (ord_char ==
'D' || ord_char ==
'd')
228 selector = select_dig;
241 m_unitary_schur_mat.
clear (n, n);
243 float *s = m_schur_mat.rwdata ();
244 float *q = m_unitary_schur_mat.rwdata ();
247 float *pwr = wr.rwdata ();
250 float *pwi = wi.rwdata ();
253 float *pwork = work.rwdata ();
256 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 : n;
258 F77_INT *pbwork = bwork.rwdata ();
261 F77_INT *piwork = iwork.rwdata ();
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')
314 selector = select_ana;
315 else if (ord_char ==
'D' || ord_char ==
'd')
316 selector = select_dig;
327 m_unitary_schur_mat.
clear (n, n);
329 Complex *s = m_schur_mat.rwdata ();
330 Complex *q = m_unitary_schur_mat.rwdata ();
333 double *prwork = rwork.
rwdata ();
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)));
368 F77_INT n = to_f77_int (s.rows ());
370 if (s.columns () != n || u.rows () != n || u.columns () != n)
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')
425 selector = select_ana;
426 else if (ord_char ==
'D' || ord_char ==
'd')
427 selector = select_dig;
438 m_unitary_schur_mat.
clear (n, n);
444 float *prwork = rwork.
rwdata ();
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)));
481 F77_INT n = to_f77_int (s.rows ());
483 if (s.columns () != n || u.rows () != n || u.columns () != n)
484 (*current_liboctave_error_handler)
485 (
"rsf2csf: inconsistent matrix dimensions");
510OCTAVE_END_NAMESPACE(math)
511OCTAVE_END_NAMESPACE(octave)
N Dimensional Array with copy-on-write semantics.
octave_idx_type rows() const
octave_idx_type cols() const
T * rwdata()
Size of the specified dimension.
Vector representing the dimensions (size) of an Array.
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
schur< FloatComplexMatrix > rsf2csf< FloatComplexMatrix, FloatMatrix >(const FloatMatrix &s_arg, const FloatMatrix &u_arg)
schur< ComplexMatrix > rsf2csf< ComplexMatrix, Matrix >(const Matrix &s_arg, const Matrix &u_arg)
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 > Complex
std::complex< float > FloatComplex
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
subroutine zrsf2csf(n, t, u, c, s)