36 DEFUN (eig, args, nargout,
38 @deftypefn {Built-in Function} {@var{lambda} =} eig (@var{A})\n\
39 @deftypefnx {Built-in Function} {@var{lambda} =} eig (@var{A}, @var{B})\n\
40 @deftypefnx {Built-in Function} {[@var{V}, @var{lambda}] =} eig (@var{A})\n\
41 @deftypefnx {Built-in Function} {[@var{V}, @var{lambda}] =} eig (@var{A}, @var{B})\n\
42 Compute the eigenvalues (and optionally the eigenvectors) of a matrix\n\
43 or a pair of matrices\n\
45 The algorithm used depends on whether there are one or two input\n\
46 matrices, if they are real or complex, and if they are symmetric\n\
47 (Hermitian if complex) or non-symmetric.\n\
49 The eigenvalues returned by @code{eig} are not ordered.\n\
50 @seealso{eigs, svd}\n\
55 int nargin = args.
length ();
57 if (nargin > 2 || nargin == 0 || nargout > 2)
66 nr_a = nr_b = nc_a = nc_b = 0;
72 int arg_is_empty =
empty_arg (
"eig", nr_a, nc_a);
75 else if (arg_is_empty > 0)
90 arg_is_empty =
empty_arg (
"eig", nr_b, nc_b);
93 else if (arg_is_empty > 0)
109 if (nargin == 2 && nr_b != nc_b)
133 result =
FloatEIG (ftmp_a, nargout > 1);
142 result =
FloatEIG (fctmp_a, nargout > 1);
145 else if (nargin == 2)
155 result =
FloatEIG (ftmp_a, ftmp_b, nargout > 1);
165 result =
FloatEIG (fctmp_a, fctmp_b, nargout > 1);
171 if (nargout == 0 || nargout == 1)
199 result =
EIG (tmp_a, nargout > 1);
208 result =
EIG (ctmp_a, nargout > 1);
211 else if (nargin == 2)
221 result =
EIG (tmp_a, tmp_b, nargout > 1);
231 result =
EIG (ctmp_a, ctmp_b, nargout > 1);
237 if (nargout == 0 || nargout == 1)
bool is_real_type(void) const
void gripe_wrong_type_arg(const char *name, const char *s, bool is_error)
octave_idx_type rows(void) const
FloatComplexMatrix float_complex_matrix_value(bool frc_str_conv=false) const
OCTINTERP_API void print_usage(void)
octave_idx_type length(void) const
#define DEFUN(name, args_name, nargout_name, doc)
ComplexMatrix eigenvectors(void) const
FloatComplexMatrix eigenvectors(void) const
int empty_arg(const char *, octave_idx_type nr, octave_idx_type nc)
void gripe_square_matrix_required(const char *name)
FloatComplexColumnVector eigenvalues(void) const
F77_RET_T const double const double double * d
ComplexColumnVector eigenvalues(void) const
octave_idx_type columns(void) const
bool is_double_type(void) const
Matrix matrix_value(bool frc_str_conv=false) const
ComplexMatrix complex_matrix_value(bool frc_str_conv=false) const
FloatMatrix float_matrix_value(bool frc_str_conv=false) const
bool is_single_type(void) const