Function: math-det-raw
math-det-raw is a byte-compiled function defined in calc-mtx.el.gz.
Signature
(math-det-raw M)
Source Code
;; Defined in /usr/src/emacs/lisp/calc/calc-mtx.el.gz
(defun math-det-raw (m)
(let ((n (1- (length m))))
(cond ((= n 1)
(nth 1 (nth 1 m)))
((= n 2)
(math-sub (math-mul (nth 1 (nth 1 m))
(nth 2 (nth 2 m)))
(math-mul (nth 2 (nth 1 m))
(nth 1 (nth 2 m)))))
((= n 3)
(math-sub
(math-sub
(math-sub
(math-add
(math-add
(math-mul (nth 1 (nth 1 m))
(math-mul (nth 2 (nth 2 m))
(nth 3 (nth 3 m))))
(math-mul (nth 2 (nth 1 m))
(math-mul (nth 3 (nth 2 m))
(nth 1 (nth 3 m)))))
(math-mul (nth 3 (nth 1 m))
(math-mul (nth 1 (nth 2 m))
(nth 2 (nth 3 m)))))
(math-mul (nth 3 (nth 1 m))
(math-mul (nth 2 (nth 2 m))
(nth 1 (nth 3 m)))))
(math-mul (nth 1 (nth 1 m))
(math-mul (nth 3 (nth 2 m))
(nth 2 (nth 3 m)))))
(math-mul (nth 2 (nth 1 m))
(math-mul (nth 1 (nth 2 m))
(nth 3 (nth 3 m))))))
(t (let ((lud (math-matrix-lud m)))
(if lud
(let ((math-det-lu (car lud)))
(math-det-step n (nth 2 lud)))
0))))))