26 #if defined (HAVE_CONFIG_H)
37 DEFUN (ordschur, args, ,
82 if (args.length () != 3)
86 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 ()
102 || args(1).is_double_type ();
103 const bool complex_type = args(0).iscomplex ()
104 || args(1).iscomplex ();
106 #define PREPARE_ARGS(TYPE, TYPE_M, TYPE_COND) \
107 TYPE ## Matrix U = args(0).x ## TYPE_M ## _value \
108 ("ordschur: U and S must be real or complex floating point matrices"); \
109 TYPE ## Matrix S = args(1).x ## TYPE_M ## _value \
110 ("ordschur: U and S must be real or complex floating point matrices"); \
111 TYPE ## Matrix w (dim_vector (n, 1)); \
112 TYPE ## Matrix work (dim_vector (n, 1)); \
115 TYPE_COND cond1, cond2;
117 #define PREPARE_OUTPUT() \
119 error ("ordschur: trsen failed"); \
126 sel.
xelem (i) = to_f77_int (sel_arg.
xelem (i));
135 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
151 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
152 sel.
data (),
n, S.fortran_vec (),
n, U.fortran_vec (),
n,
153 w.fortran_vec (),
wi.fortran_vec (),
m, cond1, cond2,
166 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
182 (F77_CONST_CHAR_ARG (
"N"), F77_CONST_CHAR_ARG (
"V"),
183 sel.
data (),
n, S.fortran_vec (),
n, U.fortran_vec (),
n,
184 w.fortran_vec (),
wi.fortran_vec (),
m, cond1, cond2,
192 #undef PREPARE_OUTPUT
OCTARRAY_OVERRIDABLE_FUNC_API const T * data(void) const
Size of the specified dimension.
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type numel(void) const
Number of elements in the array.
OCTARRAY_API T * fortran_vec(void)
Size of the specified dimension.
OCTARRAY_OVERRIDABLE_FUNC_API T & xelem(octave_idx_type n)
Size of the specified dimension.
Vector representing the dimensions (size) of an Array.
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
#define F77_DBLE_CMPLX_ARG(x)
#define F77_XFCN(f, F, args)
octave_f77_int_type F77_INT
std::complex< double > w(std::complex< double > z, double relerr=0)
std::complex< double > Complex
std::complex< float > FloatComplex
#define PREPARE_ARGS(TYPE, TYPE_M, TYPE_COND)