
(/VERSIONCHECK 2) 

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

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

(DEFUN |IMATLIN;rowEchelon;2M;3| (|y| $)
  (PROG (|x| |minR| |maxR| |minC| |maxC| |j| #0=#:G1851 |n| #1=#:G1841
             |b| |k| |k1| |i|)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |x| (SPADCALL |y| (QREFELT $ 19))
                            . #2=(|IMATLIN;rowEchelon;2M;3|))
                      (LETT |minR| (SPADCALL |x| (QREFELT $ 17)) . #2#)
                      (LETT |maxR| (SPADCALL |x| (QREFELT $ 18)) . #2#)
                      (LETT |minC| (SPADCALL |x| (QREFELT $ 11)) . #2#)
                      (LETT |maxC| (SPADCALL |x| (QREFELT $ 12)) . #2#)
                      (LETT |i| |minR| . #2#)
                      (LETT |n| (- |minR| 1) . #2#)
                      (SEQ (LETT |j| |minC| . #2#) G190
                           (COND ((> |j| |maxC|) #3=(GO G191)))
                           (SEQ (EXIT (COND
                                        ((< |maxR| |i|)
                                         (PROGN
                                           (LETT #0# |x| . #2#)
                                           (GO #0#)))
                                        ('T
                                         (SEQ
                                          (LETT |n| (- |minR| 1) . #2#)
                                          (SEQ
                                           (EXIT
                                            (SEQ (LETT |k| |i| . #2#)
                                             G190
                                             (COND
                                               ((> |k| |maxR|) #3#))
                                             (SEQ
                                              (EXIT
                                               (COND
                                                 ((NULL
                                                   (SPADCALL
                                                    (SPADCALL |x| |k|
                                                     |j|
                                                     (QREFELT $ 13))
                                                    (|spadConstant| $
                                                     14)
                                                    (QREFELT $ 16)))
                                                  (PROGN
                                                    (LETT #1#
                                                     (LETT |n|
                                                      |k| . #2#) . #2#)
                                                    (GO #1#))))))
                                             (LETT |k| (+ |k| 1) . #2#)
                                             #4=(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)) . #2#)
                                               (SPADCALL |x| |i| |j|
                                                (|spadConstant| $ 20)
                                                (QREFELT $ 23))
                                               (SEQ
                                                (LETT |k|
                                                 (+ |j| 1) . #2#)
                                                G190
                                                (COND
                                                  ((> |k| |maxC|) #3#))
                                                (SEQ
                                                 (EXIT
                                                  (SPADCALL |x| |i| |k|
                                                   (SPADCALL |b|
                                                    (SPADCALL |x| |i|
                                                     |k|
                                                     (QREFELT $ 13))
                                                    (QREFELT $ 24))
                                                   (QREFELT $ 23))))
                                                (LETT |k|
                                                 (+ |k| 1) . #2#)
                                                #4# G191 (EXIT NIL))
                                               (SEQ
                                                (LETT |k| |minR| . #2#)
                                                G190
                                                (COND
                                                  ((> |k| |maxR|) #3#))
                                                (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) . #2#)
                                                          G190
                                                          (COND
                                                            ((> |k1|
                                                              |maxC|)
                                                             #3#))
                                                          (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) . #2#)
                                                          #4# G191
                                                          (EXIT NIL))
                                                         (EXIT
                                                          (SPADCALL |x|
                                                           |k| |j|
                                                           (|spadConstant|
                                                            $ 14)
                                                           (QREFELT $
                                                            23))))))))))
                                                (LETT |k|
                                                 (+ |k| 1) . #2#)
                                                #4# G191 (EXIT NIL))
                                               (EXIT
                                                (LETT |i|
                                                 (+ |i| 1) . #2#)))))))))))
                           (LETT |j| (+ |j| 1) . #2#) #4# G191
                           (EXIT NIL))
                      (EXIT |x|)))
           #0# (EXIT #0#))))) 

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

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

(DEFUN |IMATLIN;nullSpace;ML;6| (|y| $)
  (PROG (|x| |minR| |maxR| |minC| |maxC| |nrow| |ncol| #0=#:G1861 |rk|
             #1=#:G1862 |row| |v| |i| #2=#:G1882 |w| |ll| #3=#:G1884
             |k| #4=#:G1883 |basis| |j| |l|)
    (RETURN
      (SEQ (LETT |x| (SPADCALL |y| (QREFELT $ 26))
                 . #5=(|IMATLIN;nullSpace;ML;6|))
           (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 |nrow| (SPADCALL |x| (QREFELT $ 29)) . #5#)
           (LETT |ncol| (SPADCALL |x| (QREFELT $ 28)) . #5#)
           (LETT |basis| NIL . #5#) (LETT |rk| |nrow| . #5#)
           (LETT |row| |maxR| . #5#)
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((< 0 |rk|)
                            (|IMATLIN;rowAllZeroes?| |x| |row| $))
                           ('T 'NIL)))
                   #6=(GO G191)))
                (SEQ (LETT |rk|
                           (PROG1 (LETT #0# (- |rk| 1) . #5#)
                             (|check-subtype| (>= #0# 0)
                                 '(|NonNegativeInteger|) #0#)) . #5#)
                     (EXIT (LETT |row|
                                 (PROG1 (LETT #1# (- |row| 1) . #5#)
                                   (|check-subtype| (>= #1# 0)
                                    '(|NonNegativeInteger|) #1#)) . #5#)))
                NIL #7=(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| . #5#) G190
                              (COND ((> |j| |maxC|) #6#))
                              (SEQ (LETT |w|
                                    (SPADCALL |ncol|
                                     (|spadConstant| $ 14)
                                     (QREFELT $ 33)) . #5#)
                                   (SPADCALL |w| |j|
                                    (|spadConstant| $ 20)
                                    (QREFELT $ 34))
                                   (EXIT
                                    (LETT |basis|
                                     (CONS |w| |basis|) . #5#)))
                              (LETT |j| (+ |j| 1) . #5#) #7# G191
                              (EXIT NIL))
                         (EXIT |basis|)))
                   ('T
                    (SEQ (LETT |v|
                               (SPADCALL |ncol| (- |minR| 1)
                                   (|compiledLookupCheck| '|new|
                                    (LIST '$
                                     (LIST '|NonNegativeInteger|)
                                     (LIST '|Integer|))
                                    (|IndexedOneDimensionalArray|
                                     (|Integer|) |minC|))) . #5#)
                         (SEQ (LETT |i| |minR| . #5#)
                              (LETT #2# (- (+ |minR| |rk|) 1) . #5#)
                              G190 (COND ((> |i| #2#) #6#))
                              (SEQ (SEQ (LETT |j| |minC| . #5#) G190
                                    (COND
                                      ((NULL
                                        (SPADCALL
                                         (SPADCALL |x| |i| |j|
                                          (QREFELT $ 13))
                                         (|spadConstant| $ 14)
                                         (QREFELT $ 16)))
                                       #6#))
                                    (SEQ (EXIT |j|))
                                    (LETT |j| (+ |j| 1) . #5#) #7# G191
                                    (EXIT NIL))
                                   (EXIT
                                    (SPADCALL |v| |j| |i|
                                     (|compiledLookupCheck| '|qsetelt!|
                                      (LIST (LIST '|Integer|) '$
                                       (LIST '|Integer|)
                                       (LIST '|Integer|))
                                      (|IndexedOneDimensionalArray|
                                       (|Integer|) |minC|)))))
                              (LETT |i| (+ |i| 1) . #5#) #7# G191
                              (EXIT NIL))
                         (LETT |j| |maxC| . #5#)
                         (LETT |l| (- (+ |minR| |ncol|) 1) . #5#)
                         (SEQ G190
                              (COND
                                ((NULL (COND
                                         ((< |j| |minC|) 'NIL)
                                         ('T 'T)))
                                 #6#))
                              (SEQ (LETT |w|
                                    (SPADCALL |ncol|
                                     (|spadConstant| $ 14)
                                     (QREFELT $ 33)) . #5#)
                                   (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|) . #5#))))
                                        ('T
                                         (SEQ
                                          (SEQ (LETT |ll| |minR| . #5#)
                                           (LETT #3# (- |l| 1) . #5#)
                                           (LETT |k| |minC| . #5#)
                                           (LETT #4# (- |j| 1) . #5#)
                                           G190
                                           (COND
                                             ((OR (> |k| #4#)
                                               (> |ll| #3#))
                                              #6#))
                                           (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) . #5#)) . #5#)
                                           #7# G191 (EXIT NIL))
                                          (SPADCALL |w| |l|
                                           (|spadConstant| $ 20)
                                           (QREFELT $ 34))
                                          (EXIT
                                           (LETT |basis|
                                            (CONS |w| |basis|) . #5#)))))))
                                   (LETT |j| (- |j| 1) . #5#)
                                   (EXIT (LETT |l| (- |l| 1) . #5#)))
                              NIL #7# G191 (EXIT NIL))
                         (EXIT |basis|))))))))) 

(DEFUN |IMATLIN;determinant;MR;7| (|y| $)
  (PROG (|ndim| |x| |minR| |maxR| |minC| |maxC| |j| #0=#:G1901 |i|
                #1=#:G1900 |rown| #2=#:G1887 #3=#:G1899 |ans| |k| |b|
                |l|)
    (RETURN
      (SEQ (EXIT (COND
                   ((NULL (EQL (LETT |ndim|
                                     (SPADCALL |y| (QREFELT $ 29))
                                     . #4=(|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)) . #4#)
                            (LETT |minR|
                                  (SPADCALL |x| (QREFELT $ 17)) . #4#)
                            (LETT |maxR|
                                  (SPADCALL |x| (QREFELT $ 18)) . #4#)
                            (LETT |minC|
                                  (SPADCALL |x| (QREFELT $ 11)) . #4#)
                            (LETT |maxC|
                                  (SPADCALL |x| (QREFELT $ 12)) . #4#)
                            (LETT |ans| (|spadConstant| $ 20) . #4#)
                            (SEQ (LETT |j| |minC| . #4#)
                                 (LETT #0# (- |maxC| 1) . #4#)
                                 (LETT |i| |minR| . #4#)
                                 (LETT #1# (- |maxR| 1) . #4#) G190
                                 (COND
                                   ((OR (> |i| #1#) (> |j| #0#))
                                    #5=(GO G191)))
                                 (SEQ (COND
                                        ((SPADCALL
                                          (SPADCALL |x| |i| |j|
                                           (QREFELT $ 13))
                                          (|spadConstant| $ 14)
                                          (QREFELT $ 16))
                                         (SEQ
                                          (LETT |rown|
                                           (- |minR| 1) . #4#)
                                          (SEQ
                                           (EXIT
                                            (SEQ
                                             (LETT |k| (+ |i| 1) . #4#)
                                             G190
                                             (COND
                                               ((> |k| |maxR|) #5#))
                                             (SEQ
                                              (EXIT
                                               (COND
                                                 ((NULL
                                                   (SPADCALL
                                                    (SPADCALL |x| |k|
                                                     |j|
                                                     (QREFELT $ 13))
                                                    (|spadConstant| $
                                                     14)
                                                    (QREFELT $ 16)))
                                                  (PROGN
                                                    (LETT #2#
                                                     (PROGN
                                                       (LETT #2#
                                                        (LETT |rown|
                                                         |k| . #4#) . #4#)
                                                       (GO #2#)) . #4#)
                                                    (GO #2#))))))
                                             (LETT |k| (+ |k| 1) . #4#)
                                             #6=(GO G190) G191
                                             (EXIT NIL)))
                                           #2# (EXIT #2#))
                                          (COND
                                            ((EQL |rown| (- |minR| 1))
                                             (PROGN
                                               (LETT #3#
                                                (|spadConstant| $ 14) . #4#)
                                               (GO #3#))))
                                          (SPADCALL |x| |i| |rown|
                                           (QREFELT $ 21))
                                          (EXIT
                                           (LETT |ans|
                                            (SPADCALL |ans|
                                             (QREFELT $ 35)) . #4#)))))
                                      (LETT |ans|
                                       (SPADCALL
                                        (SPADCALL |x| |i| |j|
                                         (QREFELT $ 13))
                                        |ans| (QREFELT $ 24)) . #4#)
                                      (LETT |b|
                                       (SPADCALL
                                        (SPADCALL
                                         (SPADCALL |x| |i| |j|
                                          (QREFELT $ 13))
                                         (QREFELT $ 22))
                                        (QREFELT $ 35)) . #4#)
                                      (SEQ (LETT |l| (+ |j| 1) . #4#)
                                       G190 (COND ((> |l| |maxC|) #5#))
                                       (SEQ
                                        (EXIT
                                         (SPADCALL |x| |i| |l|
                                          (SPADCALL |b|
                                           (SPADCALL |x| |i| |l|
                                            (QREFELT $ 13))
                                           (QREFELT $ 24))
                                          (QREFELT $ 23))))
                                       (LETT |l| (+ |l| 1) . #4#) #6#
                                       G191 (EXIT NIL))
                                      (EXIT
                                       (SEQ (LETT |k| (+ |i| 1) . #4#)
                                        G190
                                        (COND ((> |k| |maxR|) #5#))
                                        (SEQ
                                         (LETT |b|
                                          (SPADCALL |x| |k| |j|
                                           (QREFELT $ 13)) . #4#)
                                         (EXIT
                                          (COND
                                            ((NULL
                                              (SPADCALL |b|
                                               (|spadConstant| $ 14)
                                               (QREFELT $ 16)))
                                             (SEQ
                                              (LETT |l|
                                               (+ |j| 1) . #4#)
                                              G190
                                              (COND
                                                ((> |l| |maxC|) #5#))
                                              (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) . #4#)
                                              #6# G191 (EXIT NIL))))))
                                        (LETT |k| (+ |k| 1) . #4#) #6#
                                        G191 (EXIT NIL))))
                                 (LETT |i|
                                       (PROG1 (+ |i| 1)
                                         (LETT |j| (+ |j| 1) . #4#)) . #4#)
                                 #6# G191 (EXIT NIL))
                            (EXIT (SPADCALL
                                      (SPADCALL |x| |maxR| |maxC|
                                       (QREFELT $ 13))
                                      |ans| (QREFELT $ 24)))))))))
           #3# (EXIT #3#))))) 

(DEFUN |IMATLIN;generalizedInverse;2M;8| (|x| $)
  (PROG (SUP FSUP VFSUP MATCAT2 MATCAT22 |y| |ty| |nc| |var| #0=#:G1903
             |yy|)
    (RETURN
      (SEQ (LETT SUP (|SparseUnivariatePolynomial| (QREFELT $ 6))
                 . #1=(|IMATLIN;generalizedInverse;2M;8|))
           (LETT FSUP (|Fraction| SUP) . #1#)
           (LETT VFSUP (|Vector| FSUP) . #1#)
           (LETT MATCAT2
                 (|MatrixCategoryFunctions2| (QREFELT $ 6)
                     (QREFELT $ 7) (QREFELT $ 8) (QREFELT $ 9) FSUP
                     VFSUP VFSUP (|Matrix| FSUP)) . #1#)
           (LETT MATCAT22
                 (|MatrixCategoryFunctions2| FSUP VFSUP VFSUP
                     (|Matrix| FSUP) (QREFELT $ 6) (QREFELT $ 7)
                     (QREFELT $ 8) (QREFELT $ 9)) . #1#)
           (LETT |y|
                 (SPADCALL
                     (CONS #'|IMATLIN;generalizedInverse;2M;8!0|
                           (VECTOR SUP $))
                     |x|
                     (|compiledLookupCheck| '|map|
                         (LIST (LIST '|Matrix| (|devaluate| FSUP))
                               (LIST '|Mapping| (|devaluate| FSUP)
                                     (|devaluate| (ELT $ 6)))
                               (|devaluate| (ELT $ 9)))
                         MATCAT2)) . #1#)
           (LETT |ty|
                 (SPADCALL |y|
                     (|compiledLookupCheck| '|transpose| (LIST '$ '$)
                         (|Matrix| FSUP))) . #1#)
           (LETT |yy|
                 (SPADCALL |ty| |y|
                     (|compiledLookupCheck| '* (LIST '$ '$ '$)
                         (|Matrix| FSUP))) . #1#)
           (LETT |nc|
                 (SPADCALL |yy|
                     (|compiledLookupCheck| '|ncols|
                         (LIST (LIST '|NonNegativeInteger|) '$)
                         (|Matrix| FSUP))) . #1#)
           (LETT |var|
                 (SPADCALL
                     (SPADCALL (|spadConstant| $ 20) 1
                         (|compiledLookupCheck| '|monomial|
                             (LIST '$ (|devaluate| (ELT $ 6))
                                   (LIST '|NonNegativeInteger|))
                             SUP))
                     (|compiledLookupCheck| '|coerce|
                         (LIST '$ (|devaluate| SUP)) (|Fraction| SUP))) . #1#)
           (LETT |yy|
                 (SPADCALL
                     (PROG2 (LETT #0#
                                  (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))) . #1#)
                            (QCDR #0#)
                       (|check-union| (QEQCAR #0# 0) (|Matrix| FSUP)
                           #0#))
                     |ty|
                     (|compiledLookupCheck| '* (LIST '$ '$ '$)
                         (|Matrix| FSUP))) . #1#)
           (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| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 1) |IMATLIN;generalizedInverse;2M;8|)
    (RETURN
      (PROGN
        (SPADCALL |#1| (|spadConstant| $ 14)
            (|compiledLookupCheck| '|elt|
                (LIST (|devaluate| (ELT $ 6)) (LIST '|Fraction| '$)
                      (|devaluate| (ELT $ 6)))
                (QREFELT $$ 0))))))) 

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

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

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

(DEFUN |InnerMatrixLinearAlgebraFunctions;| (|#1| |#2| |#3| |#4|)
  (PROG (DV$1 DV$2 DV$3 DV$4 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|InnerMatrixLinearAlgebraFunctions|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT |dv$|
              (LIST '|InnerMatrixLinearAlgebraFunctions| DV$1 DV$2 DV$3
                    DV$4) . #0#)
        (LETT $ (GETREFV 48) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#3| '(|shallowlyMutable|)))) . #0#))
        (|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|)) 
