
(/VERSIONCHECK 2) 

(DEFUN |LSPP;poly2vect| (|p| |vs| $)
  (PROG (|c| |u| #1=#:G1814 |v| |i| |coefs|)
    (RETURN
     (SEQ
      (LETT |coefs| (MAKEARR1 (LENGTH |vs|) (|spadConstant| $ 11))
            . #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| $ 14) (QREFELT $ 16)) 'NIL)
                   ('T 'T))))
             (GO G191)))
           (SEQ (LETT |u| (SPADCALL |p| |v| (QREFELT $ 18)) . #2#)
                (EXIT
                 (COND ((EQL (SPADCALL |u| (QREFELT $ 21)) 0) "next v")
                       ('T
                        (SEQ
                         (SPADCALL |coefs| |i|
                                   (SPADCALL
                                    (LETT |c| (SPADCALL |u| (QREFELT $ 22))
                                          . #2#)
                                    (QREFELT $ 23))
                                   (QREFELT $ 26))
                         (EXIT
                          (LETT |p|
                                (SPADCALL |p|
                                          (SPADCALL |c| |v| 1 (QREFELT $ 29))
                                          (QREFELT $ 30))
                                . #2#)))))))
           (LETT #1# (PROG1 (CDR #1#) (LETT |i| (QSADD1 |i|) . #2#)) . #2#)
           (GO G190) G191 (EXIT NIL))
      (EXIT (CONS |coefs| (SPADCALL |p| (QREFELT $ 23)))))))) 

(DEFUN |LSPP;intoMatrix| (|ps| |vs| $)
  (PROG (|m| |r| #1=#:G1822 |p| |i| |v|)
    (RETURN
     (SEQ
      (LETT |m| (SPADCALL (LENGTH |ps|) (LENGTH |vs|) (QREFELT $ 32))
            . #2=(|LSPP;intoMatrix|))
      (LETT |v| (MAKEARR1 (LENGTH |ps|) (|spadConstant| $ 11)) . #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 $ 35)))
               (|error| "The system is not linear"))
              ('T
               (SEQ (LETT |r| (|LSPP;poly2vect| |p| |vs| $) . #2#)
                    (LETT |m| (SPADCALL |m| |i| (QCAR |r|) (QREFELT $ 36))
                          . #2#)
                    (EXIT
                     (SPADCALL |v| |i| (SPADCALL (QCDR |r|) (QREFELT $ 37))
                               (QREFELT $ 26))))))))
           (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 $ 41))))))) 

(DEFUN |LinearSystemPolynomialPackage| (&REST #1=#:G1831)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1832)
       (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 44) . #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|)
              (4 . |Zero|) (8 . |Zero|) (12 . |Zero|) (|Boolean|) (16 . =)
              (|SparseUnivariatePolynomial| $) (22 . |univariate|)
              (|NonNegativeInteger|) (|SparseUnivariatePolynomial| 9)
              (28 . |degree|) (33 . |leadingCoefficient|) (38 . |coerce|)
              (|Integer|) (|Vector| 10) (43 . |setelt|) (50 . |One|)
              (54 . |One|) (58 . |monomial|) (65 . -) (|Matrix| 10)
              (71 . |zero|) (77 . |One|) (|List| 8) (81 . |totalDegree|)
              (87 . |setRow!|) (94 . -) (|Union| 25 '"failed")
              (|Record| (|:| |particular| 38) (|:| |basis| (|List| 25)))
              (|LinearSystemMatrixPackage| 10 25 25 31) (99 . |solve|)
              (|List| 9) |LSPP;linSolve;LLR;3|)
           '#(|linSolve| 105) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 43
                                                 '(0 10 0 11 0 6 0 12 0 7 0 13
                                                   0 9 0 14 2 9 15 0 0 16 2 9
                                                   17 0 8 18 1 20 19 0 21 1 20
                                                   9 0 22 1 10 0 9 23 3 25 10 0
                                                   24 10 26 0 6 0 27 0 9 0 28 3
                                                   9 0 0 8 19 29 2 9 0 0 0 30 2
                                                   31 0 19 19 32 0 10 0 33 2 9
                                                   19 0 34 35 3 31 0 0 24 25 36
                                                   1 10 0 0 37 2 40 39 31 25 41
                                                   2 0 39 42 34 43)))))
           '|lookupComplete|)) 
