83 if (args.length () != 3)
86 const Array<octave_idx_type> sel_arg = args(2).xoctave_idx_type_vector_value (
"ordschur: SELECT must be an array of integers");
94 error (
"ordschur: SELECT must have same length as the sides of U and S");
95 else if (sel_n != dimU(0) || sel_n != dimS(0) || sel_n != dimU(1)
97 error (
"ordschur: U and S must be square and of equal sizes");
101 const bool double_type = args(0).is_double_type () || args(1).is_double_type ();
102 const bool complex_type = args(0).iscomplex () || args(1).iscomplex ();
104#define PREPARE_ARGS(TYPE, TYPE_M, TYPE_COND) \
105 TYPE ## Matrix U = args(0).x ## TYPE_M ## _value \
106 ("ordschur: U and S must be real or complex floating point matrices"); \
107 TYPE ## Matrix S = args(1).x ## TYPE_M ## _value \
108 ("ordschur: U and S must be real or complex floating point matrices"); \
109 TYPE ## Matrix w (dim_vector (n, 1)); \
110 TYPE ## Matrix work (dim_vector (n, 1)); \
113 TYPE_COND cond1, cond2;
115#define PREPARE_OUTPUT() \
117 error ("ordschur: trsen failed"); \
121 F77_INT n = to_f77_int (sel_n);
123 for (
F77_INT i = 0; i < n; i++)
124 sel.
xelem (i) = to_f77_int (sel_arg.
xelem (i));
133 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
138 F77_CHAR_ARG_LEN (1) F77_CHAR_ARG_LEN (1)));
149 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
150 sel.
data (), n, S.rwdata (), n, U.rwdata (), n,
151 w.rwdata (), wi.
rwdata (), m, cond1, cond2,
152 work.rwdata (), n, iwork.
rwdata (), n, info
153 F77_CHAR_ARG_LEN (1) F77_CHAR_ARG_LEN (1)));
165 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
170 F77_CHAR_ARG_LEN (1) F77_CHAR_ARG_LEN (1)));
181 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
182 sel.
data (), n, S.rwdata (), n, U.rwdata (), n,
183 w.rwdata (), wi.
rwdata (), m, cond1, cond2,
184 work.rwdata (), n, iwork.
rwdata (), n, info
185 F77_CHAR_ARG_LEN (1) F77_CHAR_ARG_LEN (1)));
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.