
(/VERSIONCHECK 2) 

(DEFUN |LSPP;poly2vect| (|p| |vs| $)
  (PROG (|c| |u| #1=#:G670 |v| |i| |coefs|)
    (RETURN
     (SEQ
      (LETT |coefs|
            (SPADCALL (LENGTH |vs|) (|spadConstant| $ 11) (QREFELT $ 14))
            . #2=(|LSPP;poly2vect|))
      (SEQ (LETT |i| 1 . #2#) (LETT |v| NIL . #2#) (LETT #1# |vs| . #2#) G190
           (COND
            ((OR (ATOM #1#) (PROGN (LETT |v| (CAR #1#) . #2#) NIL)
                 (NULL
                  (COND
                   ((SPADCALL |p| (|spadConstant| $ 17) (QREFELT $ 19)) 'NIL)
                   ('T 'T))))
             (GO G191)))
           (SEQ (LETT |u| (SPADCALL |p| |v| (QREFELT $ 21)) . #2#)
                (EXIT
                 (COND ((EQL (SPADCALL |u| (QREFELT $ 23)) 0) "next v")
                       ('T
                        (SEQ
                         (SPADCALL |coefs| |i|
                                   (SPADCALL
                                    (LETT |c| (SPADCALL |u| (QREFELT $ 24))
                                          . #2#)
                                    (QREFELT $ 25))
                                   (QREFELT $ 27))
                         (EXIT
                          (LETT |p|
                                (SPADCALL |p|
                                          (SPADCALL |c| |v| 1 (QREFELT $ 30))
                                          (QREFELT $ 31))
                                . #2#)))))))
           (LETT #1# (PROG1 (CDR #1#) (LETT |i| (QSADD1 |i|) . #2#)) . #2#)
           (GO G190) G191 (EXIT NIL))
      (EXIT (CONS |coefs| (SPADCALL |p| (QREFELT $ 25)))))))) 

(DEFUN |LSPP;intoMatrix| (|ps| |vs| $)
  (PROG (|m| |r| #1=#:G677 |p| |i| |v|)
    (RETURN
     (SEQ
      (LETT |m| (SPADCALL (LENGTH |ps|) (LENGTH |vs|) (QREFELT $ 33))
            . #2=(|LSPP;intoMatrix|))
      (LETT |v| (SPADCALL (LENGTH |ps|) (|spadConstant| $ 11) (QREFELT $ 14))
            . #2#)
      (SEQ (LETT |i| 1 . #2#) (LETT |p| NIL . #2#) (LETT #1# |ps| . #2#) G190
           (COND
            ((OR (ATOM #1#) (PROGN (LETT |p| (CAR #1#) . #2#) NIL)) (GO G191)))
           (SEQ
            (EXIT
             (COND
              ((< 1 (SPADCALL |p| |vs| (QREFELT $ 36)))
               (|error| "The system is not linear"))
              ('T
               (SEQ (LETT |r| (|LSPP;poly2vect| |p| |vs| $) . #2#)
                    (LETT |m| (SPADCALL |m| |i| (QCAR |r|) (QREFELT $ 37))
                          . #2#)
                    (EXIT
                     (SPADCALL |v| |i| (SPADCALL (QCDR |r|) (QREFELT $ 38))
                               (QREFELT $ 27))))))))
           (LETT #1# (PROG1 (CDR #1#) (LETT |i| (QSADD1 |i|) . #2#)) . #2#)
           (GO G190) G191 (EXIT NIL))
      (EXIT (CONS |m| |v|)))))) 

(DEFUN |LSPP;linSolve;LLR;3| (|ps| |vs| $)
  (PROG (|r|)
    (RETURN
     (SEQ (LETT |r| (|LSPP;intoMatrix| |ps| |vs| $) |LSPP;linSolve;LLR;3|)
          (EXIT (SPADCALL (QCAR |r|) (QCDR |r|) (QREFELT $ 42))))))) 

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

(DEFUN |LinearSystemPolynomialPackage;| (|#1| |#2| |#3| |#4|)
  (PROG (|pv$| $ |dv$| DV$4 DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|LinearSystemPolynomialPackage|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT DV$4 (|devaluate| |#4|) . #1#)
      (LETT |dv$| (LIST '|LinearSystemPolynomialPackage| DV$1 DV$2 DV$3 DV$4)
            . #1#)
      (LETT $ (GETREFV 45) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|LinearSystemPolynomialPackage|
                  (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 '|LinearSystemPolynomialPackage| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (|local| |#3|) (|local| |#4|) (|Fraction| 9) (0 . |Zero|)
              (|NonNegativeInteger|) (|Vector| 10) (4 . |new|) (10 . |Zero|)
              (14 . |Zero|) (18 . |Zero|) (|Boolean|) (22 . =)
              (|SparseUnivariatePolynomial| $) (28 . |univariate|)
              (|SparseUnivariatePolynomial| 9) (34 . |degree|)
              (39 . |leadingCoefficient|) (44 . |coerce|) (|Integer|)
              (49 . |setelt|) (56 . |One|) (60 . |One|) (64 . |monomial|)
              (71 . -) (|Matrix| 10) (77 . |zero|) (83 . |One|) (|List| 8)
              (87 . |totalDegree|) (93 . |setRow!|) (100 . -)
              (|Union| 13 '"failed")
              (|Record| (|:| |particular| 39) (|:| |basis| (|List| 13)))
              (|LinearSystemMatrixPackage| 10 13 13 32) (105 . |solve|)
              (|List| 9) |LSPP;linSolve;LLR;3|)
           '#(|linSolve| 111) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 44
                                                 '(0 10 0 11 2 13 0 12 10 14 0
                                                   6 0 15 0 7 0 16 0 9 0 17 2 9
                                                   18 0 0 19 2 9 20 0 8 21 1 22
                                                   12 0 23 1 22 9 0 24 1 10 0 9
                                                   25 3 13 10 0 26 10 27 0 6 0
                                                   28 0 9 0 29 3 9 0 0 8 12 30
                                                   2 9 0 0 0 31 2 32 0 12 12 33
                                                   0 10 0 34 2 9 12 0 35 36 3
                                                   32 0 0 26 13 37 1 10 0 0 38
                                                   2 41 40 32 13 42 2 0 40 43
                                                   35 44)))))
           '|lookupComplete|)) 
