]> git.eshelyaron.com Git - emacs.git/commitdiff
(math-pow-fancy): Further expand product of square matrices.
authorJay Belanger <jay.p.belanger@gmail.com>
Wed, 9 Nov 2005 19:27:29 +0000 (19:27 +0000)
committerJay Belanger <jay.p.belanger@gmail.com>
Wed, 9 Nov 2005 19:27:29 +0000 (19:27 +0000)
(math-check-known-square-matrixp): Do a more extensive check for
square matrices.

lisp/calc/calc-arith.el

index f8057c5f1b92180352ac8e55cc72a08ba27977bf..ba95ee7f713a5def3eaa536650e87bba16563c55 100644 (file)
          t)
         ((eq (car-safe a) '^)
          (math-check-known-square-matrixp (nth 1 a)))
+        ((or
+          (eq (car-safe a) '*)
+          (eq (car-safe a) '+)
+          (eq (car-safe a) '-))
+         (and
+          (math-check-known-square-matrixp (nth 1 a))
+          (math-check-known-square-matrixp (nth 2 a))))
         (t
          (let ((decl (if (eq (car a) 'var)
                          (or (assq (nth 2 a) math-decls-cache)
                   (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))
+                      (math-mul (math-pow-fancy (nth 2 a) -1) 
+                                (math-pow-fancy (nth 1 a) -1))
                     (list '^ a b)))
                 ((and (eq (car-safe a) '*)
                       (or (math-known-num-integerp b)