26#if defined (HAVE_CONFIG_H)
46select_ana (
const double& a,
const double&)
52select_dig (
const double& a,
const double& b)
54 return (hypot (a, b) < 1.0);
58select_ana (
const float& a,
const float&)
64select_dig (
const float& a,
const float& b)
66 return (hypot (a, b) < 1.0);
75 return a.real () < 0.0;
82 return (abs (a) < 1.0);
89 return a.real () < 0.0;
96 return (abs (a) < 1.0);
108 (*current_liboctave_error_handler) (
"schur: requires square matrix");
112 m_schur_mat.clear ();
113 m_unitary_schur_mat.clear ();
129 char ord_char = (ord.empty () ?
'U' : ord[0]);
131 if (ord_char ==
'A' || ord_char ==
'D'
132 || ord_char ==
'a' || ord_char ==
'd')
136 if (ord_char ==
'A' || ord_char ==
'a')
137 selector = select_ana;
138 else if (ord_char ==
'D' || ord_char ==
'd')
139 selector = select_dig;
152 m_unitary_schur_mat.
clear (n, n);
154 double *s = m_schur_mat.rwdata ();
155 double *q = m_unitary_schur_mat.rwdata ();
158 double *pwr = wr.rwdata ();
161 double *pwi = wi.rwdata ();
164 double *pwork = work.rwdata ();
167 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 : n;
169 F77_INT *pbwork = bwork.rwdata ();
172 F77_INT *piwork = iwork.rwdata ();
174 F77_XFCN (dgeesx, DGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
175 F77_CONST_CHAR_ARG2 (&sort, 1),
177 F77_CONST_CHAR_ARG2 (&sense, 1),
178 n, s, n, sdim, pwr, pwi, q, n, rconde, rcondv,
179 pwork, lwork, piwork, liwork, pbwork, info
182 F77_CHAR_ARG_LEN (1)));
196 (*current_liboctave_error_handler) (
"SCHUR requires square matrix");
200 m_schur_mat.clear ();
201 m_unitary_schur_mat.clear ();
217 char ord_char = (ord.empty () ?
'U' : ord[0]);
219 if (ord_char ==
'A' || ord_char ==
'D'
220 || ord_char ==
'a' || ord_char ==
'd')
224 if (ord_char ==
'A' || ord_char ==
'a')
225 selector = select_ana;
226 else if (ord_char ==
'D' || ord_char ==
'd')
227 selector = select_dig;
240 m_unitary_schur_mat.
clear (n, n);
242 float *s = m_schur_mat.rwdata ();
243 float *q = m_unitary_schur_mat.rwdata ();
246 float *pwr = wr.rwdata ();
249 float *pwi = wi.rwdata ();
252 float *pwork = work.rwdata ();
255 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 : n;
257 F77_INT *pbwork = bwork.rwdata ();
260 F77_INT *piwork = iwork.rwdata ();
262 F77_XFCN (sgeesx, SGEESX, (F77_CONST_CHAR_ARG2 (&jobvs, 1),
263 F77_CONST_CHAR_ARG2 (&sort, 1),
265 F77_CONST_CHAR_ARG2 (&sense, 1),
266 n, s, n, sdim, pwr, pwi, q, n, rconde, rcondv,
267 pwork, lwork, piwork, liwork, pbwork, info
270 F77_CHAR_ARG_LEN (1)));
284 (*current_liboctave_error_handler) (
"SCHUR requires square matrix");
288 m_schur_mat.clear ();
289 m_unitary_schur_mat.clear ();
305 char ord_char = (ord.empty () ?
'U' : ord[0]);
307 if (ord_char ==
'A' || ord_char ==
'D'
308 || ord_char ==
'a' || ord_char ==
'd')
312 if (ord_char ==
'A' || ord_char ==
'a')
313 selector = select_ana;
314 else if (ord_char ==
'D' || ord_char ==
'd')
315 selector = select_dig;
326 m_unitary_schur_mat.
clear (n, n);
328 Complex *s = m_schur_mat.rwdata ();
329 Complex *q = m_unitary_schur_mat.rwdata ();
332 double *prwork = rwork.
rwdata ();
341 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 : n;
346 (F77_CONST_CHAR_ARG2 (&jobvs, 1),
347 F77_CONST_CHAR_ARG2 (&sort, 1),
349 F77_CONST_CHAR_ARG2 (&sense, 1),
355 F77_CHAR_ARG_LEN (1)));
367 F77_INT n = to_f77_int (s.rows ());
369 if (s.columns () != n || u.rows () != n || u.columns () != n)
370 (*current_liboctave_error_handler)
371 (
"rsf2csf: inconsistent matrix dimensions");
389 const std::string& ord,
bool calc_unitary)
395 (*current_liboctave_error_handler) (
"SCHUR requires square matrix");
399 m_schur_mat.clear ();
400 m_unitary_schur_mat.clear ();
416 char ord_char = (ord.empty () ?
'U' : ord[0]);
418 if (ord_char ==
'A' || ord_char ==
'D'
419 || ord_char ==
'a' || ord_char ==
'd')
423 if (ord_char ==
'A' || ord_char ==
'a')
424 selector = select_ana;
425 else if (ord_char ==
'D' || ord_char ==
'd')
426 selector = select_dig;
437 m_unitary_schur_mat.
clear (n, n);
443 float *prwork = rwork.
rwdata ();
452 F77_INT ntmp = (ord_char ==
'N' || ord_char ==
'n') ? 0 : n;
457 (F77_CONST_CHAR_ARG2 (&jobvs, 1),
458 F77_CONST_CHAR_ARG2 (&sort, 1),
460 F77_CONST_CHAR_ARG2 (&sense, 1),
467 F77_CHAR_ARG_LEN (1)));
480 F77_INT n = to_f77_int (s.rows ());
482 if (s.columns () != n || u.rows () != n || u.columns () != n)
483 (*current_liboctave_error_handler)
484 (
"rsf2csf: inconsistent matrix dimensions");
509OCTAVE_END_NAMESPACE(math)
510OCTAVE_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
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 &)
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)
std::complex< double > Complex
std::complex< float > FloatComplex
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
subroutine zrsf2csf(n, t, u, c, s)