diff options
author | Jay Belanger <jay.p.belanger@gmail.com> | 2004-11-26 22:36:10 +0000 |
---|---|---|
committer | Jay Belanger <jay.p.belanger@gmail.com> | 2004-11-26 22:36:10 +0000 |
commit | 4952f0be950fda61cb64190df16047fb3f84b092 (patch) | |
tree | 53c4234d5355e8b2b813a6efe99bdecc551d80b3 /lisp/calc/calc-mtx.el | |
parent | 3a7a4adb2df59ce876640b4cbb5b2361ead8db21 (diff) | |
download | emacs-4952f0be950fda61cb64190df16047fb3f84b092.tar.gz |
(calc-det-lu): New variable.
(math-det-raw, math-det-step): Replace variable lu by declared
variable.
Diffstat (limited to 'lisp/calc/calc-mtx.el')
-rw-r--r-- | lisp/calc/calc-mtx.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/calc/calc-mtx.el b/lisp/calc/calc-mtx.el index 99442d4d33d..762be985dfa 100644 --- a/lisp/calc/calc-mtx.el +++ b/lisp/calc/calc-mtx.el @@ -3,8 +3,7 @@ ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. ;; Author: David Gillespie <daveg@synaptics.com> -;; Maintainers: D. Goel <deego@gnufans.org> -;; Colin Walters <walters@debian.org> +;; Maintainer: Jay Belanger <belanger@truman.edu> ;; This file is part of GNU Emacs. @@ -176,6 +175,10 @@ (nth 1 m) (math-reject-arg m 'square-matrixp)))) +;; The variable math-det-lu is local to math-det-raw, but is +;; used by math-det-step, which is called by math-det-raw. +(defvar math-det-lu) + (defun math-det-raw (m) (let ((n (1- (length m)))) (cond ((= n 1) @@ -211,13 +214,13 @@ (nth 3 (nth 3 m)))))) (t (let ((lud (math-matrix-lud m))) (if lud - (let ((lu (car lud))) + (let ((math-det-lu (car lud))) (math-det-step n (nth 2 lud))) 0)))))) (defun math-det-step (n prod) (if (> n 0) - (math-det-step (1- n) (math-mul prod (nth n (nth n lu)))) + (math-det-step (1- n) (math-mul prod (nth n (nth n math-det-lu)))) prod)) ;;; This returns a list (LU index d), or nil if not possible. |