
(/VERSIONCHECK 2) 

(DEFUN |SCPKG;matrix2Vector| (|m| $)
  (PROG (|lili| |li|)
    (RETURN
      (SEQ (LETT |lili| (SPADCALL |m| (QREFELT $ 9))
                 . #0=(|SCPKG;matrix2Vector|))
           (LETT |li|
                 (SPADCALL (ELT $ 11) |lili| (QREFELT $ 13)) . #0#)
           (EXIT (SPADCALL |li| (QREFELT $ 15))))))) 

(DEFUN |SCPKG;coordinates;MLV;2| (|x| |b| $)
  (PROG (#0=#:G1828 |m| |n| |transitionMatrix| |i| |res| #1=#:G1837)
    (RETURN
      (SEQ (LETT |m|
                 (PROG1 (LETT #0# (SPADCALL |b| (QREFELT $ 18))
                              . #2=(|SCPKG;coordinates;MLV;2|))
                   (|check-subtype| (>= #0# 0) '(|NonNegativeInteger|)
                       #0#)) . #2#)
           (LETT |n|
                 (* (SPADCALL (SPADCALL |b| 1 (QREFELT $ 20))
                        (QREFELT $ 22))
                    (SPADCALL (SPADCALL |b| 1 (QREFELT $ 20))
                        (QREFELT $ 23))) . #2#)
           (LETT |transitionMatrix|
                 (SPADCALL |n| |m| (|spadConstant| $ 24)
                     (QREFELT $ 25)) . #2#)
           (SEQ (LETT |i| 1 . #2#) G190
                (COND ((QSGREATERP |i| |m|) (GO G191)))
                (SEQ (EXIT (SPADCALL |transitionMatrix| |i|
                               (|SCPKG;matrix2Vector|
                                   (SPADCALL |b| |i| (QREFELT $ 20)) $)
                               (QREFELT $ 26))))
                (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191
                (EXIT NIL))
           (LETT |res|
                 (SPADCALL |transitionMatrix|
                     (|SCPKG;matrix2Vector| |x| $) (QREFELT $ 30)) . #2#)
           (COND
             ((NULL (NULL (QCDR |res|)))
              (|error| "coordinates: the second argument is linearly dependent")))
           (EXIT (COND
                   ((QEQCAR (QCAR |res|) 1)
                    (|error| "coordinates: first argument is not in linear span of second argument"))
                   ('T
                    (PROG2 (LETT #1# (QCAR |res|) . #2#) (QCDR #1#)
                      (|check-union| (QEQCAR #1# 0)
                          (|Vector| (QREFELT $ 6)) #1#))))))))) 

(DEFUN |SCPKG;structuralConstants;LV;3| (|b| $)
  (PROG (#0=#:G1841 |m| #1=#:G1849 #2=#:G1850 |sC| |i| |j| |covec| |k|)
    (RETURN
      (SEQ (LETT |m|
                 (PROG1 (LETT #0# (SPADCALL |b| (QREFELT $ 18))
                              . #3=(|SCPKG;structuralConstants;LV;3|))
                   (|check-subtype| (>= #0# 0) '(|NonNegativeInteger|)
                       #0#)) . #3#)
           (LETT |sC|
                 (PRIMVEC2ARR
                     (PROGN
                       (LETT #1# (GETREFV |m|) . #3#)
                       (SEQ (LETT #2# 0 . #3#) (LETT |k| 1 . #3#) G190
                            (COND ((QSGREATERP |k| |m|) #4=(GO G191)))
                            (SEQ (EXIT (SETELT #1# #2#
                                        (SPADCALL |m| |m|
                                         (|spadConstant| $ 24)
                                         (QREFELT $ 25)))))
                            (LETT |k|
                                  (PROG1 (QSADD1 |k|)
                                    (LETT #2# (QSADD1 #2#) . #3#)) . #3#)
                            #5=(GO G190) G191 (EXIT NIL))
                       #1#)) . #3#)
           (SEQ (LETT |i| 1 . #3#) G190
                (COND ((QSGREATERP |i| |m|) #4#))
                (SEQ (EXIT (SEQ (LETT |j| 1 . #3#) G190
                                (COND ((QSGREATERP |j| |m|) #4#))
                                (SEQ (LETT |covec|
                                      (SPADCALL
                                       (SPADCALL
                                        (SPADCALL |b| |i|
                                         (QREFELT $ 20))
                                        (SPADCALL |b| |j|
                                         (QREFELT $ 20))
                                        (QREFELT $ 32))
                                       |b| (QREFELT $ 31)) . #3#)
                                     (EXIT
                                      (SEQ (LETT |k| 1 . #3#) G190
                                       (COND
                                         ((QSGREATERP |k| |m|) #4#))
                                       (SEQ
                                        (EXIT
                                         (SPADCALL
                                          (SPADCALL |sC| |k|
                                           (QREFELT $ 34))
                                          |i| |j|
                                          (SPADCALL |covec| |k|
                                           (QREFELT $ 35))
                                          (QREFELT $ 36))))
                                       (LETT |k| (QSADD1 |k|) . #3#)
                                       #5# G191 (EXIT NIL))))
                                (LETT |j| (QSADD1 |j|) . #3#) #5# G191
                                (EXIT NIL))))
                (LETT |i| (QSADD1 |i|) . #3#) #5# G191 (EXIT NIL))
           (EXIT |sC|))))) 

(DEFUN |SCPKG;structuralConstants;LMV;4| (|ls| |mt| $)
  (PROG (|nn| |mat| |s| |i| |j| |p| |c| |gamma| |lscopy|)
    (RETURN
      (SEQ (LETT |nn| (LENGTH |ls|)
                 . #0=(|SCPKG;structuralConstants;LMV;4|))
           (COND
             ((EQL (SPADCALL |mt| (QREFELT $ 39)) |nn|)
              (COND
                ((NULL (EQL (SPADCALL |mt| (QREFELT $ 40)) |nn|))
                 (EXIT (|error| "structuralConstants: size of second argument does not agree with number of generators")))))
             ('T
              (EXIT (|error| "structuralConstants: size of second argument does not agree with number of generators"))))
           (LETT |gamma| NIL . #0#)
           (LETT |lscopy| (SPADCALL |ls| (QREFELT $ 42)) . #0#)
           (SEQ G190
                (COND
                  ((NULL (COND ((NULL |lscopy|) 'NIL) ('T 'T)))
                   #1=(GO G191)))
                (SEQ (LETT |mat|
                           (SPADCALL |nn| |nn| (|spadConstant| $ 44)
                               (QREFELT $ 45)) . #0#)
                     (LETT |s| (|SPADfirst| |lscopy|) . #0#)
                     (SEQ (LETT |i| 1 . #0#) G190
                          (COND ((QSGREATERP |i| |nn|) #1#))
                          (SEQ (EXIT (SEQ (LETT |j| 1 . #0#) G190
                                      (COND
                                        ((QSGREATERP |j| |nn|) #1#))
                                      (SEQ
                                       (LETT |p|
                                        (SPADCALL |mt| |i| |j|
                                         (QREFELT $ 46)) . #0#)
                                       (EXIT
                                        (COND
                                          ((< 1
                                            (SPADCALL |p| |ls|
                                             (QREFELT $ 48)))
                                           (|error|
                                            "structuralConstants: entries of second argument must be linear polynomials in the generators"))
                                          ('T
                                           (SEQ
                                            (LETT |c|
                                             (SPADCALL |p| |s| 1
                                              (QREFELT $ 50)) . #0#)
                                            (EXIT
                                             (COND
                                               ((NULL
                                                 (SPADCALL |c|
                                                  (|spadConstant| $ 44)
                                                  (QREFELT $ 52)))
                                                (SPADCALL |mat| |i| |j|
                                                 |c| (QREFELT $ 53))))))))))
                                      (LETT |j| (QSADD1 |j|) . #0#)
                                      #2=(GO G190) G191 (EXIT NIL))))
                          (LETT |i| (QSADD1 |i|) . #0#) #2# G191
                          (EXIT NIL))
                     (LETT |gamma| (CONS |mat| |gamma|) . #0#)
                     (EXIT (LETT |lscopy| (CDR |lscopy|) . #0#)))
                NIL #2# G191 (EXIT NIL))
           (EXIT (SPADCALL (REVERSE |gamma|) (QREFELT $ 56))))))) 

(DEFUN |SCPKG;structuralConstants;LMV;5| (|ls| |mt| $)
  (PROG (|nn| |mat| |s| |i| |j| |r| |q| |p| |c| |gamma| |lscopy|)
    (RETURN
      (SEQ (LETT |nn| (LENGTH |ls|)
                 . #0=(|SCPKG;structuralConstants;LMV;5|))
           (COND
             ((EQL (SPADCALL |mt| (QREFELT $ 59)) |nn|)
              (COND
                ((NULL (EQL (SPADCALL |mt| (QREFELT $ 60)) |nn|))
                 (EXIT (|error| "structuralConstants: size of second argument does not agree with number of generators")))))
             ('T
              (EXIT (|error| "structuralConstants: size of second argument does not agree with number of generators"))))
           (LETT |gamma| NIL . #0#)
           (LETT |lscopy| (SPADCALL |ls| (QREFELT $ 42)) . #0#)
           (SEQ G190
                (COND
                  ((NULL (COND ((NULL |lscopy|) 'NIL) ('T 'T)))
                   #1=(GO G191)))
                (SEQ (LETT |mat|
                           (SPADCALL |nn| |nn| (|spadConstant| $ 62)
                               (QREFELT $ 63)) . #0#)
                     (LETT |s| (|SPADfirst| |lscopy|) . #0#)
                     (SEQ (LETT |i| 1 . #0#) G190
                          (COND ((QSGREATERP |i| |nn|) #1#))
                          (SEQ (EXIT (SEQ (LETT |j| 1 . #0#) G190
                                      (COND
                                        ((QSGREATERP |j| |nn|) #1#))
                                      (SEQ
                                       (LETT |r|
                                        (SPADCALL |mt| |i| |j|
                                         (QREFELT $ 64)) . #0#)
                                       (LETT |q|
                                        (SPADCALL |r| (QREFELT $ 65)) . #0#)
                                       (COND
                                         ((NULL
                                           (EQL
                                            (SPADCALL |q| |ls|
                                             (QREFELT $ 48))
                                            0))
                                          (EXIT
                                           (|error|
                                            "structuralConstants: entries of second argument must be (linear) polynomials in the generators"))))
                                       (LETT |p|
                                        (SPADCALL |r| (QREFELT $ 66)) . #0#)
                                       (EXIT
                                        (COND
                                          ((< 1
                                            (SPADCALL |p| |ls|
                                             (QREFELT $ 48)))
                                           (|error|
                                            "structuralConstants: entries of second argument must be linear polynomials in the generators"))
                                          ('T
                                           (SEQ
                                            (LETT |c|
                                             (SPADCALL |p| |s| 1
                                              (QREFELT $ 50)) . #0#)
                                            (EXIT
                                             (COND
                                               ((NULL
                                                 (SPADCALL |c|
                                                  (|spadConstant| $ 44)
                                                  (QREFELT $ 52)))
                                                (SPADCALL |mat| |i| |j|
                                                 (SPADCALL |c| |q|
                                                  (QREFELT $ 68))
                                                 (QREFELT $ 69))))))))))
                                      (LETT |j| (QSADD1 |j|) . #0#)
                                      #2=(GO G190) G191 (EXIT NIL))))
                          (LETT |i| (QSADD1 |i|) . #0#) #2# G191
                          (EXIT NIL))
                     (LETT |gamma| (CONS |mat| |gamma|) . #0#)
                     (EXIT (LETT |lscopy| (CDR |lscopy|) . #0#)))
                NIL #2# G191 (EXIT NIL))
           (EXIT (SPADCALL (REVERSE |gamma|) (QREFELT $ 72))))))) 

(DEFUN |StructuralConstantsPackage| (#0=#:G1872)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1873)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (LIST (|devaluate| #0#))
                       (HGET |$ConstructorCache|
                             '|StructuralConstantsPackage|)
                       '|domainEqualList|)
                   . #2=(|StructuralConstantsPackage|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (|StructuralConstantsPackage;| #0#)
                 (LETT #1# T . #2#))
               (COND
                 ((NOT #1#)
                  (HREM |$ConstructorCache|
                        '|StructuralConstantsPackage|))))))))))) 

(DEFUN |StructuralConstantsPackage;| (|#1|)
  (PROG (DV$1 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|StructuralConstantsPackage|))
        (LETT |dv$| (LIST '|StructuralConstantsPackage| DV$1) . #0#)
        (LETT $ (GETREFV 74) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|StructuralConstantsPackage|
            (LIST DV$1) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        $)))) 

(MAKEPROP '|StructuralConstantsPackage| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|List| 10)
             (|Matrix| 6) (0 . |listOfLists|) (|List| 6) (5 . |concat|)
             (|Mapping| 10 10 10) (11 . |reduce|) (|Vector| 6)
             (17 . |construct|) (|Integer|) (|List| 8)
             (22 . |maxIndex|) (27 . |One|) (31 . |elt|)
             (|NonNegativeInteger|) (37 . |nrows|) (42 . |ncols|)
             (47 . |Zero|) (51 . |new|) (58 . |setColumn!|)
             (|Union| 14 '"failed")
             (|Record| (|:| |particular| 27) (|:| |basis| (|List| 14)))
             (|LinearSystemMatrixPackage| 6 14 14 8) (65 . |solve|)
             |SCPKG;coordinates;MLV;2| (71 . *) (|Vector| 8)
             (77 . |elt|) (83 . |elt|) (89 . |setelt|)
             |SCPKG;structuralConstants;LV;3| (|Matrix| 43)
             (97 . |nrows|) (102 . |ncols|) (|List| 49) (107 . |copy|)
             (|Polynomial| 6) (112 . |Zero|) (116 . |new|)
             (123 . |qelt|) (130 . |One|) (134 . |totalDegree|)
             (|Symbol|) (140 . |coefficient|) (|Boolean|) (147 . =)
             (153 . |qsetelt!|) (|List| 38) (|Vector| 38)
             (161 . |vector|) |SCPKG;structuralConstants;LMV;4|
             (|Matrix| 61) (166 . |nrows|) (171 . |ncols|)
             (|Fraction| 43) (176 . |Zero|) (180 . |new|)
             (187 . |qelt|) (194 . |denom|) (199 . |numer|)
             (204 . |One|) (208 . /) (214 . |qsetelt!|) (|List| 58)
             (|Vector| 58) (222 . |vector|)
             |SCPKG;structuralConstants;LMV;5|)
          '#(|structuralConstants| 227 |coordinates| 244) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 73
                                '(1 8 7 0 9 2 10 0 0 0 11 2 7 10 12 0
                                  13 1 14 0 10 15 1 17 16 0 18 0 6 0 19
                                  2 17 8 0 16 20 1 8 21 0 22 1 8 21 0
                                  23 0 6 0 24 3 8 0 21 21 6 25 3 8 0 0
                                  16 14 26 2 29 28 8 14 30 2 8 0 0 0 32
                                  2 33 8 0 16 34 2 14 6 0 16 35 4 8 6 0
                                  16 16 6 36 1 38 21 0 39 1 38 21 0 40
                                  1 41 0 0 42 0 43 0 44 3 38 0 21 21 43
                                  45 3 38 43 0 16 16 46 0 43 0 47 2 43
                                  21 0 41 48 3 43 0 0 49 21 50 2 43 51
                                  0 0 52 4 38 43 0 16 16 43 53 1 55 0
                                  54 56 1 58 21 0 59 1 58 21 0 60 0 61
                                  0 62 3 58 0 21 21 61 63 3 58 61 0 16
                                  16 64 1 61 43 0 65 1 61 43 0 66 0 61
                                  0 67 2 61 0 43 43 68 4 58 61 0 16 16
                                  61 69 1 71 0 70 72 2 0 55 41 38 57 2
                                  0 71 41 58 73 1 0 33 17 37 2 0 14 8
                                  17 31)))))
          '|lookupComplete|)) 
