/[emacs]/emacs/lisp/calc/calc-mtx.el
ViewVC logotype

Diff of /emacs/lisp/calc/calc-mtx.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by miles, Mon Sep 1 15:45:18 2003 UTC revision 1.8 by jpb, Fri Nov 26 22:36:10 2004 UTC
# Line 3  Line 3 
3  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
4    
5  ;; Author: David Gillespie <daveg@synaptics.com>  ;; Author: David Gillespie <daveg@synaptics.com>
6  ;; Maintainers: D. Goel <deego@gnufans.org>  ;; Maintainer: Jay Belanger <belanger@truman.edu>
 ;;              Colin Walters <walters@debian.org>  
7    
8  ;; This file is part of GNU Emacs.  ;; This file is part of GNU Emacs.
9    
# Line 176  Line 175 
175          (nth 1 m)          (nth 1 m)
176        (math-reject-arg m 'square-matrixp))))        (math-reject-arg m 'square-matrixp))))
177    
178    ;; The variable math-det-lu is local to math-det-raw, but is
179    ;; used by math-det-step, which is called by math-det-raw.
180    (defvar math-det-lu)
181    
182  (defun math-det-raw (m)  (defun math-det-raw (m)
183    (let ((n (1- (length m))))    (let ((n (1- (length m))))
184      (cond ((= n 1)      (cond ((= n 1)
# Line 211  Line 214 
214                                  (nth 3 (nth 3 m))))))                                  (nth 3 (nth 3 m))))))
215            (t (let ((lud (math-matrix-lud m)))            (t (let ((lud (math-matrix-lud m)))
216                 (if lud                 (if lud
217                     (let ((lu (car lud)))                     (let ((math-det-lu (car lud)))
218                       (math-det-step n (nth 2 lud)))                       (math-det-step n (nth 2 lud)))
219                   0))))))                   0))))))
220    
221  (defun math-det-step (n prod)  (defun math-det-step (n prod)
222    (if (> n 0)    (if (> n 0)
223        (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))))
224      prod))      prod))
225    
226  ;;; This returns a list (LU index d), or nil if not possible.  ;;; This returns a list (LU index d), or nil if not possible.

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26