23 #if defined (HAVE_CONFIG_H) 32 DEFUN (ordschur, args, ,
77 if (args.length () != 3)
80 const Array<octave_idx_type> sel_arg = args(2).octave_idx_type_vector_value (
"ordschur: SELECT must be an array of integers");
88 error (
"ordschur: SELECT must have same length as the sides of U and S");
89 else if (sel_n != dimU(0) || sel_n != dimS(0) || sel_n != dimU(1)
91 error (
"ordschur: U and S must be square and of equal sizes");
96 || args(1).is_double_type ();
97 const bool complex_type = args(0).iscomplex ()
98 || args(1).iscomplex ();
100 #define PREPARE_ARGS(TYPE, TYPE_M, TYPE_COND) \ 101 TYPE ## Matrix U = args(0).x ## TYPE_M ## _value \ 102 ("ordschur: U and S must be real or complex floating point matrices"); \ 103 TYPE ## Matrix S = args(1).x ## TYPE_M ## _value \ 104 ("ordschur: U and S must be real or complex floating point matrices"); \ 105 TYPE ## Matrix w (dim_vector (n, 1)); \ 106 TYPE ## Matrix work (dim_vector (n, 1)); \ 109 TYPE_COND cond1, cond2; 111 #define PREPARE_OUTPUT() \ 113 error ("ordschur: trsen failed"); \ 117 F77_INT n = octave::to_f77_int (sel_n);
129 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
145 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
146 sel.
data (), n, S.fortran_vec (), n, U.fortran_vec (), n,
147 w.fortran_vec (),
wi.fortran_vec (), m, cond1, cond2,
148 work.fortran_vec (), n, iwork.
fortran_vec (), n, info));
160 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
176 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
177 sel.
data (), n, S.fortran_vec (), n, U.fortran_vec (), n,
178 w.fortran_vec (),
wi.fortran_vec (), m, cond1, cond2,
179 work.fortran_vec (), n, iwork.
fortran_vec (), n, info));
186 #undef PREPARE_OUTPUT #define PREPARE_ARGS(TYPE, TYPE_M, TYPE_COND)
characters Given a string matrix
const T * data(void) const
OCTINTERP_API void print_usage(void)
#define F77_DBLE_CMPLX_ARG(x)
const T * fortran_vec(void) const
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
#define F77_XFCN(f, F, args)
std::complex< double > w(std::complex< double > z, double relerr=0)
T & xelem(octave_idx_type n)
octave_f77_int_type F77_INT
std::complex< float > FloatComplex
bool is_double_type(void) const
std::complex< double > Complex
octave_idx_type numel(void) const
Number of elements in the array.
Vector representing the dimensions (size) of an Array.