
(/VERSIONCHECK 2) 

(DEFUN |RMATCAT-;size;Nni;1| ($)
  (EXPT (SPADCALL (QREFELT $ 13)) (* (QREFELT $ 7) (QREFELT $ 8)))) 

(DEFUN |RMATCAT-;random;S;2| ($)
  (PROG (#0=#:G1828 |j| #1=#:G1829 #2=#:G1830 |i| #3=#:G1831)
    (RETURN
      (SEQ (SPADCALL
               (PROGN
                 (LETT #0# NIL . #4=(|RMATCAT-;random;S;2|))
                 (SEQ (LETT |j| 1 . #4#) (LETT #1# (QREFELT $ 8) . #4#)
                      G190 (COND ((QSGREATERP |j| #1#) #5=(GO G191)))
                      (SEQ (EXIT (LETT #0#
                                       (CONS
                                        (PROGN
                                          (LETT #2# NIL . #4#)
                                          (SEQ (LETT |i| 1 . #4#)
                                           (LETT #3#
                                            (QREFELT $ 7) . #4#)
                                           G190
                                           (COND
                                             ((QSGREATERP |i| #3#) #5#))
                                           (SEQ
                                            (EXIT
                                             (LETT #2#
                                              (CONS
                                               (SPADCALL
                                                (QREFELT $ 15))
                                               #2#) . #4#)))
                                           (LETT |i|
                                            (QSADD1 |i|) . #4#)
                                           #6=(GO G190) G191
                                           (EXIT (NREVERSE0 #2#))))
                                        #0#) . #4#)))
                      (LETT |j| (QSADD1 |j|) . #4#) #6# G191
                      (EXIT (NREVERSE0 #0#))))
               (QREFELT $ 17)))))) 

(DEFUN |RMATCAT-;lookup;SPi;3| (|x| $)
  (PROG (|s| |l| |r| #0=#:G1838 |c| #1=#:G1839 |res| |pow| #2=#:G1835)
    (RETURN
      (SEQ (LETT |s| (SPADCALL (QREFELT $ 13))
                 . #3=(|RMATCAT-;lookup;SPi;3|))
           (LETT |pow| 1 . #3#)
           (LETT |l| (SPADCALL |x| (QREFELT $ 19)) . #3#)
           (LETT |res| 1 . #3#)
           (SEQ (LETT |r| NIL . #3#) (LETT #0# |l| . #3#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |r| (CAR #0#) . #3#) NIL))
                   #4=(GO G191)))
                (SEQ (EXIT (SEQ (LETT |c| NIL . #3#)
                                (LETT #1# |r| . #3#) G190
                                (COND
                                  ((OR (ATOM #1#)
                                    (PROGN
                                      (LETT |c| (CAR #1#) . #3#)
                                      NIL))
                                   #4#))
                                (SEQ (LETT |res|
                                      (+ |res|
                                       (*
                                        (-
                                         (SPADCALL |c| (QREFELT $ 21))
                                         1)
                                        |pow|)) . #3#)
                                     (EXIT
                                      (LETT |pow| (* |pow| |s|) . #3#)))
                                (LETT #1# (CDR #1#) . #3#) #5=(GO G190)
                                G191 (EXIT NIL))))
                (LETT #0# (CDR #0#) . #3#) #5# G191 (EXIT NIL))
           (EXIT (PROG1 (LETT #2# |res| . #3#)
                   (|check-subtype| (> #2# 0) '(|PositiveInteger|) #2#))))))) 

(DEFUN |RMATCAT-;index;PiS;4| (|i| $)
  (PROG (|s| #0=#:G1848 |j| #1=#:G1849 #2=#:G1841 |el| |row| |old|
             |res|)
    (RETURN
      (SEQ (LETT |s| (SPADCALL (QREFELT $ 13))
                 . #3=(|RMATCAT-;index;PiS;4|))
           (LETT |old| (DIVIDE2 (- |i| 1) |s|) . #3#)
           (LETT |res| NIL . #3#)
           (SEQ (LETT |i| 1 . #3#) (LETT #0# (QREFELT $ 7) . #3#) G190
                (COND ((QSGREATERP |i| #0#) #4=(GO G191)))
                (SEQ (LETT |row| NIL . #3#)
                     (SEQ (LETT |j| 1 . #3#)
                          (LETT #1# (QREFELT $ 8) . #3#) G190
                          (COND ((QSGREATERP |j| #1#) #4#))
                          (SEQ (LETT |el|
                                     (SPADCALL
                                      (PROG1
                                       (LETT #2#
                                        (+ (QCDR |old|) 1) . #3#)
                                        (|check-subtype| (> #2# 0)
                                         '(|PositiveInteger|) #2#))
                                      (QREFELT $ 23)) . #3#)
                               (LETT |row| (CONS |el| |row|) . #3#)
                               (EXIT (LETT |old|
                                      (DIVIDE2 (QCAR |old|) |s|) . #3#)))
                          (LETT |j| (QSADD1 |j|) . #3#) #5=(GO G190)
                          G191 (EXIT NIL))
                     (EXIT (LETT |res|
                                 (CONS (NREVERSE |row|) |res|) . #3#)))
                (LETT |i| (QSADD1 |i|) . #3#) #5# G191 (EXIT NIL))
           (EXIT (SPADCALL (NREVERSE |res|) (QREFELT $ 17))))))) 

(DEFUN |RMATCAT-;nrows;SNni;5| (|x| $) (QREFELT $ 7)) 

(DEFUN |RMATCAT-;ncols;SNni;6| (|x| $) (QREFELT $ 8)) 

(DEFUN |RMATCAT-;square?;SB;7| (|x| $)
  (EQL (QREFELT $ 7) (QREFELT $ 8))) 

(DEFUN |RMATCAT-;diagonal?;SB;8| (|x| $)
  (PROG (|i| #0=#:G1860 |j| #1=#:G1861 #2=#:G1859 #3=#:G1856)
    (RETURN
      (SEQ (EXIT (COND
                   ((NULL (SPADCALL |x| (QREFELT $ 29))) 'NIL)
                   ('T
                    (SEQ (SEQ (LETT |i| (SPADCALL |x| (QREFELT $ 31))
                                    . #4=(|RMATCAT-;diagonal?;SB;8|))
                              (LETT #0#
                                    (SPADCALL |x| (QREFELT $ 32)) . #4#)
                              G190 (COND ((> |i| #0#) #5=(GO G191)))
                              (SEQ (EXIT
                                    (SEQ
                                     (LETT |j|
                                      (SPADCALL |x| (QREFELT $ 33)) . #4#)
                                     (LETT #1#
                                      (SPADCALL |x| (QREFELT $ 34)) . #4#)
                                     G190 (COND ((> |j| #1#) #5#))
                                     (SEQ
                                      (EXIT
                                       (COND
                                         ((COND
                                            ((EQL
                                              (- |j|
                                               (SPADCALL |x|
                                                (QREFELT $ 33)))
                                              (- |i|
                                               (SPADCALL |x|
                                                (QREFELT $ 31))))
                                             'NIL)
                                            ('T 'T))
                                          (COND
                                            ((NULL
                                              (SPADCALL
                                               (SPADCALL |x| |i| |j|
                                                (QREFELT $ 35))
                                               (QREFELT $ 36)))
                                             (PROGN
                                               (LETT #3#
                                                (PROGN
                                                  (LETT #2# 'NIL . #4#)
                                                  (GO #2#)) . #4#)
                                               (GO #3#))))))))
                                     (LETT |j| (+ |j| 1) . #4#)
                                     #6=(GO G190) G191 (EXIT NIL)))
                                   #3# (EXIT #3#))
                              (LETT |i| (+ |i| 1) . #4#) #6# G191
                              (EXIT NIL))
                         (EXIT 'T)))))
           #2# (EXIT #2#))))) 

(DEFUN |RMATCAT-;symmetric?;SB;9| (|x| $)
  (PROG (|mr| |mc| |i| #0=#:G1867 |j| #1=#:G1868 #2=#:G1866 #3=#:G1863)
    (RETURN
      (SEQ (EXIT (COND
                   ((EQL (QREFELT $ 7) (QREFELT $ 8))
                    (SEQ (LETT |mr| (SPADCALL |x| (QREFELT $ 31))
                               . #4=(|RMATCAT-;symmetric?;SB;9|))
                         (LETT |mc|
                               (SPADCALL |x| (QREFELT $ 33)) . #4#)
                         (SEQ (LETT |i| 0 . #4#)
                              (LETT #0# (- (QREFELT $ 8) 1) . #4#) G190
                              (COND
                                ((QSGREATERP |i| #0#) #5=(GO G191)))
                              (SEQ (EXIT
                                    (SEQ (LETT |j| (+ |i| 1) . #4#)
                                     (LETT #1#
                                      (- (QREFELT $ 8) 1) . #4#)
                                     G190 (COND ((> |j| #1#) #5#))
                                     (SEQ
                                      (EXIT
                                       (COND
                                         ((NULL
                                           (SPADCALL
                                            (SPADCALL |x| (+ |mr| |i|)
                                             (+ |mc| |j|)
                                             (QREFELT $ 35))
                                            (SPADCALL |x| (+ |mr| |j|)
                                             (+ |mc| |i|)
                                             (QREFELT $ 35))
                                            (QREFELT $ 38)))
                                          (PROGN
                                            (LETT #3#
                                             (PROGN
                                               (LETT #2# 'NIL . #4#)
                                               (GO #2#)) . #4#)
                                            (GO #3#))))))
                                     (LETT |j| (+ |j| 1) . #4#)
                                     #6=(GO G190) G191 (EXIT NIL)))
                                   #3# (EXIT #3#))
                              (LETT |i| (QSADD1 |i|) . #4#) #6# G191
                              (EXIT NIL))
                         (EXIT 'T)))
                   ('T 'NIL)))
           #2# (EXIT #2#))))) 

(DEFUN |RMATCAT-;antisymmetric?;SB;10| (|x| $)
  (PROG (|mr| |mc| |i| #0=#:G1874 |j| #1=#:G1875 #2=#:G1873 #3=#:G1870)
    (RETURN
      (SEQ (EXIT (COND
                   ((EQL (QREFELT $ 7) (QREFELT $ 8))
                    (SEQ (LETT |mr| (SPADCALL |x| (QREFELT $ 31))
                               . #4=(|RMATCAT-;antisymmetric?;SB;10|))
                         (LETT |mc|
                               (SPADCALL |x| (QREFELT $ 33)) . #4#)
                         (SEQ (LETT |i| 0 . #4#)
                              (LETT #0# (- (QREFELT $ 8) 1) . #4#) G190
                              (COND
                                ((QSGREATERP |i| #0#) #5=(GO G191)))
                              (SEQ (EXIT
                                    (SEQ (LETT |j| |i| . #4#)
                                     (LETT #1#
                                      (- (QREFELT $ 8) 1) . #4#)
                                     G190 (COND ((> |j| #1#) #5#))
                                     (SEQ
                                      (EXIT
                                       (COND
                                         ((NULL
                                           (SPADCALL
                                            (SPADCALL |x| (+ |mr| |i|)
                                             (+ |mc| |j|)
                                             (QREFELT $ 35))
                                            (SPADCALL
                                             (SPADCALL |x| (+ |mr| |j|)
                                              (+ |mc| |i|)
                                              (QREFELT $ 35))
                                             (QREFELT $ 40))
                                            (QREFELT $ 38)))
                                          (PROGN
                                            (LETT #3#
                                             (PROGN
                                               (LETT #2# 'NIL . #4#)
                                               (GO #2#)) . #4#)
                                            (GO #3#))))))
                                     (LETT |j| (+ |j| 1) . #4#)
                                     #6=(GO G190) G191 (EXIT NIL)))
                                   #3# (EXIT #3#))
                              (LETT |i| (QSADD1 |i|) . #4#) #6# G191
                              (EXIT NIL))
                         (EXIT 'T)))
                   ('T 'NIL)))
           #2# (EXIT #2#))))) 

(DEFUN |RectangularMatrixCategory&| (|#1| |#2| |#3| |#4| |#5| |#6|)
  (PROG (DV$1 DV$2 DV$3 DV$4 DV$5 DV$6 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|RectangularMatrixCategory&|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT DV$5 (|devaluate| |#5|) . #0#)
        (LETT DV$6 (|devaluate| |#6|) . #0#)
        (LETT |dv$|
              (LIST '|RectangularMatrixCategory&| DV$1 DV$2 DV$3 DV$4
                    DV$5 DV$6) . #0#)
        (LETT $ (GETREFV 42) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#4| '(|EuclideanDomain|))
                            (|HasCategory| |#4| '(|Field|))
                            (|HasCategory| |#4| '(|IntegralDomain|))
                            (|HasCategory| |#4| '(|CommutativeRing|))
                            (|HasCategory| |#4| '(|Finite|)))) . #0#))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 |#3|)
        (QSETREFV $ 9 |#4|)
        (QSETREFV $ 10 |#5|)
        (QSETREFV $ 11 |#6|)
        (COND
          ((|testBitVector| |pv$| 5)
           (PROGN
             (QSETREFV $ 14
                 (CONS (|dispatchFunction| |RMATCAT-;size;Nni;1|) $))
             (QSETREFV $ 18
                 (CONS (|dispatchFunction| |RMATCAT-;random;S;2|) $))
             (QSETREFV $ 22
                 (CONS (|dispatchFunction| |RMATCAT-;lookup;SPi;3|) $))
             (QSETREFV $ 24
                 (CONS (|dispatchFunction| |RMATCAT-;index;PiS;4|) $)))))
        $)))) 

(MAKEPROP '|RectangularMatrixCategory&| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) (|local| |#5|)
             (|local| |#6|) (|NonNegativeInteger|) (0 . |size|)
             (4 . |size|) (8 . |random|) (|List| (|List| 9))
             (12 . |matrix|) (17 . |random|) (21 . |listOfLists|)
             (|PositiveInteger|) (26 . |lookup|) (31 . |lookup|)
             (36 . |index|) (41 . |index|) |RMATCAT-;nrows;SNni;5|
             |RMATCAT-;ncols;SNni;6| (|Boolean|)
             |RMATCAT-;square?;SB;7| (46 . |square?|) (|Integer|)
             (51 . |minRowIndex|) (56 . |maxRowIndex|)
             (61 . |minColIndex|) (66 . |maxColIndex|) (71 . |qelt|)
             (78 . |zero?|) |RMATCAT-;diagonal?;SB;8| (83 . =)
             |RMATCAT-;symmetric?;SB;9| (89 . -)
             |RMATCAT-;antisymmetric?;SB;10|)
          '#(|symmetric?| 94 |square?| 99 |size| 104 |random| 108
             |nrows| 112 |ncols| 117 |lookup| 122 |index| 127
             |diagonal?| 132 |antisymmetric?| 137)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 41
                                '(0 9 12 13 0 0 12 14 0 9 0 15 1 6 0 16
                                  17 0 0 0 18 1 6 16 0 19 1 9 20 0 21 1
                                  0 20 0 22 1 9 0 20 23 1 0 0 20 24 1 6
                                  27 0 29 1 6 30 0 31 1 6 30 0 32 1 6
                                  30 0 33 1 6 30 0 34 3 6 9 0 30 30 35
                                  1 9 27 0 36 2 9 27 0 0 38 1 9 0 0 40
                                  1 0 27 0 39 1 0 27 0 28 0 0 12 14 0 0
                                  0 18 1 0 12 0 25 1 0 12 0 26 1 0 20 0
                                  22 1 0 0 20 24 1 0 27 0 37 1 0 27 0
                                  41)))))
          '|lookupComplete|)) 
