
(/VERSIONCHECK 2) 

(DEFUN |IMATRIX;swapRows!;$2I$;1| (|x| |i1| |i2| $)
  (PROG (|row1| |n2| |n1| |xx| |minRow|)
    (RETURN
     (SEQ
      (COND
       ((OR (< |i1| (SPADCALL |x| (QREFELT $ 10)))
            (OR (< (SPADCALL |x| (QREFELT $ 11)) |i1|)
                (OR (< |i2| (SPADCALL |x| (QREFELT $ 10)))
                    (< (SPADCALL |x| (QREFELT $ 11)) |i2|))))
        (|error| "swapRows!: index out of range"))
       ('T
        (COND ((EQL |i1| |i2|) |x|)
              ('T
               (SEQ
                (LETT |minRow| (SPADCALL |x| (QREFELT $ 10))
                      . #1=(|IMATRIX;swapRows!;$2I$;1|))
                (LETT |xx| |x| . #1#) (LETT |n1| (- |i1| |minRow|) . #1#)
                (LETT |n2| (- |i2| |minRow|) . #1#)
                (LETT |row1| (ELT |xx| |n1|) . #1#)
                (SETELT |xx| |n1| (ELT |xx| |n2|)) (SETELT |xx| |n2| |row1|)
                (EXIT |xx|)))))))))) 

(DEFUN |IMATRIX;determinant;$R;2| (|x| $) (SPADCALL |x| (QREFELT $ 14))) 

(DEFUN |IMATRIX;minordet;$R;3| (|x| $) (SPADCALL |x| (QREFELT $ 16))) 

(DEFUN |IMATRIX;rowEchelon;2$;4| (|x| $) (SPADCALL |x| (QREFELT $ 18))) 

(DEFUN |IMATRIX;rank;$Nni;5| (|x| $) (SPADCALL |x| (QREFELT $ 21))) 

(DEFUN |IMATRIX;nullity;$Nni;6| (|x| $) (SPADCALL |x| (QREFELT $ 23))) 

(DEFUN |IMATRIX;nullSpace;$L;7| (|x| $) (SPADCALL |x| (QREFELT $ 26))) 

(DEFUN |IMATRIX;inverse;$U;8| (|x| $) (SPADCALL |x| (QREFELT $ 29))) 

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

(DEFUN |IndexedMatrix;| (|#1| |#2| |#3|)
  (PROG (|pv$| #1=#:G692 $ |dv$| DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #2=(|IndexedMatrix|))
      (LETT DV$2 (|devaluate| |#2|) . #2#)
      (LETT DV$3 (|devaluate| |#3|) . #2#)
      (LETT |dv$| (LIST '|IndexedMatrix| DV$1 DV$2 DV$3) . #2#)
      (LETT $ (GETREFV 47) . #2#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST
                                          (LETT #1#
                                                (|HasCategory| |#1|
                                                               '(|SetCategory|))
                                                . #2#)
                                          (AND #1#
                                               (|HasCategory| |#1|
                                                              (LIST '|Evalable|
                                                                    (|devaluate|
                                                                     |#1|))))
                                          (|HasCategory| |#1|
                                                         '(|EuclideanDomain|))
                                          (|HasCategory| |#1|
                                                         '(|IntegralDomain|))
                                          (|HasCategory| |#1|
                                                         '(|CommutativeRing|))
                                          (|HasCategory| |#1| '(|Field|))))
                      . #2#))
      (|haddProp| |$ConstructorCache| '|IndexedMatrix| (LIST DV$1 DV$2 DV$3)
                  (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (AND (|HasCategory| $ '(|finiteAggregate|)) (|augmentPredVector| $ 64))
      (AND (|HasCategory| $ '(|finiteAggregate|)) #1#
           (|augmentPredVector| $ 128))
      (COND
       ((|testBitVector| |pv$| 5)
        (PROGN
         (QSETREFV $ 15
                   (CONS (|dispatchFunction| |IMATRIX;determinant;$R;2|) $))
         (QSETREFV $ 17
                   (CONS (|dispatchFunction| |IMATRIX;minordet;$R;3|) $)))))
      (COND
       ((|testBitVector| |pv$| 3)
        (QSETREFV $ 19
                  (CONS (|dispatchFunction| |IMATRIX;rowEchelon;2$;4|) $))))
      (COND
       ((|testBitVector| |pv$| 4)
        (PROGN
         (QSETREFV $ 22 (CONS (|dispatchFunction| |IMATRIX;rank;$Nni;5|) $))
         (QSETREFV $ 24 (CONS (|dispatchFunction| |IMATRIX;nullity;$Nni;6|) $))
         (QSETREFV $ 27
                   (CONS (|dispatchFunction| |IMATRIX;nullSpace;$L;7|) $)))))
      (COND
       ((|testBitVector| |pv$| 6)
        (QSETREFV $ 31 (CONS (|dispatchFunction| |IMATRIX;inverse;$U;8|) $))))
      $)))) 

(MAKEPROP '|IndexedMatrix| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL
              (|InnerIndexedTwoDimensionalArray| 6 7 8 40 41) (|local| |#1|)
              (|local| |#2|) (|local| |#3|) (|Integer|) (0 . |minRowIndex|)
              (5 . |maxRowIndex|) |IMATRIX;swapRows!;$2I$;1|
              (|MatrixLinearAlgebraFunctions| 6 40 41 $$) (10 . |determinant|)
              (15 . |determinant|) (20 . |minordet|) (25 . |minordet|)
              (30 . |rowEchelon|) (35 . |rowEchelon|) (|NonNegativeInteger|)
              (40 . |rank|) (45 . |rank|) (50 . |nullity|) (55 . |nullity|)
              (|List| 41) (60 . |nullSpace|) (65 . |nullSpace|)
              (|Union| $$ '"failed") (70 . |inverse|) (|Union| $ '"failed")
              (75 . |inverse|) (|Boolean|) (|List| 6) (|Equation| 6)
              (|List| 34) (|Mapping| 32 6) (|SingleInteger|) (|OutputForm|)
              (|String|) (|IndexedVector| 6 8) (|IndexedVector| 6 7) (|List| 9)
              (|List| 33) (|List| $) (|Mapping| 6 6 6) (|Mapping| 6 6))
           '#(|swapRows!| 80 |rowEchelon| 87 |rank| 92 |nullity| 97 |nullSpace|
              102 |minordet| 107 |minRowIndex| 112 |maxRowIndex| 117 |inverse|
              122 |determinant| 127)
           'NIL
           (CONS (|makeByteWordVec2| 2 '(0 0 0 0 2 1 0 0 0 2 1 1))
                 (CONS
                  '#(|MatrixCategory&| |TwoDimensionalArrayCategory&|
                     |HomogeneousAggregate&| |Aggregate&| |Evalable&|
                     |SetCategory&| NIL NIL NIL |InnerEvalable&| |BasicType&|
                     NIL)
                  (CONS
                   '#((|MatrixCategory| 6 (|IndexedVector| 6 8)
                                        (|IndexedVector| 6 7))
                      (|TwoDimensionalArrayCategory| 6 (|IndexedVector| 6 8)
                                                     (|IndexedVector| 6 7))
                      (|HomogeneousAggregate| 6) (|Aggregate|) (|Evalable| 6)
                      (|SetCategory|) (|Type|) (|finiteAggregate|)
                      (|shallowlyMutable|) (|InnerEvalable| 6 6) (|BasicType|)
                      (|CoercibleTo| 38))
                   (|makeByteWordVec2| 31
                                       '(1 0 9 0 10 1 0 9 0 11 1 13 6 2 14 1 0
                                         6 0 15 1 13 6 2 16 1 0 6 0 17 1 13 2 2
                                         18 1 0 0 0 19 1 13 20 2 21 1 0 20 0 22
                                         1 13 20 2 23 1 0 20 0 24 1 13 25 2 26
                                         1 0 25 0 27 1 13 28 2 29 1 0 30 0 31 3
                                         0 0 0 9 9 12 1 3 0 0 19 1 4 20 0 22 1
                                         4 20 0 24 1 4 25 0 27 1 5 6 0 17 1 0 9
                                         0 10 1 0 9 0 11 1 6 30 0 31 1 5 6 0
                                         15)))))
           '|lookupIncomplete|)) 
