
(/VERSIONCHECK 2) 

(DEFUN |LSMP;hasSolution?;MColB;1| (A |b| $)
  (EQL (SPADCALL A (QREFELT $ 11))
       (SPADCALL (|LSMP;systemMatrix| A |b| $) (QREFELT $ 11)))) 

(DEFUN |LSMP;systemMatrix| (|m| |v| $)
  (SPADCALL |m| (SPADCALL (SPADCALL |v| (QREFELT $ 14)) (QREFELT $ 15))
            (QREFELT $ 16))) 

(DEFUN |LSMP;rank;MColNni;3| (A |b| $)
  (SPADCALL (|LSMP;systemMatrix| A |b| $) (QREFELT $ 11))) 

(DEFUN |LSMP;particularSolution;MColU;4| (A |b| $)
  (|LSMP;aSolution|
      (SPADCALL (|LSMP;systemMatrix| A |b| $) (QREFELT $ 18)) $)) 

(DEFUN |LSMP;aSolution| (|m| $)
  (PROG (#0=#:G1835 |nvar| |rk| |ck| |sol| |v| |i| |j| #1=#:G1850)
    (RETURN
      (SEQ (LETT |nvar|
                 (PROG1 (LETT #0# (- (SPADCALL |m| (QREFELT $ 21)) 1)
                              . #2=(|LSMP;aSolution|))
                   (|check-subtype| (>= #0# 0) '(|NonNegativeInteger|)
                       #0#)) . #2#)
           (LETT |rk| (SPADCALL |m| (QREFELT $ 24)) . #2#)
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((< |rk| (SPADCALL |m| (QREFELT $ 25)))
                            'NIL)
                           ('T
                            (SPADCALL (ELT $ 26)
                                (SPADCALL |m| |rk| (QREFELT $ 27))
                                (QREFELT $ 29)))))
                   #3=(GO G191)))
                (SEQ (EXIT (LETT |rk| (- |rk| 1) . #2#))) NIL
                #4=(GO G190) G191 (EXIT NIL))
           (EXIT (COND
                   ((< |rk| (SPADCALL |m| (QREFELT $ 25)))
                    (CONS 0
                          (SPADCALL |nvar| (|spadConstant| $ 30)
                              (QREFELT $ 31))))
                   ('T
                    (SEQ (LETT |ck|
                               (SPADCALL |m| (QREFELT $ 32)) . #2#)
                         (SEQ G190
                              (COND
                                ((NULL (COND
                                         ((< |ck|
                                           (SPADCALL |m|
                                            (QREFELT $ 33)))
                                          (SPADCALL
                                           (SPADCALL |m| |rk| |ck|
                                            (QREFELT $ 34))
                                           (QREFELT $ 26)))
                                         ('T 'NIL)))
                                 #3#))
                              (SEQ (EXIT (LETT |ck| (+ |ck| 1) . #2#)))
                              NIL #4# G191 (EXIT NIL))
                         (EXIT (COND
                                 ((EQL |ck|
                                       (SPADCALL |m| (QREFELT $ 33)))
                                  (CONS 1 "failed"))
                                 ('T
                                  (SEQ (LETT |sol|
                                        (SPADCALL |nvar|
                                         (|spadConstant| $ 30)
                                         (QREFELT $ 31)) . #2#)
                                       (LETT |v|
                                        (SPADCALL |nvar|
                                         (-
                                          (SPADCALL |m| (QREFELT $ 25))
                                          1)
                                         (QREFELT $ 36)) . #2#)
                                       (SEQ
                                        (LETT |i|
                                         (SPADCALL |m| (QREFELT $ 25)) . #2#)
                                        G190 (COND ((> |i| |rk|) #3#))
                                        (SEQ
                                         (SEQ (LETT |j| 0 . #2#) G190
                                          (COND
                                            ((NULL
                                              (SPADCALL
                                               (SPADCALL |m| |i|
                                                (+ |j|
                                                 (SPADCALL |m|
                                                  (QREFELT $ 32)))
                                                (QREFELT $ 34))
                                               (QREFELT $ 26)))
                                             #3#))
                                          (SEQ
                                           (EXIT (|spadConstant| $ 30)))
                                          (LETT |j| (QSADD1 |j|) . #2#)
                                          #4# G191 (EXIT NIL))
                                         (EXIT (SETELT |v| |j| |i|)))
                                        (LETT |i| (+ |i| 1) . #2#) #4#
                                        G191 (EXIT NIL))
                                       (SEQ (LETT |j| 0 . #2#)
                                        (LETT #1# (- |nvar| 1) . #2#)
                                        G190
                                        (COND
                                          ((QSGREATERP |j| #1#) #3#))
                                        (SEQ
                                         (EXIT
                                          (COND
                                            ((NULL
                                              (< (ELT |v| |j|)
                                               (SPADCALL |m|
                                                (QREFELT $ 25))))
                                             (SPADCALL |sol|
                                              (+ |j|
                                               (SPADCALL |sol|
                                                (QREFELT $ 37)))
                                              (SPADCALL
                                               (SPADCALL |m|
                                                (ELT |v| |j|)
                                                (SPADCALL |m|
                                                 (QREFELT $ 33))
                                                (QREFELT $ 34))
                                               (QREFELT $ 38))
                                              (QREFELT $ 39))))))
                                        (LETT |j| (QSADD1 |j|) . #2#)
                                        #4# G191 (EXIT NIL))
                                       (EXIT (CONS 0 |sol|)))))))))))))) 

(DEFUN |LSMP;solve;MColR;6| (A |b| $)
  (PROG (|m|)
    (RETURN
      (SEQ (COND
             ((SPADCALL (ELT $ 26) |b| (QREFELT $ 40))
              (CONS (CONS 0
                          (SPADCALL (SPADCALL A (QREFELT $ 21))
                              (|spadConstant| $ 30) (QREFELT $ 31)))
                    (SPADCALL A (QREFELT $ 42))))
             ('T
              (SEQ (LETT |m|
                         (SPADCALL (|LSMP;systemMatrix| A |b| $)
                             (QREFELT $ 18))
                         |LSMP;solve;MColR;6|)
                   (EXIT (CONS (|LSMP;aSolution| |m| $)
                               (SPADCALL
                                   (SPADCALL |m|
                                    (SPADCALL |m| (QREFELT $ 25))
                                    (SPADCALL |m| (QREFELT $ 24))
                                    (SPADCALL |m| (QREFELT $ 32))
                                    (- (SPADCALL |m| (QREFELT $ 33)) 1)
                                    (QREFELT $ 43))
                                   (QREFELT $ 42))))))))))) 

(DEFUN |LSMP;solve;MLL;7| (A |l| $)
  (PROG (|sol0| |nl| #0=#:G1867 |b| #1=#:G1868)
    (RETURN
      (SEQ (COND
             ((NULL |l|)
              (LIST (CONS (CONS 0
                                (SPADCALL (SPADCALL A (QREFELT $ 21))
                                    (|spadConstant| $ 30)
                                    (QREFELT $ 31)))
                          (SPADCALL A (QREFELT $ 42)))))
             ('T
              (SEQ (LETT |nl|
                         (QCDR (LETT |sol0|
                                     (SPADCALL A (|SPADfirst| |l|)
                                      (QREFELT $ 45))
                                     . #2=(|LSMP;solve;MLL;7|))) . #2#)
                   (EXIT (CONS |sol0|
                               (PROGN
                                 (LETT #0# NIL . #2#)
                                 (SEQ (LETT |b| NIL . #2#)
                                      (LETT #1# (CDR |l|) . #2#) G190
                                      (COND
                                        ((OR (ATOM #1#)
                                          (PROGN
                                            (LETT |b| (CAR #1#) . #2#)
                                            NIL))
                                         (GO G191)))
                                      (SEQ
                                       (EXIT
                                        (LETT #0#
                                         (CONS
                                          (CONS
                                           (|LSMP;aSolution|
                                            (SPADCALL
                                             (|LSMP;systemMatrix| A |b|
                                              $)
                                             (QREFELT $ 18))
                                            $)
                                           |nl|)
                                          #0#) . #2#)))
                                      (LETT #1# (CDR #1#) . #2#)
                                      (GO G190) G191
                                      (EXIT (NREVERSE0 #0#))))))))))))) 

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

(DEFUN |LinearSystemMatrixPackage;| (|#1| |#2| |#3| |#4|)
  (PROG (DV$1 DV$2 DV$3 DV$4 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|LinearSystemMatrixPackage|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT |dv$|
              (LIST '|LinearSystemMatrixPackage| DV$1 DV$2 DV$3 DV$4) . #0#)
        (LETT $ (GETREFV 48) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|LinearSystemMatrixPackage|
            (LIST DV$1 DV$2 DV$3 DV$4) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 |#3|)
        (QSETREFV $ 9 |#4|)
        $)))) 

(MAKEPROP '|LinearSystemMatrixPackage| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) (|NonNegativeInteger|)
             (0 . |rank|) (|Boolean|) |LSMP;hasSolution?;MColB;1|
             (5 . |coerce|) (10 . -) (15 . |horizConcat|)
             |LSMP;rank;MColNni;3| (21 . |rowEchelon|)
             (|Union| 8 '"failed") |LSMP;particularSolution;MColU;4|
             (26 . |ncols|) (31 . |One|) (|Integer|)
             (35 . |maxRowIndex|) (40 . |minRowIndex|) (45 . |zero?|)
             (50 . |row|) (|Mapping| 12 6) (56 . |every?|)
             (62 . |Zero|) (66 . |new|) (72 . |minColIndex|)
             (77 . |maxColIndex|) (82 . |qelt|) (|PrimitiveArray| 23)
             (89 . |new|) (95 . |minIndex|) (100 . -)
             (105 . |qsetelt!|) (112 . |every?|) (|List| 8)
             (118 . |nullSpace|) (123 . |subMatrix|)
             (|Record| (|:| |particular| 19) (|:| |basis| 41))
             |LSMP;solve;MColR;6| (|List| 44) |LSMP;solve;MLL;7|)
          '#(|solve| 132 |rank| 144 |particularSolution| 150
             |hasSolution?| 156)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 47
                                '(1 9 10 0 11 1 9 0 8 14 1 9 0 0 15 2 9
                                  0 0 0 16 1 9 0 0 18 1 9 10 0 21 0 6 0
                                  22 1 9 23 0 24 1 9 23 0 25 1 6 12 0
                                  26 2 9 7 0 23 27 2 7 12 28 0 29 0 6 0
                                  30 2 8 0 10 6 31 1 9 23 0 32 1 9 23 0
                                  33 3 9 6 0 23 23 34 2 35 0 10 23 36 1
                                  8 23 0 37 1 6 0 0 38 3 8 6 0 23 6 39
                                  2 8 12 28 0 40 1 9 41 0 42 5 9 0 0 23
                                  23 23 23 43 2 0 46 9 41 47 2 0 44 9 8
                                  45 2 0 10 9 8 17 2 0 19 9 8 20 2 0 12
                                  9 8 13)))))
          '|lookupComplete|)) 
