26 #if defined (HAVE_CONFIG_H)
47 DEFUN (balance, args, nargout,
92 int nargin = args.length ();
94 if (nargin < 1 || nargin > 3 || nargout < 0)
100 bool AEPcase = nargin == 1 || args(1).is_string ();
105 if (
nn != args(0).columns ())
108 bool isfloat = args(0).is_single_type ()
109 || (! AEPcase && args(1).is_single_type ());
111 bool complex_case = args(0).iscomplex ()
112 || (! AEPcase && args(1).iscomplex ());
123 fcaa = args(0).float_complex_matrix_value ();
125 faa = args(0).float_matrix_value ();
130 caa = args(0).complex_matrix_value ();
132 aa = args(0).matrix_value ();
143 std::string a1s = args(1).string_value ();
144 noperm = a1s ==
"noperm" || a1s ==
"S";
145 noscal = a1s ==
"noscal" || a1s ==
"P";
155 if (nargout == 0 || nargout == 1)
157 else if (nargout == 2)
169 if (nargout == 0 || nargout == 1)
171 else if (nargout == 2)
186 if (nargout == 0 || nargout == 1)
188 else if (nargout == 2)
200 if (nargout == 0 || nargout == 1)
202 else if (nargout == 2)
216 warning (
"balance: used GEP, should have two output arguments");
222 bal_job = args(2).xstring_value (
"balance: OPT argument must be a string");
224 if ((
nn != args(1).columns ()) || (
nn != args(1).rows ()))
235 fcbb = args(1).float_complex_matrix_value ();
237 fbb = args(1).float_matrix_value ();
242 cbb = args(1).complex_matrix_value ();
244 bb = args(1).matrix_value ();
275 error (
"balance: invalid number of output arguments");
304 error (
"balance: invalid number of output arguments");
336 error (
"balance: invalid number of output arguments");
365 error (
"balance: invalid number of output arguments");
VT permuting_vector(void) const
MT balancing_matrix(void) const
VT scaling_vector(void) const
MT balanced_matrix(void) const
T balanced_matrix2(void) const
RT balancing_matrix2(void) const
RT balancing_matrix(void) const
T balanced_matrix(void) const
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void warning(const char *fmt,...)
void error(const char *fmt,...)
void err_square_matrix_required(const char *fcn, const char *name)
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
octave_value::octave_value(const Array< char > &chm, char type) return retval
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.