Function: math-check-known-square-matrixp

math-check-known-square-matrixp is a byte-compiled function defined in calc-arith.el.gz.

Signature

(math-check-known-square-matrixp A)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-arith.el.gz
;;; Given that A is a matrix, try to prove that it is a square matrix.
(defun math-check-known-square-matrixp (a)
  (cond ((math-square-matrixp a)
         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)
                             math-decls-all)
                       (assq (car a) math-decls-cache)))
               val)
           (cond
            ((memq 'sqmatrix (nth 1 decl))
             t)
            ((and (eq (car a) 'var)
                  (boundp (nth 2 a))
                  (setq val (symbol-value (nth 2 a))))
             (math-check-known-square-matrixp val))
            ((and (or
                   (integerp calc-matrix-mode)
                   (eq calc-matrix-mode 'sqmatrix))
                  (eq (car-safe a) 'var))
             t)
            ((memq 'matrix (nth 1 decl))
             nil)
            (t
             nil))))))