
(/VERSIONCHECK 2) 

(DEFUN |SMATCAT-;positivePower| (|x| |n| $)
  (PROG (|y|)
    (RETURN
     (SEQ
      (COND ((EQL |n| 1) |x|)
            ((ODDP |n|)
             (SPADCALL |x| (|SMATCAT-;positivePower| |x| (- |n| 1) $)
                       (QREFELT $ 11)))
            ('T
             (SEQ
              (LETT |y| (|SMATCAT-;positivePower| |x| (QUOTIENT2 |n| 2) $)
                    |SMATCAT-;positivePower|)
              (EXIT (SPADCALL |y| |y| (QREFELT $ 11)))))))))) 

(DEFUN |SMATCAT-;^;SNniS;2| (|x| |n| $)
  (COND ((ZEROP |n|) (SPADCALL (|spadConstant| $ 12) (QREFELT $ 13)))
        ('T (|SMATCAT-;positivePower| |x| |n| $)))) 

(DEFUN |SMATCAT-;coerce;RS;3| (|r| $) (SPADCALL |r| (QREFELT $ 13))) 

(DEFUN |SMATCAT-;differentiate;SMS;4| (|x| |d| $)
  (SPADCALL |d| |x| (QREFELT $ 18))) 

(DEFUN |SMATCAT-;diagonal;SRow;5| (|x| $)
  (PROG (#1=#:G11885 |i| #2=#:G11886 |j| #3=#:G11887 |k| |v|)
    (RETURN
     (SEQ
      (LETT |v| (SPADCALL (QREFELT $ 7) (|spadConstant| $ 20) (QREFELT $ 22))
            . #4=(|SMATCAT-;diagonal;SRow;5|))
      (SEQ (LETT |k| (SPADCALL |v| (QREFELT $ 28)) . #4#)
           (LETT #3# (QVSIZE |v|) . #4#)
           (LETT |j| (SPADCALL |x| (QREFELT $ 26)) . #4#)
           (LETT #2# (SPADCALL |x| (QREFELT $ 27)) . #4#)
           (LETT |i| (SPADCALL |x| (QREFELT $ 24)) . #4#)
           (LETT #1# (SPADCALL |x| (QREFELT $ 25)) . #4#) G190
           (COND ((OR (> |i| #1#) (> |j| #2#) (> |k| #3#)) (GO G191)))
           (SEQ
            (EXIT
             (SPADCALL |v| |k| (SPADCALL |x| |i| |j| (QREFELT $ 29))
                       (QREFELT $ 30))))
           (LETT |i|
                 (PROG1 (+ |i| 1)
                   (LETT |j| (PROG1 (+ |j| 1) (LETT |k| (+ |k| 1) . #4#))
                         . #4#))
                 . #4#)
           (GO G190) G191 (EXIT NIL))
      (EXIT (SPADCALL |v| (QREFELT $ 31))))))) 

(DEFUN |SMATCAT-;retract;SR;6| (|x| $)
  (COND
   ((SPADCALL |x| (QREFELT $ 34))
    (SPADCALL (SPADCALL |x| (QREFELT $ 35)) (QREFELT $ 36)))
   ('T (|error| "Not retractable")))) 

(DEFUN |SMATCAT-;retractIfCan;SU;7| (|x| $)
  (COND
   ((SPADCALL |x| (QREFELT $ 34))
    (SPADCALL (SPADCALL |x| (QREFELT $ 35)) (QREFELT $ 39)))
   ('T (CONS 1 "failed")))) 

(DEFUN |SMATCAT-;equation2R| (|v| $)
  (PROG (#1=#:G11903 |j| #2=#:G11902 |i| |ans|)
    (RETURN
     (SEQ
      (LETT |ans|
            (SPADCALL (QREFELT $ 7) (QVSIZE |v|) (|spadConstant| $ 41)
                      (QREFELT $ 43))
            . #3=(|SMATCAT-;equation2R|))
      (SEQ (LETT |i| (SPADCALL |ans| (QREFELT $ 44)) . #3#)
           (LETT #2# (SPADCALL |ans| (QREFELT $ 45)) . #3#) G190
           (COND ((> |i| #2#) #4=(GO G191)))
           (SEQ
            (EXIT
             (SEQ (LETT |j| (SPADCALL |ans| (QREFELT $ 46)) . #3#)
                  (LETT #1# (SPADCALL |ans| (QREFELT $ 47)) . #3#) G190
                  (COND ((> |j| #1#) #4#))
                  (SEQ
                   (EXIT
                    (SPADCALL |ans| |i| |j|
                              (SPADCALL (SPADCALL |v| |j| (QREFELT $ 49)) |i|
                                        (QREFELT $ 50))
                              (QREFELT $ 51))))
                  (LETT |j| (+ |j| 1) . #3#) #5=(GO G190) G191 (EXIT NIL))))
           (LETT |i| (+ |i| 1) . #3#) #5# G191 (EXIT NIL))
      (EXIT (SPADCALL |ans| (QREFELT $ 54))))))) 

(DEFUN |SMATCAT-;reducedSystem;MM;9| (|x| $)
  (PROG (#1=#:G11910 |i| #2=#:G11909)
    (RETURN
     (SEQ
      (COND
       ((SPADCALL |x| (QREFELT $ 56))
        (SPADCALL 0 0 (|spadConstant| $ 20) (QREFELT $ 57)))
       ('T
        (SPADCALL (ELT $ 58)
                  (PROGN
                   (LETT #2# NIL . #3=(|SMATCAT-;reducedSystem;MM;9|))
                   (SEQ (LETT |i| (SPADCALL |x| (QREFELT $ 59)) . #3#)
                        (LETT #1# (SPADCALL |x| (QREFELT $ 60)) . #3#) G190
                        (COND ((> |i| #1#) (GO G191)))
                        (SEQ
                         (EXIT
                          (LETT #2#
                                (CONS
                                 (|SMATCAT-;equation2R|
                                  (SPADCALL |x| |i| (QREFELT $ 61)) $)
                                 #2#)
                                . #3#)))
                        (LETT |i| (+ |i| 1) . #3#) (GO G190) G191
                        (EXIT (NREVERSE0 #2#))))
                  (QREFELT $ 64)))))))) 

(DEFUN |SMATCAT-;reducedSystem;MVR;10| (|m| |v| $)
  (PROG (|vh| |rh|)
    (RETURN
     (SEQ
      (LETT |vh|
            (COND
             ((SPADCALL |v| (QREFELT $ 66))
              (SPADCALL 0 (|spadConstant| $ 20) (QREFELT $ 22)))
             ('T
              (SEQ
               (LETT |rh|
                     (SPADCALL (SPADCALL |v| (QREFELT $ 67)) (QREFELT $ 68))
                     . #1=(|SMATCAT-;reducedSystem;MVR;10|))
               (EXIT
                (SPADCALL |rh| (SPADCALL |rh| (QREFELT $ 69))
                          (QREFELT $ 70))))))
            . #1#)
      (EXIT (CONS (SPADCALL |m| (QREFELT $ 68)) |vh|)))))) 

(DEFUN |SMATCAT-;trace;SR;11| (|x| $)
  (PROG (|tr| #1=#:G11920 |i| #2=#:G11921 |j|)
    (RETURN
     (SEQ (LETT |tr| (|spadConstant| $ 20) . #3=(|SMATCAT-;trace;SR;11|))
          (SEQ (LETT |j| (SPADCALL |x| (QREFELT $ 26)) . #3#)
               (LETT #2# (SPADCALL |x| (QREFELT $ 27)) . #3#)
               (LETT |i| (SPADCALL |x| (QREFELT $ 24)) . #3#)
               (LETT #1# (SPADCALL |x| (QREFELT $ 25)) . #3#) G190
               (COND ((OR (> |i| #1#) (> |j| #2#)) (GO G191)))
               (SEQ
                (EXIT
                 (LETT |tr|
                       (SPADCALL |tr| (SPADCALL |x| |i| |j| (QREFELT $ 74))
                                 (QREFELT $ 75))
                       . #3#)))
               (LETT |i| (PROG1 (+ |i| 1) (LETT |j| (+ |j| 1) . #3#)) . #3#)
               (GO G190) G191 (EXIT NIL))
          (EXIT |tr|))))) 

(DEFUN |SMATCAT-;diagonalProduct;SR;12| (|x| $)
  (PROG (|pr| #1=#:G11925 |i| #2=#:G11926 |j|)
    (RETURN
     (SEQ
      (LETT |pr| (|spadConstant| $ 12) . #3=(|SMATCAT-;diagonalProduct;SR;12|))
      (SEQ (LETT |j| (SPADCALL |x| (QREFELT $ 26)) . #3#)
           (LETT #2# (SPADCALL |x| (QREFELT $ 27)) . #3#)
           (LETT |i| (SPADCALL |x| (QREFELT $ 24)) . #3#)
           (LETT #1# (SPADCALL |x| (QREFELT $ 25)) . #3#) G190
           (COND ((OR (> |i| #1#) (> |j| #2#)) (GO G191)))
           (SEQ
            (EXIT
             (LETT |pr|
                   (SPADCALL |pr| (SPADCALL |x| |i| |j| (QREFELT $ 74))
                             (QREFELT $ 77))
                   . #3#)))
           (LETT |i| (PROG1 (+ |i| 1) (LETT |j| (+ |j| 1) . #3#)) . #3#)
           (GO G190) G191 (EXIT NIL))
      (EXIT |pr|))))) 

(DEFUN |SMATCAT-;^;SIS;13| (|x| |n| $)
  (PROG (|xInv|)
    (RETURN
     (SEQ
      (COND ((ZEROP |n|) (SPADCALL (|spadConstant| $ 12) (QREFELT $ 13)))
            ((SPADCALL |n| (QREFELT $ 79))
             (|SMATCAT-;positivePower| |x| |n| $))
            (#1='T
             (SEQ
              (LETT |xInv| (SPADCALL |x| (QREFELT $ 81)) |SMATCAT-;^;SIS;13|)
              (EXIT
               (COND
                ((QEQCAR |xInv| 1) (|error| "^: matrix must be invertible"))
                (#1#
                 (|SMATCAT-;positivePower| (QCDR |xInv|) (- |n|) $))))))))))) 

(DEFUN |SquareMatrixCategory&| (|#1| |#2| |#3| |#4| |#5|)
  (PROG (|pv$| $ |dv$| DV$5 DV$4 DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|SquareMatrixCategory&|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT DV$4 (|devaluate| |#4|) . #1#)
      (LETT DV$5 (|devaluate| |#5|) . #1#)
      (LETT |dv$| (LIST '|SquareMatrixCategory&| DV$1 DV$2 DV$3 DV$4 DV$5)
            . #1#)
      (LETT $ (GETREFV 93) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST (|HasCategory| |#3| '(|Field|))
                                               (|HasCategory| |#3|
                                                              '(|CommutativeRing|))))
                      . #1#))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (QSETREFV $ 9 |#4|)
      (QSETREFV $ 10 |#5|)
      (COND
       ((|testBitVector| |pv$| 1)
        (QSETREFV $ 82 (CONS (|dispatchFunction| |SMATCAT-;^;SIS;13|) $))))
      $)))) 

(MAKEPROP '|SquareMatrixCategory&| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (|local| |#3|) (|local| |#4|) (|local| |#5|) (0 . *) (6 . |One|)
              (10 . |scalarMatrix|) (|NonNegativeInteger|) |SMATCAT-;^;SNniS;2|
              |SMATCAT-;coerce;RS;3| (|Mapping| 8 8) (15 . |map|)
              |SMATCAT-;differentiate;SMS;4| (21 . |Zero|) (|Vector| 8)
              (25 . |new|) (|Integer|) (31 . |minRowIndex|)
              (36 . |maxRowIndex|) (41 . |minColIndex|) (46 . |maxColIndex|)
              (51 . |minIndex|) (56 . |qelt|) (63 . |qsetelt!|)
              (70 . |directProduct|) |SMATCAT-;diagonal;SRow;5| (|Boolean|)
              (75 . |diagonal?|) (80 . |diagonal|) (85 . |retract|)
              |SMATCAT-;retract;SR;6| (|Union| 8 '#1="failed")
              (90 . |retractIfCan|) |SMATCAT-;retractIfCan;SU;7| (95 . |Zero|)
              (|Matrix| 10) (99 . |new|) (106 . |minRowIndex|)
              (111 . |maxRowIndex|) (116 . |minColIndex|) (121 . |maxColIndex|)
              (|Vector| 6) (126 . |qelt|) (132 . |column|) (138 . |qsetelt!|)
              (|Matrix| 8) (|Matrix| $) (146 . |reducedSystem|) (|Matrix| 6)
              (151 . |empty?|) (156 . |new|) (163 . |vertConcat|)
              (169 . |minRowIndex|) (174 . |maxRowIndex|) (179 . |row|)
              (|Mapping| 52 52 52) (|List| 52) (185 . |reduce|)
              |SMATCAT-;reducedSystem;MM;9| (191 . |empty?|) (196 . |coerce|)
              (201 . |reducedSystem|) (206 . |minColIndex|) (211 . |column|)
              (|Record| (|:| |mat| 52) (|:| |vec| 21)) (|Vector| $)
              |SMATCAT-;reducedSystem;MVR;10| (217 . |elt|) (224 . +)
              |SMATCAT-;trace;SR;11| (230 . *) |SMATCAT-;diagonalProduct;SR;12|
              (236 . |positive?|) (|Union| $ '"failed") (241 . |inverse|)
              (246 . ^) (|Record| (|:| |mat| 84) (|:| |vec| (|Vector| 23)))
              (|Matrix| 23) (|Fraction| 23) (|Union| 85 '#1#) (|Union| 23 '#1#)
              (|Symbol|) (|List| 88) (|List| 14) (|OutputForm|)
              (|PositiveInteger|))
           '#(|trace| 252 |retractIfCan| 257 |retract| 262 |reducedSystem| 267
              |differentiate| 278 |diagonalProduct| 284 |diagonal| 289 |coerce|
              294 ^ 299)
           'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 82
                                                 '(2 6 0 0 0 11 0 8 0 12 1 6 0
                                                   8 13 2 6 0 17 0 18 0 8 0 20
                                                   2 21 0 14 8 22 1 6 23 0 24 1
                                                   6 23 0 25 1 6 23 0 26 1 6 23
                                                   0 27 1 21 23 0 28 3 6 8 0 23
                                                   23 29 3 21 8 0 23 8 30 1 9 0
                                                   21 31 1 6 33 0 34 1 6 9 0 35
                                                   1 9 8 0 36 1 9 38 0 39 0 10
                                                   0 41 3 42 0 14 14 10 43 1 42
                                                   23 0 44 1 42 23 0 45 1 42 23
                                                   0 46 1 42 23 0 47 2 48 6 0
                                                   23 49 2 6 10 0 23 50 4 42 10
                                                   0 23 23 10 51 1 10 52 53 54
                                                   1 55 33 0 56 3 52 0 14 14 8
                                                   57 2 52 0 0 0 58 1 55 23 0
                                                   59 1 55 23 0 60 2 55 48 0 23
                                                   61 2 63 52 62 0 64 1 48 33 0
                                                   66 1 55 0 48 67 1 6 52 53 68
                                                   1 52 23 0 69 2 52 21 0 23 70
                                                   3 6 8 0 23 23 74 2 8 0 0 0
                                                   75 2 8 0 0 0 77 1 23 33 0 79
                                                   1 6 80 0 81 2 0 0 0 23 82 1
                                                   0 8 0 76 1 0 38 0 40 1 0 8 0
                                                   37 1 0 52 53 65 2 0 71 53 72
                                                   73 2 0 0 0 17 19 1 0 8 0 78
                                                   1 0 9 0 32 1 0 0 8 16 2 0 0
                                                   0 23 82 2 0 0 0 14 15)))))
           '|lookupComplete|)) 
