
(/VERSIONCHECK 2) 

(DEFUN |CHARPOL;characteristicPolynomial;M2R;1| (A |v| $)
  (PROG (|j| |i| B |dimA| #1=#:G663)
    (RETURN
     (SEQ
      (LETT |dimA|
            (PROG1
                (LETT #1# (SPADCALL A (QREFELT $ 9))
                      . #2=(|CHARPOL;characteristicPolynomial;M2R;1|))
              (|check-subtype| (> #1# 0) '(|PositiveInteger|) #1#))
            . #2#)
      (COND
       ((NULL (EQL |dimA| (SPADCALL A (QREFELT $ 10))))
        (EXIT (|error| " The matrix is not square"))))
      (LETT B (SPADCALL |dimA| |dimA| (QREFELT $ 11)) . #2#)
      (SEQ (LETT |i| 1 . #2#) G190
           (COND ((QSGREATERP |i| |dimA|) #3=(GO G191)))
           (SEQ
            (SEQ (LETT |j| 1 . #2#) G190 (COND ((QSGREATERP |j| |dimA|) #3#))
                 (SEQ
                  (EXIT
                   (SPADCALL B |i| |j| (SPADCALL A |i| |j| (QREFELT $ 13))
                             (QREFELT $ 14))))
                 (LETT |j| (QSADD1 |j|) . #2#) #4=(GO G190) G191 (EXIT NIL))
            (EXIT
             (SPADCALL B |i| |i|
                       (SPADCALL (SPADCALL B |i| |i| (QREFELT $ 13)) |v|
                                 (QREFELT $ 15))
                       (QREFELT $ 14))))
           (LETT |i| (QSADD1 |i|) . #2#) #4# G191 (EXIT NIL))
      (EXIT (SPADCALL B (QREFELT $ 16))))))) 

(DEFUN |CharacteristicPolynomialPackage| (#1=#:G670)
  (PROG ()
    (RETURN
     (PROG (#2=#:G671)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (LIST (|devaluate| #1#))
                                           (HGET |$ConstructorCache|
                                                 '|CharacteristicPolynomialPackage|)
                                           '|domainEqualList|)
                . #3=(|CharacteristicPolynomialPackage|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT
              (PROG1 (|CharacteristicPolynomialPackage;| #1#)
                (LETT #2# T . #3#))
            (COND
             ((NOT #2#)
              (HREM |$ConstructorCache|
                    '|CharacteristicPolynomialPackage|))))))))))) 

(DEFUN |CharacteristicPolynomialPackage;| (|#1|)
  (PROG (|pv$| $ |dv$| DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|CharacteristicPolynomialPackage|))
      (LETT |dv$| (LIST '|CharacteristicPolynomialPackage| DV$1) . #1#)
      (LETT $ (GETREFV 18) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|CharacteristicPolynomialPackage|
                  (LIST DV$1) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      $)))) 

(MAKEPROP '|CharacteristicPolynomialPackage| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|NonNegativeInteger|)
              (|Matrix| 6) (0 . |nrows|) (5 . |ncols|) (10 . |zero|)
              (|Integer|) (16 . |elt|) (23 . |setelt|) (31 . -)
              (37 . |determinant|) |CHARPOL;characteristicPolynomial;M2R;1|)
           '#(|characteristicPolynomial| 42) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 17
                                                 '(1 8 7 0 9 1 8 7 0 10 2 8 0 7
                                                   7 11 3 8 6 0 12 12 13 4 8 6
                                                   0 12 12 6 14 2 6 0 0 0 15 1
                                                   8 6 0 16 2 0 6 8 6 17)))))
           '|lookupComplete|)) 
