
(/VERSIONCHECK 2) 

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

(DEFUN |CharacteristicPolynomialPackage| (#1=#:G1808)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1809)
       (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 17) . #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 . |ncols|) (5 . |zero|) (|Integer|) (11 . |elt|)
              (18 . |setelt|) (26 . -) (32 . |determinant|)
              |CHARPOL;characteristicPolynomial;M2R;1|)
           '#(|characteristicPolynomial| 37) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 16
                                                 '(1 8 7 0 9 2 8 0 7 7 10 3 8 6
                                                   0 11 11 12 4 8 6 0 11 11 6
                                                   13 2 6 0 0 0 14 1 8 6 0 15 2
                                                   0 6 8 6 16)))))
           '|lookupComplete|)) 
