46 #define MAYBE_CAST(VAR, CLASS) \
47 const CLASS *VAR = arg.type_id () == CLASS::static_type_id () ? \
48 dynamic_cast<const CLASS *> (&arg.get_rep ()) : 0
50 DEFUN (det, args, nargout,
52 @deftypefn {Built-in Function} {} det (@var{A})\n\
53 @deftypefnx {Built-in Function} {[@var{d}, @var{rcond}] =} det (@var{A})\n\
54 Compute the determinant of @var{A}.\n\
56 Return an estimate of the reciprocal condition number if requested.\n\
58 Routines from @sc{lapack} are used for full matrices and code from\n\
59 @sc{umfpack} is used for sparse matrices.\n\
61 The determinant should not be used to check a matrix for singularity.\n\
62 For that, use any of the condition number functions: @code{cond},\n\
63 @code{condest}, @code{rcond}.\n\
64 @seealso{cond, condest, rcond}\n\
69 int nargin = args.
length ();
82 if (nr == 0 && nc == 0)
88 int arg_is_empty =
empty_arg (
"det", nr, nc);
160 retval(0) = info == -1 ?
static_cast<float>(0.0) : det.
value ();
161 if (rep) rep->matrix_type (mtype);
178 if (rep) rep->matrix_type (mtype);
197 retval(0) = info == -1 ? 0.0 : det.
value ();
206 MatrixType mtype = rep ? rep -> matrix_type ()
210 retval(0) = info == -1 ? 0.0 : det.
value ();
211 if (rep) rep->matrix_type (mtype);
237 MatrixType mtype = rep ? rep -> matrix_type ()
242 if (rep) rep->matrix_type (mtype);