1 |
;; Calculator for GNU Emacs, part II [calc-mat.el] |
;;; calc-mtx.el --- matrix functions for Calc |
2 |
|
|
3 |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
4 |
;; Written by Dave Gillespie, daveg@synaptics.com. |
|
5 |
|
;; Author: David Gillespie <daveg@synaptics.com> |
6 |
|
;; Maintainer: Colin Walters <walters@debian.org> |
7 |
|
|
8 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
9 |
|
|
22 |
;; file named COPYING. Among other things, the copyright notice |
;; file named COPYING. Among other things, the copyright notice |
23 |
;; and this notice must be preserved on all copies. |
;; and this notice must be preserved on all copies. |
24 |
|
|
25 |
|
;;; Commentary: |
26 |
|
|
27 |
|
;;; Code: |
28 |
|
|
29 |
|
|
30 |
;; This file is autoloaded from calc-ext.el. |
;; This file is autoloaded from calc-ext.el. |
221 |
|
|
222 |
;;; This returns a list (LU index d), or NIL if not possible. |
;;; This returns a list (LU index d), or NIL if not possible. |
223 |
;;; Argument M must be a square matrix. |
;;; Argument M must be a square matrix. |
224 |
|
(defvar math-lud-cache nil) |
225 |
(defun math-matrix-lud (m) |
(defun math-matrix-lud (m) |
226 |
(let ((old (assoc m math-lud-cache)) |
(let ((old (assoc m math-lud-cache)) |
227 |
(context (list calc-internal-prec calc-prefer-frac))) |
(context (list calc-internal-prec calc-prefer-frac))) |
233 |
(setcdr old entry) |
(setcdr old entry) |
234 |
(setq math-lud-cache (cons (cons m entry) math-lud-cache))) |
(setq math-lud-cache (cons (cons m entry) math-lud-cache))) |
235 |
lud)))) |
lud)))) |
|
(defvar math-lud-cache nil) |
|
236 |
|
|
237 |
;;; Numerical Recipes section 2.3; implicit pivoting omitted. |
;;; Numerical Recipes section 2.3; implicit pivoting omitted. |
238 |
(defun math-do-matrix-lud (m) |
(defun math-do-matrix-lud (m) |