
(/VERSIONCHECK 2) 

(DEFUN |IMATLIN;rowAllZeroes?| (|x| |i| $)
  (PROG (#1=#:G1810 #2=#:G1812 #3=#:G1813 |j|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (SEQ
         (EXIT
          (SEQ
           (LETT |j| (SPADCALL |x| (QREFELT $ 11))
                 . #4=(|IMATLIN;rowAllZeroes?|))
           (LETT #3# (SPADCALL |x| (QREFELT $ 12)) . #4#) G190
           (COND ((> |j| #3#) (GO G191)))
           (SEQ
            (EXIT
             (COND
              ((NULL
                (SPADCALL (SPADCALL |x| |i| |j| (QREFELT $ 13))
                          (|spadConstant| $ 14) (QREFELT $ 16)))
               (PROGN
                (LETT #1# (PROGN (LETT #2# 'NIL . #4#) (GO #2#)) . #4#)
                (GO #1#))))))
           (LETT |j| (+ |j| 1) . #4#) (GO G190) G191 (EXIT NIL)))
         #1# (EXIT #1#))
        (EXIT 'T)))
      #2# (EXIT #2#))))) 

(DEFUN |IMATLIN;colAllZeroes?| (|x| |j| $)
  (PROG (#1=#:G1815 #2=#:G1817 #3=#:G1818 |i|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (SEQ
         (EXIT
          (SEQ
           (LETT |i| (SPADCALL |x| (QREFELT $ 17))
                 . #4=(|IMATLIN;colAllZeroes?|))
           (LETT #3# (SPADCALL |x| (QREFELT $ 18)) . #4#) G190
           (COND ((> |i| #3#) (GO G191)))
           (SEQ
            (EXIT
             (COND
              ((NULL
                (SPADCALL (SPADCALL |x| |i| |j| (QREFELT $ 13))
                          (|spadConstant| $ 14) (QREFELT $ 16)))
               (PROGN
                (LETT #1# (PROGN (LETT #2# 'NIL . #4#) (GO #2#)) . #4#)
                (GO #1#))))))
           (LETT |i| (+ |i| 1) . #4#) (GO G190) G191 (EXIT NIL)))
         #1# (EXIT #1#))
        (EXIT 'T)))
      #2# (EXIT #2#))))) 

(DEFUN |IMATLIN;rowEchelon;2M;3| (|y| $)
  (PROG (|i| |k1| |k| |b| #1=#:G1820 |n| #2=#:G1830 |j| |maxC| |minC| |maxR|
         |minR| |x|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |x| (SPADCALL |y| (QREFELT $ 19))
              . #3=(|IMATLIN;rowEchelon;2M;3|))
        (LETT |minR| (SPADCALL |x| (QREFELT $ 17)) . #3#)
        (LETT |maxR| (SPADCALL |x| (QREFELT $ 18)) . #3#)
        (LETT |minC| (SPADCALL |x| (QREFELT $ 11)) . #3#)
        (LETT |maxC| (SPADCALL |x| (QREFELT $ 12)) . #3#)
        (LETT |i| |minR| . #3#) (LETT |n| (- |minR| 1) . #3#)
        (SEQ (LETT |j| |minC| . #3#) G190 (COND ((> |j| |maxC|) #4=(GO G191)))
             (SEQ
              (EXIT
               (COND ((< |maxR| |i|) (PROGN (LETT #2# |x| . #3#) (GO #2#)))
                     ('T
                      (SEQ (LETT |n| (- |minR| 1) . #3#)
                           (SEQ
                            (EXIT
                             (SEQ (LETT |k| |i| . #3#) G190
                                  (COND ((> |k| |maxR|) #4#))
                                  (SEQ
                                   (EXIT
                                    (COND
                                     ((NULL
                                       (SPADCALL
                                        (SPADCALL |x| |k| |j| (QREFELT $ 13))
                                        (|spadConstant| $ 14) (QREFELT $ 16)))
                                      (PROGN
                                       (LETT #1# (LETT |n| |k| . #3#) . #3#)
                                       (GO #1#))))))
                                  (LETT |k| (+ |k| 1) . #3#) #5=(GO G190) G191
                                  (EXIT NIL)))
                            #1# (EXIT #1#))
                           (EXIT
                            (COND ((EQL |n| (- |minR| 1)) "no non-zeroes")
                                  ('T
                                   (SEQ
                                    (COND
                                     ((NULL (EQL |i| |n|))
                                      (SPADCALL |x| |i| |n| (QREFELT $ 21))))
                                    (LETT |b|
                                          (SPADCALL
                                           (SPADCALL |x| |i| |j|
                                                     (QREFELT $ 13))
                                           (QREFELT $ 22))
                                          . #3#)
                                    (SPADCALL |x| |i| |j| (|spadConstant| $ 20)
                                              (QREFELT $ 23))
                                    (SEQ (LETT |k| (+ |j| 1) . #3#) G190
                                         (COND ((> |k| |maxC|) #4#))
                                         (SEQ
                                          (EXIT
                                           (SPADCALL |x| |i| |k|
                                                     (SPADCALL |b|
                                                               (SPADCALL |x|
                                                                         |i|
                                                                         |k|
                                                                         (QREFELT
                                                                          $
                                                                          13))
                                                               (QREFELT $ 24))
                                                     (QREFELT $ 23))))
                                         (LETT |k| (+ |k| 1) . #3#) #5# G191
                                         (EXIT NIL))
                                    (SEQ (LETT |k| |minR| . #3#) G190
                                         (COND ((> |k| |maxR|) #4#))
                                         (SEQ
                                          (EXIT
                                           (COND
                                            ((NULL (EQL |k| |i|))
                                             (COND
                                              ((NULL
                                                (SPADCALL
                                                 (SPADCALL |x| |k| |j|
                                                           (QREFELT $ 13))
                                                 (|spadConstant| $ 14)
                                                 (QREFELT $ 16)))
                                               (SEQ
                                                (SEQ
                                                 (LETT |k1| (+ |j| 1) . #3#)
                                                 G190
                                                 (COND ((> |k1| |maxC|) #4#))
                                                 (SEQ
                                                  (EXIT
                                                   (SPADCALL |x| |k| |k1|
                                                             (SPADCALL
                                                              (SPADCALL |x| |k|
                                                                        |k1|
                                                                        (QREFELT
                                                                         $ 13))
                                                              (SPADCALL
                                                               (SPADCALL |x|
                                                                         |k|
                                                                         |j|
                                                                         (QREFELT
                                                                          $
                                                                          13))
                                                               (SPADCALL |x|
                                                                         |i|
                                                                         |k1|
                                                                         (QREFELT
                                                                          $
                                                                          13))
                                                               (QREFELT $ 24))
                                                              (QREFELT $ 25))
                                                             (QREFELT $ 23))))
                                                 (LETT |k1| (+ |k1| 1) . #3#)
                                                 #5# G191 (EXIT NIL))
                                                (EXIT
                                                 (SPADCALL |x| |k| |j|
                                                           (|spadConstant| $
                                                                           14)
                                                           (QREFELT $
                                                                    23))))))))))
                                         (LETT |k| (+ |k| 1) . #3#) #5# G191
                                         (EXIT NIL))
                                    (EXIT (LETT |i| (+ |i| 1) . #3#)))))))))))
             (LETT |j| (+ |j| 1) . #3#) #5# G191 (EXIT NIL))
        (EXIT |x|)))
      #2# (EXIT #2#))))) 

(DEFUN |IMATLIN;rank;MNni;4| (|x| $)
  (PROG (|rk| #1=#:G1833 |i| |y| |rh|)
    (RETURN
     (SEQ
      (LETT |y|
            (SEQ
             (LETT |rh| (SPADCALL |x| (QREFELT $ 28))
                   . #2=(|IMATLIN;rank;MNni;4|))
             (LETT |rk| (SPADCALL |x| (QREFELT $ 29)) . #2#)
             (EXIT
              (COND
               ((< |rh| |rk|)
                (SEQ (LETT |rk| |rh| . #2#)
                     (EXIT (SPADCALL |x| (QREFELT $ 30)))))
               ('T (SPADCALL |x| (QREFELT $ 19))))))
            . #2#)
      (LETT |y| (SPADCALL |y| (QREFELT $ 26)) . #2#)
      (LETT |i| (SPADCALL |y| (QREFELT $ 18)) . #2#)
      (SEQ G190
           (COND
            ((NULL
              (COND ((< 0 |rk|) (|IMATLIN;rowAllZeroes?| |y| |i| $))
                    ('T 'NIL)))
             (GO G191)))
           (SEQ (LETT |i| (- |i| 1) . #2#)
                (EXIT
                 (LETT |rk|
                       (PROG1 (LETT #1# (- |rk| 1) . #2#)
                         (|check-subtype| (>= #1# 0) '(|NonNegativeInteger|)
                                          #1#))
                       . #2#)))
           NIL (GO G190) G191 (EXIT NIL))
      (EXIT |rk|))))) 

(DEFUN |IMATLIN;nullity;MNni;5| (|x| $)
  (PROG (#1=#:G1838)
    (RETURN
     (PROG1
         (LETT #1#
               (- (SPADCALL |x| (QREFELT $ 28)) (SPADCALL |x| (QREFELT $ 31)))
               |IMATLIN;nullity;MNni;5|)
       (|check-subtype| (>= #1# 0) '(|NonNegativeInteger|) #1#))))) 

(DEFUN |IMATLIN;nullSpace;ML;6| (|y| $)
  (PROG (|l| |j| |basis| #1=#:G1866 |k| #2=#:G1867 |ll| |w| #3=#:G1865 |i| |v|
         |row| #4=#:G1845 |rk| #5=#:G1844 |ncol| |nrow| |maxC| |minC| |maxR|
         |minR| |x|)
    (RETURN
     (SEQ
      (LETT |x| (SPADCALL |y| (QREFELT $ 26)) . #6=(|IMATLIN;nullSpace;ML;6|))
      (LETT |minR| (SPADCALL |x| (QREFELT $ 17)) . #6#)
      (LETT |maxR| (SPADCALL |x| (QREFELT $ 18)) . #6#)
      (LETT |minC| (SPADCALL |x| (QREFELT $ 11)) . #6#)
      (LETT |maxC| (SPADCALL |x| (QREFELT $ 12)) . #6#)
      (LETT |nrow| (SPADCALL |x| (QREFELT $ 29)) . #6#)
      (LETT |ncol| (SPADCALL |x| (QREFELT $ 28)) . #6#)
      (LETT |basis| NIL . #6#) (LETT |rk| |nrow| . #6#)
      (LETT |row| |maxR| . #6#)
      (SEQ G190
           (COND
            ((NULL
              (COND ((< 0 |rk|) (|IMATLIN;rowAllZeroes?| |x| |row| $))
                    ('T 'NIL)))
             #7=(GO G191)))
           (SEQ
            (LETT |rk|
                  (PROG1 (LETT #5# (- |rk| 1) . #6#)
                    (|check-subtype| (>= #5# 0) '(|NonNegativeInteger|) #5#))
                  . #6#)
            (EXIT
             (LETT |row|
                   (PROG1 (LETT #4# (- |row| 1) . #6#)
                     (|check-subtype| (>= #4# 0) '(|NonNegativeInteger|) #4#))
                   . #6#)))
           NIL #8=(GO G190) G191 (EXIT NIL))
      (COND ((NULL (< |nrow| |ncol|)) (COND ((EQL |rk| |ncol|) (EXIT NIL)))))
      (EXIT
       (COND
        ((EQL |rk| 0)
         (SEQ
          (SEQ (LETT |j| |minC| . #6#) G190 (COND ((> |j| |maxC|) #7#))
               (SEQ
                (LETT |w|
                      (SPADCALL |ncol| (|spadConstant| $ 14) (QREFELT $ 33))
                      . #6#)
                (SPADCALL |w| |j| (|spadConstant| $ 20) (QREFELT $ 34))
                (EXIT (LETT |basis| (CONS |w| |basis|) . #6#)))
               (LETT |j| (+ |j| 1) . #6#) #8# G191 (EXIT NIL))
          (EXIT |basis|)))
        ('T
         (SEQ
          (LETT |v|
                (SPADCALL |ncol| (- |minR| 1)
                          (|compiledLookupCheck| '|new|
                                                 (LIST '$
                                                       (LIST
                                                        '|NonNegativeInteger|)
                                                       (LIST '|Integer|))
                                                 (|IndexedOneDimensionalArray|
                                                  (|Integer|) |minC|)))
                . #6#)
          (SEQ (LETT |i| |minR| . #6#) (LETT #3# (- (+ |minR| |rk|) 1) . #6#)
               G190 (COND ((> |i| #3#) #7#))
               (SEQ
                (SEQ (LETT |j| |minC| . #6#) G190
                     (COND
                      ((NULL
                        (SPADCALL (SPADCALL |x| |i| |j| (QREFELT $ 13))
                                  (|spadConstant| $ 14) (QREFELT $ 16)))
                       #7#))
                     (SEQ (EXIT |j|)) (LETT |j| (+ |j| 1) . #6#) #8# G191
                     (EXIT NIL))
                (EXIT
                 (SPADCALL |v| |j| |i|
                           (|compiledLookupCheck| '|qsetelt!|
                                                  (LIST (LIST '|Integer|) '$
                                                        (LIST '|Integer|)
                                                        (LIST '|Integer|))
                                                  (|IndexedOneDimensionalArray|
                                                   (|Integer|) |minC|)))))
               (LETT |i| (+ |i| 1) . #6#) #8# G191 (EXIT NIL))
          (LETT |j| |maxC| . #6#) (LETT |l| (- (+ |minR| |ncol|) 1) . #6#)
          (SEQ G190 (COND ((NULL (COND ((< |j| |minC|) 'NIL) ('T 'T))) #7#))
               (SEQ
                (LETT |w|
                      (SPADCALL |ncol| (|spadConstant| $ 14) (QREFELT $ 33))
                      . #6#)
                (COND
                 ((EQL
                   (SPADCALL |v| |j|
                             (|compiledLookupCheck| '|qelt|
                                                    (LIST (LIST '|Integer|) '$
                                                          (LIST '|Integer|))
                                                    (|IndexedOneDimensionalArray|
                                                     (|Integer|) |minC|)))
                   (- |minR| 1))
                  (COND
                   ((|IMATLIN;colAllZeroes?| |x| |j| $)
                    (SEQ
                     (SPADCALL |w| |l| (|spadConstant| $ 20) (QREFELT $ 34))
                     (EXIT (LETT |basis| (CONS |w| |basis|) . #6#))))
                   ('T
                    (SEQ
                     (SEQ (LETT |ll| |minR| . #6#) (LETT #2# (- |l| 1) . #6#)
                          (LETT |k| |minC| . #6#) (LETT #1# (- |j| 1) . #6#)
                          G190 (COND ((OR (> |k| #1#) (> |ll| #2#)) #7#))
                          (SEQ
                           (EXIT
                            (COND
                             ((NULL
                               (EQL
                                (SPADCALL |v| |k|
                                          (|compiledLookupCheck| '|qelt|
                                                                 (LIST
                                                                  (LIST
                                                                   '|Integer|)
                                                                  '$
                                                                  (LIST
                                                                   '|Integer|))
                                                                 (|IndexedOneDimensionalArray|
                                                                  (|Integer|)
                                                                  |minC|)))
                                (- |minR| 1)))
                              (SPADCALL |w| |ll|
                                        (SPADCALL
                                         (SPADCALL |x|
                                                   (SPADCALL |v| |k|
                                                             (|compiledLookupCheck|
                                                              '|qelt|
                                                              (LIST
                                                               (LIST
                                                                '|Integer|)
                                                               '$
                                                               (LIST
                                                                '|Integer|))
                                                              (|IndexedOneDimensionalArray|
                                                               (|Integer|)
                                                               |minC|)))
                                                   |j| (QREFELT $ 13))
                                         (QREFELT $ 35))
                                        (QREFELT $ 34))))))
                          (LETT |k|
                                (PROG1 (+ |k| 1) (LETT |ll| (+ |ll| 1) . #6#))
                                . #6#)
                          #8# G191 (EXIT NIL))
                     (SPADCALL |w| |l| (|spadConstant| $ 20) (QREFELT $ 34))
                     (EXIT (LETT |basis| (CONS |w| |basis|) . #6#)))))))
                (LETT |j| (- |j| 1) . #6#) (EXIT (LETT |l| (- |l| 1) . #6#)))
               NIL #8# G191 (EXIT NIL))
          (EXIT |basis|))))))))) 

(DEFUN |IMATLIN;determinant;MR;7| (|y| $)
  (PROG (|l| |b| |k| |ans| #1=#:G1882 #2=#:G1870 |rown| #3=#:G1883 |i|
         #4=#:G1884 |j| |maxC| |minC| |maxR| |minR| |x| |ndim|)
    (RETURN
     (SEQ
      (EXIT
       (COND
        ((NULL
          (EQL
           (LETT |ndim| (SPADCALL |y| (QREFELT $ 29))
                 . #5=(|IMATLIN;determinant;MR;7|))
           (SPADCALL |y| (QREFELT $ 28))))
         (|error| "determinant: matrix must be square"))
        ('T
         (COND
          ((EQL |ndim| 1)
           (SPADCALL |y| (SPADCALL |y| (QREFELT $ 17))
                     (SPADCALL |y| (QREFELT $ 11)) (QREFELT $ 13)))
          ('T
           (SEQ (LETT |x| (SPADCALL |y| (QREFELT $ 19)) . #5#)
                (LETT |minR| (SPADCALL |x| (QREFELT $ 17)) . #5#)
                (LETT |maxR| (SPADCALL |x| (QREFELT $ 18)) . #5#)
                (LETT |minC| (SPADCALL |x| (QREFELT $ 11)) . #5#)
                (LETT |maxC| (SPADCALL |x| (QREFELT $ 12)) . #5#)
                (LETT |ans| (|spadConstant| $ 20) . #5#)
                (SEQ (LETT |j| |minC| . #5#) (LETT #4# (- |maxC| 1) . #5#)
                     (LETT |i| |minR| . #5#) (LETT #3# (- |maxR| 1) . #5#) G190
                     (COND ((OR (> |i| #3#) (> |j| #4#)) #6=(GO G191)))
                     (SEQ
                      (COND
                       ((SPADCALL (SPADCALL |x| |i| |j| (QREFELT $ 13))
                                  (|spadConstant| $ 14) (QREFELT $ 16))
                        (SEQ (LETT |rown| (- |minR| 1) . #5#)
                             (SEQ
                              (EXIT
                               (SEQ (LETT |k| (+ |i| 1) . #5#) G190
                                    (COND ((> |k| |maxR|) #6#))
                                    (SEQ
                                     (EXIT
                                      (COND
                                       ((NULL
                                         (SPADCALL
                                          (SPADCALL |x| |k| |j| (QREFELT $ 13))
                                          (|spadConstant| $ 14)
                                          (QREFELT $ 16)))
                                        (PROGN
                                         (LETT #2#
                                               (PROGN
                                                (LETT #2#
                                                      (LETT |rown| |k| . #5#)
                                                      . #5#)
                                                (GO #2#))
                                               . #5#)
                                         (GO #2#))))))
                                    (LETT |k| (+ |k| 1) . #5#) #7=(GO G190)
                                    G191 (EXIT NIL)))
                              #2# (EXIT #2#))
                             (COND
                              ((EQL |rown| (- |minR| 1))
                               (PROGN
                                (LETT #1# (|spadConstant| $ 14) . #5#)
                                (GO #1#))))
                             (SPADCALL |x| |i| |rown| (QREFELT $ 21))
                             (EXIT
                              (LETT |ans| (SPADCALL |ans| (QREFELT $ 35))
                                    . #5#)))))
                      (LETT |ans|
                            (SPADCALL (SPADCALL |x| |i| |j| (QREFELT $ 13))
                                      |ans| (QREFELT $ 24))
                            . #5#)
                      (LETT |b|
                            (SPADCALL
                             (SPADCALL (SPADCALL |x| |i| |j| (QREFELT $ 13))
                                       (QREFELT $ 22))
                             (QREFELT $ 35))
                            . #5#)
                      (SEQ (LETT |l| (+ |j| 1) . #5#) G190
                           (COND ((> |l| |maxC|) #6#))
                           (SEQ
                            (EXIT
                             (SPADCALL |x| |i| |l|
                                       (SPADCALL |b|
                                                 (SPADCALL |x| |i| |l|
                                                           (QREFELT $ 13))
                                                 (QREFELT $ 24))
                                       (QREFELT $ 23))))
                           (LETT |l| (+ |l| 1) . #5#) #7# G191 (EXIT NIL))
                      (EXIT
                       (SEQ (LETT |k| (+ |i| 1) . #5#) G190
                            (COND ((> |k| |maxR|) #6#))
                            (SEQ
                             (LETT |b| (SPADCALL |x| |k| |j| (QREFELT $ 13))
                                   . #5#)
                             (EXIT
                              (COND
                               ((NULL
                                 (SPADCALL |b| (|spadConstant| $ 14)
                                           (QREFELT $ 16)))
                                (SEQ (LETT |l| (+ |j| 1) . #5#) G190
                                     (COND ((> |l| |maxC|) #6#))
                                     (SEQ
                                      (EXIT
                                       (SPADCALL |x| |k| |l|
                                                 (SPADCALL
                                                  (SPADCALL |x| |k| |l|
                                                            (QREFELT $ 13))
                                                  (SPADCALL |b|
                                                            (SPADCALL |x| |i|
                                                                      |l|
                                                                      (QREFELT
                                                                       $ 13))
                                                            (QREFELT $ 24))
                                                  (QREFELT $ 38))
                                                 (QREFELT $ 23))))
                                     (LETT |l| (+ |l| 1) . #5#) #7# G191
                                     (EXIT NIL))))))
                            (LETT |k| (+ |k| 1) . #5#) #7# G191 (EXIT NIL))))
                     (LETT |i| (PROG1 (+ |i| 1) (LETT |j| (+ |j| 1) . #5#))
                           . #5#)
                     #7# G191 (EXIT NIL))
                (EXIT
                 (SPADCALL (SPADCALL |x| |maxR| |maxC| (QREFELT $ 13)) |ans|
                           (QREFELT $ 24)))))))))
      #1# (EXIT #1#))))) 

(DEFUN |IMATLIN;generalizedInverse;2M;8| (|x| $)
  (PROG (|yy| #1=#:G1896 |var| |nc| |ty| |y| MATCAT22 MATCAT2 VFSUP FSUP SUP)
    (RETURN
     (SEQ
      (LETT SUP (|SparseUnivariatePolynomial| (QREFELT $ 6))
            . #2=(|IMATLIN;generalizedInverse;2M;8|))
      (LETT FSUP (|Fraction| SUP) . #2#) (LETT VFSUP (|Vector| FSUP) . #2#)
      (LETT MATCAT2
            (|MatrixCategoryFunctions2| (QREFELT $ 6) (QREFELT $ 7)
                                        (QREFELT $ 8) (QREFELT $ 9) FSUP VFSUP
                                        VFSUP (|Matrix| FSUP))
            . #2#)
      (LETT MATCAT22
            (|MatrixCategoryFunctions2| FSUP VFSUP VFSUP (|Matrix| FSUP)
                                        (QREFELT $ 6) (QREFELT $ 7)
                                        (QREFELT $ 8) (QREFELT $ 9))
            . #2#)
      (LETT |y|
            (SPADCALL
             (CONS #'|IMATLIN;generalizedInverse;2M;8!0| (VECTOR FSUP SUP $))
             |x|
             (|compiledLookupCheck| '|map|
                                    (LIST (LIST '|Matrix| (|devaluate| FSUP))
                                          (LIST '|Mapping| (|devaluate| FSUP)
                                                (|devaluate| (ELT $ 6)))
                                          (|devaluate| (ELT $ 9)))
                                    MATCAT2))
            . #2#)
      (LETT |ty|
            (SPADCALL |y|
                      (|compiledLookupCheck| '|transpose| (LIST '$ '$)
                                             (|Matrix| FSUP)))
            . #2#)
      (LETT |yy|
            (SPADCALL |ty| |y|
                      (|compiledLookupCheck| '* (LIST '$ '$ '$)
                                             (|Matrix| FSUP)))
            . #2#)
      (LETT |nc|
            (SPADCALL |yy|
                      (|compiledLookupCheck| '|ncols|
                                             (LIST (LIST '|NonNegativeInteger|)
                                                   '$)
                                             (|Matrix| FSUP)))
            . #2#)
      (LETT |var|
            (SPADCALL
             (SPADCALL (|spadConstant| $ 20) 1
                       (|compiledLookupCheck| '|monomial|
                                              (LIST '$ (|devaluate| (ELT $ 6))
                                                    (LIST
                                                     '|NonNegativeInteger|))
                                              SUP))
             (|compiledLookupCheck| '|coerce| (LIST '$ (|devaluate| SUP))
                                    (|Fraction| SUP)))
            . #2#)
      (LETT |yy|
            (SPADCALL
             (PROG2
                 (LETT #1#
                       (SPADCALL
                        (SPADCALL |yy|
                                  (SPADCALL
                                   (SPADCALL |yy|
                                             (|compiledLookupCheck| '|ncols|
                                                                    (LIST
                                                                     (LIST
                                                                      '|NonNegativeInteger|)
                                                                     '$)
                                                                    (|Matrix|
                                                                     FSUP)))
                                   |var|
                                   (|compiledLookupCheck| '|scalarMatrix|
                                                          (LIST '$
                                                                (LIST
                                                                 '|NonNegativeInteger|)
                                                                (|devaluate|
                                                                 FSUP))
                                                          (|Matrix| FSUP)))
                                  (|compiledLookupCheck| '+ (LIST '$ '$ '$)
                                                         (|Matrix| FSUP)))
                        (|compiledLookupCheck| '|inverse|
                                               (LIST
                                                (LIST '|Union| '$ '"failed")
                                                '$)
                                               (|Matrix| FSUP)))
                       . #2#)
                 (QCDR #1#)
               (|check-union| (QEQCAR #1# 0) (|Matrix| FSUP) #1#))
             |ty| (|compiledLookupCheck| '* (LIST '$ '$ '$) (|Matrix| FSUP)))
            . #2#)
      (EXIT
       (SPADCALL (CONS #'|IMATLIN;generalizedInverse;2M;8!1| (VECTOR SUP $))
                 |yy|
                 (|compiledLookupCheck| '|map|
                                        (LIST (|devaluate| (ELT $ 9))
                                              (LIST '|Mapping|
                                                    (|devaluate| (ELT $ 6))
                                                    (|devaluate| FSUP))
                                              (LIST '|Matrix|
                                                    (|devaluate| FSUP)))
                                        MATCAT22))))))) 

(DEFUN |IMATLIN;generalizedInverse;2M;8!1| (|z1| $$)
  (PROG ($ SUP)
    (LETT $ (QREFELT $$ 1) . #1=(|IMATLIN;generalizedInverse;2M;8|))
    (LETT SUP (QREFELT $$ 0) . #1#)
    (RETURN
     (PROGN
      (SPADCALL |z1| (|spadConstant| $ 14)
                (|compiledLookupCheck| '|elt|
                                       (LIST (|devaluate| (ELT $ 6))
                                             (LIST '|Fraction| '$)
                                             (|devaluate| (ELT $ 6)))
                                       SUP)))))) 

(DEFUN |IMATLIN;generalizedInverse;2M;8!0| (|r1| $$)
  (PROG ($ SUP FSUP)
    (LETT $ (QREFELT $$ 2) . #1=(|IMATLIN;generalizedInverse;2M;8|))
    (LETT SUP (QREFELT $$ 1) . #1#)
    (LETT FSUP (QREFELT $$ 0) . #1#)
    (RETURN
     (PROGN
      (SPADCALL
       (SPADCALL |r1|
                 (|compiledLookupCheck| '|coerce|
                                        (LIST '$ (|devaluate| (ELT $ 6))) SUP))
       (|compiledLookupCheck| '|coerce| (LIST '$ (|devaluate| SUP)) FSUP)))))) 

(DEFUN |IMATLIN;inverse;MU;9| (|x| $)
  (PROG (AB |j| |l| |i| |k| |lmax| |lmin| |kmax| |kmin| |maxC| |minC| |maxR|
         |minR| |detinv| |det| |ans2| |ndim|)
    (RETURN
     (SEQ
      (COND
       ((NULL
         (EQL
          (LETT |ndim| (SPADCALL |x| (QREFELT $ 29))
                . #1=(|IMATLIN;inverse;MU;9|))
          (SPADCALL |x| (QREFELT $ 28))))
        (|error| "inverse: matrix must be square"))
       ('T
        (COND
         ((EQL |ndim| 2)
          (SEQ (LETT |ans2| (SPADCALL |ndim| |ndim| (QREFELT $ 41)) . #1#)
               (EXIT
                (COND
                 ((SPADCALL
                   (LETT |det|
                         (SPADCALL
                          (SPADCALL (SPADCALL |x| 1 1 (QREFELT $ 42))
                                    (SPADCALL |x| 2 2 (QREFELT $ 42))
                                    (QREFELT $ 24))
                          (SPADCALL (SPADCALL |x| 1 2 (QREFELT $ 42))
                                    (SPADCALL |x| 2 1 (QREFELT $ 42))
                                    (QREFELT $ 24))
                          (QREFELT $ 25))
                         . #1#)
                   (QREFELT $ 43))
                  (CONS 1 "failed"))
                 (#2='T
                  (SEQ (LETT |detinv| (SPADCALL |det| (QREFELT $ 22)) . #1#)
                       (SPADCALL |ans2| 1 1
                                 (SPADCALL (SPADCALL |x| 2 2 (QREFELT $ 42))
                                           |detinv| (QREFELT $ 24))
                                 (QREFELT $ 44))
                       (SPADCALL |ans2| 1 2
                                 (SPADCALL
                                  (SPADCALL (SPADCALL |x| 1 2 (QREFELT $ 42))
                                            |detinv| (QREFELT $ 24))
                                  (QREFELT $ 35))
                                 (QREFELT $ 44))
                       (SPADCALL |ans2| 2 1
                                 (SPADCALL
                                  (SPADCALL (SPADCALL |x| 2 1 (QREFELT $ 42))
                                            |detinv| (QREFELT $ 24))
                                  (QREFELT $ 35))
                                 (QREFELT $ 44))
                       (SPADCALL |ans2| 2 2
                                 (SPADCALL (SPADCALL |x| 1 1 (QREFELT $ 42))
                                           |detinv| (QREFELT $ 24))
                                 (QREFELT $ 44))
                       (EXIT (CONS 0 |ans2|))))))))
         (#2#
          (SEQ
           (LETT AB (SPADCALL |ndim| (+ |ndim| |ndim|) (QREFELT $ 41)) . #1#)
           (LETT |minR| (SPADCALL |x| (QREFELT $ 17)) . #1#)
           (LETT |maxR| (SPADCALL |x| (QREFELT $ 18)) . #1#)
           (LETT |minC| (SPADCALL |x| (QREFELT $ 11)) . #1#)
           (LETT |maxC| (SPADCALL |x| (QREFELT $ 12)) . #1#)
           (LETT |kmin| (SPADCALL AB (QREFELT $ 17)) . #1#)
           (LETT |kmax| (- (+ |kmin| |ndim|) 1) . #1#)
           (LETT |lmin| (SPADCALL AB (QREFELT $ 11)) . #1#)
           (LETT |lmax| (- (+ |lmin| |ndim|) 1) . #1#)
           (SEQ (LETT |k| |kmin| . #1#) (LETT |i| |minR| . #1#) G190
                (COND ((OR (> |i| |maxR|) (> |k| |kmax|)) #3=(GO G191)))
                (SEQ
                 (SEQ (LETT |l| |lmin| . #1#) (LETT |j| |minC| . #1#) G190
                      (COND ((OR (> |j| |maxC|) (> |l| |lmax|)) #3#))
                      (SEQ
                       (EXIT
                        (SPADCALL AB |k| |l|
                                  (SPADCALL |x| |i| |j| (QREFELT $ 13))
                                  (QREFELT $ 23))))
                      (LETT |j| (PROG1 (+ |j| 1) (LETT |l| (+ |l| 1) . #1#))
                            . #1#)
                      #4=(GO G190) G191 (EXIT NIL))
                 (EXIT
                  (SPADCALL AB |k| (- (+ (+ |lmin| |ndim|) |k|) |kmin|)
                            (|spadConstant| $ 20) (QREFELT $ 23))))
                (LETT |i| (PROG1 (+ |i| 1) (LETT |k| (+ |k| 1) . #1#)) . #1#)
                #4# G191 (EXIT NIL))
           (LETT AB (SPADCALL AB (QREFELT $ 26)) . #1#)
           (EXIT
            (COND
             ((SPADCALL (SPADCALL AB |kmax| |lmax| (QREFELT $ 42))
                        (|spadConstant| $ 14) (QREFELT $ 16))
              (CONS 1 "failed"))
             (#2#
              (CONS 0
                    (SPADCALL AB |kmin| |kmax| (+ |lmin| |ndim|)
                              (+ |lmax| |ndim|) (QREFELT $ 45))))))))))))))) 

(DEFUN |InnerMatrixLinearAlgebraFunctions| (&REST #1=#:G1916)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1917)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (|devaluateList| #1#)
                                           (HGET |$ConstructorCache|
                                                 '|InnerMatrixLinearAlgebraFunctions|)
                                           '|domainEqualList|)
                . #3=(|InnerMatrixLinearAlgebraFunctions|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT
              (PROG1
                  (APPLY (|function| |InnerMatrixLinearAlgebraFunctions;|) #1#)
                (LETT #2# T . #3#))
            (COND
             ((NOT #2#)
              (HREM |$ConstructorCache|
                    '|InnerMatrixLinearAlgebraFunctions|))))))))))) 

(DEFUN |InnerMatrixLinearAlgebraFunctions;| (|#1| |#2| |#3| |#4|)
  (PROG (|pv$| $ |dv$| DV$4 DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|InnerMatrixLinearAlgebraFunctions|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT DV$4 (|devaluate| |#4|) . #1#)
      (LETT |dv$|
            (LIST '|InnerMatrixLinearAlgebraFunctions| DV$1 DV$2 DV$3 DV$4)
            . #1#)
      (LETT $ (GETREFV 48) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST
                                          (|HasCategory| |#3|
                                                         '(|shallowlyMutable|))))
                      . #1#))
      (|haddProp| |$ConstructorCache| '|InnerMatrixLinearAlgebraFunctions|
                  (LIST DV$1 DV$2 DV$3 DV$4) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (QSETREFV $ 9 |#4|)
      (COND
       ((|testBitVector| |pv$| 1)
        (QSETREFV $ 37
                  (CONS (|dispatchFunction| |IMATLIN;nullSpace;ML;6|) $))))
      $)))) 

(MAKEPROP '|InnerMatrixLinearAlgebraFunctions| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (|local| |#3|) (|local| |#4|) (|Integer|) (0 . |minColIndex|)
              (5 . |maxColIndex|) (10 . |qelt|) (17 . |Zero|) (|Boolean|)
              (21 . =) (27 . |minRowIndex|) (32 . |maxRowIndex|) (37 . |copy|)
              (42 . |One|) (46 . |swapRows!|) (53 . |inv|) (58 . |qsetelt!|)
              (66 . *) (72 . -) |IMATLIN;rowEchelon;2M;3|
              (|NonNegativeInteger|) (78 . |ncols|) (83 . |nrows|)
              (88 . |transpose|) |IMATLIN;rank;MNni;4| |IMATLIN;nullity;MNni;5|
              (93 . |new|) (99 . |qsetelt!|) (106 . -) (|List| 8)
              (111 . |nullSpace|) (116 . +) |IMATLIN;determinant;MR;7|
              |IMATLIN;generalizedInverse;2M;8| (122 . |zero|) (128 . |elt|)
              (135 . |zero?|) (140 . |setelt|) (148 . |subMatrix|)
              (|Union| 9 '"failed") |IMATLIN;inverse;MU;9|)
           '#(|rowEchelon| 157 |rank| 162 |nullity| 167 |nullSpace| 172
              |inverse| 177 |generalizedInverse| 182 |determinant| 187)
           'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 47
                                                 '(1 9 10 0 11 1 9 10 0 12 3 9
                                                   6 0 10 10 13 0 6 0 14 2 6 15
                                                   0 0 16 1 9 10 0 17 1 9 10 0
                                                   18 1 9 0 0 19 0 6 0 20 3 9 0
                                                   0 10 10 21 1 6 0 0 22 4 9 6
                                                   0 10 10 6 23 2 6 0 0 0 24 2
                                                   6 0 0 0 25 1 9 27 0 28 1 9
                                                   27 0 29 1 9 0 0 30 2 8 0 27
                                                   6 33 3 8 6 0 10 6 34 1 6 0 0
                                                   35 1 0 36 9 37 2 6 0 0 0 38
                                                   2 9 0 27 27 41 3 9 6 0 10 10
                                                   42 1 6 15 0 43 4 9 6 0 10 10
                                                   6 44 5 9 0 0 10 10 10 10 45
                                                   1 0 9 9 26 1 0 27 9 31 1 0
                                                   27 9 32 1 1 36 9 37 1 0 46 9
                                                   47 1 0 9 9 40 1 0 6 9
                                                   39)))))
           '|lookupComplete|)) 
