]> code.delx.au - gnu-emacs/blobdiff - lisp/calc/calc-mtx.el
Add simplification rules for calcFunc-sec, calcFunc-csc, calcFunc-cot,
[gnu-emacs] / lisp / calc / calc-mtx.el
index 0031ca7c8b21e95dd0a1e8db01a5532585148015..6cac30a3bb74a2ac3b5d8c0d900c5484b4376bd7 100644 (file)
@@ -1,6 +1,9 @@
-;; Calculator for GNU Emacs, part II [calc-mat.el]
+;;; calc-mtx.el --- matrix functions for Calc
+
 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
-;; Written by Dave Gillespie, daveg@synaptics.com.
+
+;; Author: David Gillespie <daveg@synaptics.com>
+;; Maintainer: Jay Belanger <belanger@truman.edu>
 
 ;; This file is part of GNU Emacs.
 
 ;; file named COPYING.  Among other things, the copyright notice
 ;; and this notice must be preserved on all copies.
 
+;;; Commentary:
 
+;;; Code:
 
 ;; This file is autoloaded from calc-ext.el.
-(require 'calc-ext)
 
+(require 'calc-ext)
 (require 'calc-macs)
 
-(defun calc-Need-calc-mat () nil)
-
-
 (defun calc-mdet (arg)
   (interactive "P")
   (calc-slow-wrapper
        (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)
                                (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.
+;;; This returns a list (LU index d), or nil if not possible.
 ;;; Argument M must be a square matrix.
+(defvar math-lud-cache nil)
 (defun math-matrix-lud (m)
   (let ((old (assoc m math-lud-cache))
        (context (list calc-internal-prec calc-prefer-frac)))
            (setcdr old entry)
          (setq math-lud-cache (cons (cons m entry) math-lud-cache)))
        lud))))
-(defvar math-lud-cache nil)
 
 ;;; Numerical Recipes section 2.3; implicit pivoting omitted.
 (defun math-do-matrix-lud (m)
          (math-reject-arg m "*Singular matrix"))
     (math-reject-arg m 'square-matrixp)))
 
+(provide 'calc-mtx)
+
+;;; arch-tag: fc0947b1-90e1-4a23-8950-d8ead9c3a306
 ;;; calc-mtx.el ends here