
(/VERSIONCHECK 2) 

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

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

(DEFUN |CharacteristicPolynomialPackage;| (|#1|)
  (PROG (DV$1 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|CharacteristicPolynomialPackage|))
        (LETT |dv$|
              (LIST '|CharacteristicPolynomialPackage| DV$1) . #0#)
        (LETT $ (GETREFV 18) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|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|)) 
