emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calc/calc-arith.el


From: Jay Belanger
Subject: [Emacs-diffs] Changes to emacs/lisp/calc/calc-arith.el
Date: Fri, 07 Oct 2005 17:15:20 -0400

Index: emacs/lisp/calc/calc-arith.el
diff -c emacs/lisp/calc/calc-arith.el:1.15 emacs/lisp/calc/calc-arith.el:1.16
*** emacs/lisp/calc/calc-arith.el:1.15  Thu Jul 14 19:31:59 2005
--- emacs/lisp/calc/calc-arith.el       Fri Oct  7 21:15:19 2005
***************
*** 305,310 ****
--- 305,321 ----
    (and (not (Math-scalarp a))
         (not (math-known-scalarp a t))))
  
+ (defun math-known-square-matrixp (a)
+   (if (eq (car-safe a) '^)
+       (math-known-square-matrixp (nth 1 a))
+     (and (math-known-matrixp a)
+          (or (math-square-matrixp a)
+              (and (or
+                    (integerp calc-matrix-mode)
+                    (eq calc-matrix-mode 'square))
+                   (eq (car-safe a) 'var)
+                   (not (math-const-var a)))))))
+                   
  ;;; Try to prove that A is a scalar (i.e., a non-vector).
  (defun math-check-known-scalarp (a)
    (cond ((Math-objectp a) t)
***************
*** 1869,1874 ****
--- 1880,1900 ----
           (cond ((and math-simplify-only
                       (not (equal a math-simplify-only)))
                  (list '^ a b))
+                  ((and (eq (car-safe a) '*)
+                        (or 
+                         (and
+                          (math-known-matrixp (nth 1 a))
+                          (math-known-matrixp (nth 2 a)))
+                         (and
+                          calc-matrix-mode
+                          (not (eq calc-matrix-mode 'scalar))
+                          (and (not (math-known-scalarp (nth 1 a)))
+                               (not (math-known-scalarp (nth 2 a)))))))
+                   (if (and (= b -1)
+                            (math-known-square-matrixp (nth 1 a))
+                            (math-known-square-matrixp (nth 2 a)))
+                       (list '* (list '^ (nth 2 a) -1) (list '^ (nth 1 a) -1))
+                     (list '^ a b)))
                 ((and (eq (car-safe a) '*)
                       (or (math-known-num-integerp b)
                           (math-known-nonnegp (nth 1 a))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]