
(/VERSIONCHECK 2) 

(DEFUN |REP;evalvect| (|vect| |alg| |x| $)
  (PROG (|n| |xx| |w| |i| |v|)
    (RETURN
      (SEQ (LETT |n| (SPADCALL |vect| (QREFELT $ 9))
                 . #0=(|REP;evalvect|))
           (LETT |xx| (SPADCALL |x| (QREFELT $ 12)) . #0#)
           (LETT |w| (SPADCALL |n| 1 (QREFELT $ 16)) . #0#)
           (SEQ (LETT |i| 1 . #0#) G190
                (COND ((QSGREATERP |i| |n|) (GO G191)))
                (SEQ (LETT |v|
                           (SPADCALL
                               (SPADCALL
                                   (SPADCALL |vect| |i| 1
                                    (QREFELT $ 19))
                                   (QREFELT $ 20))
                               |xx| |alg| (QREFELT $ 22)) . #0#)
                     (EXIT (SPADCALL |w| |i| 1 |v| (QREFELT $ 23))))
                (LETT |i| (QSADD1 |i|) . #0#) (GO G190) G191
                (EXIT NIL))
           (EXIT |w|))))) 

(DEFUN |REP;innerprod| (|v1| |v2| $)
  (SPADCALL
      (SPADCALL (SPADCALL |v1| (QREFELT $ 24)) |v2| (QREFELT $ 25)) 1 1
      (QREFELT $ 26))) 

(DEFUN |REP;normalise;2M;3| (|v| $)
  (PROG (|normv|)
    (RETURN
      (SEQ (LETT |normv|
                 (SPADCALL (|REP;innerprod| |v| |v| $) (QREFELT $ 27))
                 |REP;normalise;2M;3|)
           (EXIT (COND
                   ((SPADCALL |normv| (|spadConstant| $ 28)
                        (QREFELT $ 30))
                    |v|)
                   ('T
                    (SPADCALL
                        (SPADCALL (|spadConstant| $ 14) |normv|
                            (QREFELT $ 31))
                        |v| (QREFELT $ 32))))))))) 

(DEFUN |REP;radicalEigenvalues;ML;4| (A $)
  (PROG (|x| |pol|)
    (RETURN
      (SEQ (LETT |x| (SPADCALL (QREFELT $ 34))
                 . #0=(|REP;radicalEigenvalues;ML;4|))
           (LETT |pol|
                 (SPADCALL (SPADCALL A |x| (QREFELT $ 37))
                     (QREFELT $ 38)) . #0#)
           (EXIT (SPADCALL |pol| |x| (QREFELT $ 40))))))) 

(DEFUN |REP;radicalEigenvector;EML;5| (|alpha| A $)
  (PROG (|n| B |i| |j| #0=#:G1835 |v| #1=#:G1836)
    (RETURN
      (SEQ (LETT |n| (SPADCALL A (QREFELT $ 9))
                 . #2=(|REP;radicalEigenvector;EML;5|))
           (LETT B (SPADCALL |n| |n| (QREFELT $ 16)) . #2#)
           (SEQ (LETT |i| 1 . #2#) G190
                (COND ((QSGREATERP |i| |n|) #3=(GO G191)))
                (SEQ (SEQ (LETT |j| 1 . #2#) G190
                          (COND ((QSGREATERP |j| |n|) #3#))
                          (SEQ (EXIT (SPADCALL B |i| |j|
                                      (SPADCALL
                                       (SPADCALL A |i| |j|
                                        (QREFELT $ 19))
                                       (QREFELT $ 20))
                                      (QREFELT $ 23))))
                          (LETT |j| (QSADD1 |j|) . #2#) #4=(GO G190)
                          G191 (EXIT NIL))
                     (EXIT (SPADCALL B |i| |i|
                               (SPADCALL
                                   (SPADCALL B |i| |i| (QREFELT $ 26))
                                   |alpha| (QREFELT $ 42))
                               (QREFELT $ 23))))
                (LETT |i| (QSADD1 |i|) . #2#) #4# G191 (EXIT NIL))
           (EXIT (PROGN
                   (LETT #0# NIL . #2#)
                   (SEQ (LETT |v| NIL . #2#)
                        (LETT #1# (SPADCALL B (QREFELT $ 44)) . #2#)
                        G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |v| (CAR #1#) . #2#) NIL))
                           #3#))
                        (SEQ (EXIT (LETT #0#
                                    (CONS (SPADCALL |v| (QREFELT $ 46))
                                     #0#) . #2#)))
                        (LETT #1# (CDR #1#) . #2#) #4# G191
                        (EXIT (NREVERSE0 #0#))))))))) 

(DEFUN |REP;radicalEigenvectors;ML;6| (A $)
  (PROG (|leig| |n| |eig| #0=#:G1861 |ll| #1=#:G1862 |m| |i| |veclist|
                #2=#:G1845 #3=#:G1846 |sym| |xx| |lval| |alg|
                #4=#:G1863 #5=#:G1864 |ep| #6=#:G1865 |nsl| |sln|)
    (RETURN
      (SEQ (LETT |leig| (SPADCALL A (QREFELT $ 52))
                 . #7=(|REP;radicalEigenvectors;ML;6|))
           (LETT |n| (SPADCALL A (QREFELT $ 9)) . #7#)
           (LETT |sln| NIL . #7#)
           (SEQ (LETT |eig| NIL . #7#) (LETT #0# |leig| . #7#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |eig| (CAR #0#) . #7#) NIL))
                   #8=(GO G191)))
                (SEQ (EXIT (COND
                             ((QEQCAR (QVELT |eig| 0) 0)
                              (SEQ (LETT |veclist| NIL . #7#)
                                   (SEQ (LETT |ll| NIL . #7#)
                                    (LETT #1# (QVELT |eig| 2) . #7#)
                                    G190
                                    (COND
                                      ((OR (ATOM #1#)
                                        (PROGN
                                          (LETT |ll| (CAR #1#) . #7#)
                                          NIL))
                                       #8#))
                                    (SEQ
                                     (LETT |m|
                                      (SPADCALL |n| 1 (QREFELT $ 16)) . #7#)
                                     (SEQ (LETT |i| 1 . #7#) G190
                                      (COND
                                        ((QSGREATERP |i| |n|) #8#))
                                      (SEQ
                                       (EXIT
                                        (SPADCALL |m| |i| 1
                                         (SPADCALL
                                          (SPADCALL |ll| |i| 1
                                           (QREFELT $ 19))
                                          (QREFELT $ 20))
                                         (QREFELT $ 23))))
                                      (LETT |i| (QSADD1 |i|) . #7#)
                                      #9=(GO G190) G191 (EXIT NIL))
                                     (EXIT
                                      (LETT |veclist|
                                       (CONS |m| |veclist|) . #7#)))
                                    (LETT #1# (CDR #1#) . #7#) #9# G191
                                    (EXIT NIL))
                                   (EXIT
                                    (LETT |sln|
                                     (CONS
                                      (VECTOR
                                       (SPADCALL
                                        (PROG2
                                         (LETT #2#
                                          (QVELT |eig| 0) . #7#)
                                         (QCDR #2#)
                                          (|check-union| (QEQCAR #2# 0)
                                           (|Fraction|
                                            (|Polynomial| (|Integer|)))
                                           #2#))
                                        (QREFELT $ 20))
                                       (QVELT |eig| 1) |veclist|)
                                      |sln|) . #7#))))
                             ('T
                              (SEQ (LETT |sym|
                                    (PROG2
                                     (LETT #3# (QVELT |eig| 0) . #7#)
                                     (QCDR #3#)
                                      (|check-union| (QEQCAR #3# 1)
                                       (|SuchThat| (|Symbol|)
                                        (|Polynomial| (|Integer|)))
                                       #3#)) . #7#)
                                   (LETT |xx|
                                    (SPADCALL |sym| (QREFELT $ 54)) . #7#)
                                   (LETT |lval|
                                    (SPADCALL
                                     (SPADCALL
                                      (SPADCALL |sym| (QREFELT $ 55))
                                      (QREFELT $ 38))
                                     |xx| (QREFELT $ 40)) . #7#)
                                   (EXIT
                                    (SEQ (LETT |alg| NIL . #7#)
                                     (LETT #4# |lval| . #7#) G190
                                     (COND
                                       ((OR (ATOM #4#)
                                         (PROGN
                                           (LETT |alg| (CAR #4#) . #7#)
                                           NIL))
                                        #8#))
                                     (SEQ
                                      (LETT |nsl|
                                       (VECTOR |alg| (QVELT |eig| 1)
                                        (PROGN
                                          (LETT #5# NIL . #7#)
                                          (SEQ (LETT |ep| NIL . #7#)
                                           (LETT #6#
                                            (QVELT |eig| 2) . #7#)
                                           G190
                                           (COND
                                             ((OR (ATOM #6#)
                                               (PROGN
                                                 (LETT |ep|
                                                  (CAR #6#) . #7#)
                                                 NIL))
                                              #8#))
                                           (SEQ
                                            (EXIT
                                             (LETT #5#
                                              (CONS
                                               (|REP;evalvect| |ep|
                                                |alg| |xx| $)
                                               #5#) . #7#)))
                                           (LETT #6# (CDR #6#) . #7#)
                                           #9# G191
                                           (EXIT (NREVERSE0 #5#))))) . #7#)
                                      (EXIT
                                       (LETT |sln|
                                        (CONS |nsl| |sln|) . #7#)))
                                     (LETT #4# (CDR #4#) . #7#) #9#
                                     G191 (EXIT NIL))))))))
                (LETT #0# (CDR #0#) . #7#) #9# G191 (EXIT NIL))
           (EXIT |sln|))))) 

(DEFUN |REP;gramschmidt;2L;7| (|lvect| $)
  (PROG (|n| #0=#:G1867 RMR |v| #1=#:G1878 |w| #2=#:G1879 #3=#:G1873
             #4=#:G1871 #5=#:G1872 |pol| |orth|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |lvect| NIL (QREFELT $ 59)) NIL)
             ('T
              (SEQ (LETT |v| (|SPADfirst| |lvect|)
                         . #6=(|REP;gramschmidt;2L;7|))
                   (LETT |n| (SPADCALL |v| (QREFELT $ 60)) . #6#)
                   (LETT RMR
                         (|RectangularMatrix|
                             (PROG1 (LETT #0# |n| . #6#)
                               (|check-subtype| (> #0# 0)
                                   '(|PositiveInteger|) #0#))
                             1 (|Expression| (|Integer|))) . #6#)
                   (LETT |orth|
                         (LIST (SPADCALL |v| (QREFELT $ 33))) . #6#)
                   (SEQ (LETT |v| NIL . #6#)
                        (LETT #1# (CDR |lvect|) . #6#) G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |v| (CAR #1#) . #6#) NIL))
                           #7=(GO G191)))
                        (SEQ (LETT |pol|
                                   (SPADCALL
                                    (SPADCALL |v|
                                     (PROGN
                                       (LETT #5# NIL . #6#)
                                       (SEQ (LETT |w| NIL . #6#)
                                        (LETT #2# |orth| . #6#) G190
                                        (COND
                                          ((OR (ATOM #2#)
                                            (PROGN
                                              (LETT |w|
                                               (CAR #2#) . #6#)
                                              NIL))
                                           #7#))
                                        (SEQ
                                         (EXIT
                                          (PROGN
                                            (LETT #3#
                                             (SPADCALL
                                              (|REP;innerprod| |w| |v|
                                               $)
                                              |w| (QREFELT $ 32)) . #6#)
                                            (COND
                                              (#5#
                                               (LETT #4#
                                                (SPADCALL #4# #3#
                                                 (|compiledLookupCheck|
                                                  '+ (LIST '$ '$ '$)
                                                  RMR)) . #6#))
                                              ('T
                                               (PROGN
                                                 (LETT #4# #3# . #6#)
                                                 (LETT #5# 'T . #6#)))))))
                                        (LETT #2# (CDR #2#) . #6#)
                                        #8=(GO G190) G191 (EXIT NIL))
                                       (COND
                                         (#5# #4#)
                                         ('T
                                          (SPADCALL
                                           (|compiledLookupCheck|
                                            '|Zero| (LIST '$) RMR)))))
                                     (|compiledLookupCheck| '-
                                      (LIST '$ '$ '$) RMR))
                                    (|compiledLookupCheck| '|coerce|
                                     (LIST
                                      (LIST '|Matrix|
                                       (LIST '|Expression|
                                        (LIST '|Integer|)))
                                      '$)
                                     RMR)) . #6#)
                             (EXIT (LETT |orth|
                                    (CONS
                                     (SPADCALL |pol| (QREFELT $ 33))
                                     |orth|) . #6#)))
                        (LETT #1# (CDR #1#) . #6#) #8# G191 (EXIT NIL))
                   (EXIT |orth|)))))))) 

(DEFUN |REP;eigenMatrix;MU;8| (A $)
  (PROG (|eiv| #0=#:G1894 #1=#:G1886 #2=#:G1884 #3=#:G1885 |lef| |n|
               |v| #4=#:G1895 |d|)
    (RETURN
      (SEQ (LETT |lef|
                 (PROGN
                   (LETT #3# NIL . #5=(|REP;eigenMatrix;MU;8|))
                   (SEQ (LETT |eiv| NIL . #5#)
                        (LETT #0# (SPADCALL A (QREFELT $ 58)) . #5#)
                        G190
                        (COND
                          ((OR (ATOM #0#)
                               (PROGN
                                 (LETT |eiv| (CAR #0#) . #5#)
                                 NIL))
                           #6=(GO G191)))
                        (SEQ (EXIT (PROGN
                                     (LETT #1# (QVELT |eiv| 2) . #5#)
                                     (COND
                                       (#3#
                                        (LETT #2#
                                         (APPEND #2# #1#) . #5#))
                                       ('T
                                        (PROGN
                                          (LETT #2# #1# . #5#)
                                          (LETT #3# 'T . #5#)))))))
                        (LETT #0# (CDR #0#) . #5#) #7=(GO G190) G191
                        (EXIT NIL))
                   (COND (#3# #2#) ('T NIL))) . #5#)
           (LETT |n| (SPADCALL A (QREFELT $ 9)) . #5#)
           (EXIT (COND
                   ((< (LENGTH |lef|) |n|) (CONS 1 "failed"))
                   ('T
                    (SEQ (LETT |d|
                               (SPADCALL (|SPADfirst| |lef|)
                                   (QREFELT $ 62)) . #5#)
                         (SEQ (LETT |v| NIL . #5#)
                              (LETT #4# (CDR |lef|) . #5#) G190
                              (COND
                                ((OR (ATOM #4#)
                                     (PROGN
                                       (LETT |v| (CAR #4#) . #5#)
                                       NIL))
                                 #6#))
                              (SEQ (EXIT
                                    (LETT |d|
                                     (SPADCALL |d| |v| (QREFELT $ 63)) . #5#)))
                              (LETT #4# (CDR #4#) . #5#) #7# G191
                              (EXIT NIL))
                         (EXIT (CONS 0 |d|)))))))))) 

(DEFUN |REP;orthonormalBasis;ML;9| (A $)
  (PROG (|alglist| |n| |alterm| #0=#:G1904 |lvec| |basis|)
    (RETURN
      (SEQ (COND
             ((NULL (SPADCALL A (QREFELT $ 66)))
              (|error| "the matrix is not symmetric"))
             ('T
              (SEQ (LETT |basis| NIL
                         . #1=(|REP;orthonormalBasis;ML;9|))
                   (LETT |lvec| NIL . #1#)
                   (LETT |alglist| (SPADCALL A (QREFELT $ 58)) . #1#)
                   (LETT |n| (SPADCALL A (QREFELT $ 9)) . #1#)
                   (SEQ (LETT |alterm| NIL . #1#)
                        (LETT #0# |alglist| . #1#) G190
                        (COND
                          ((OR (ATOM #0#)
                               (PROGN
                                 (LETT |alterm| (CAR #0#) . #1#)
                                 NIL))
                           (GO G191)))
                        (SEQ (SEQ (LETT |lvec|
                                        (QVELT |alterm| 2) . #1#)
                                  (EXIT (COND
                                          ((SPADCALL |lvec| NIL
                                            (QREFELT $ 59))
                                           (|error| "sorry ")))))
                             (EXIT (COND
                                     ((< 1 (LENGTH |lvec|))
                                      (SEQ
                                       (LETT |lvec|
                                        (SPADCALL |lvec|
                                         (QREFELT $ 61)) . #1#)
                                       (EXIT
                                        (LETT |basis|
                                         (APPEND |lvec| |basis|) . #1#))))
                                     ('T
                                      (LETT |basis|
                                       (CONS
                                        (SPADCALL (|SPADfirst| |lvec|)
                                         (QREFELT $ 33))
                                        |basis|) . #1#)))))
                        (LETT #0# (CDR #0#) . #1#) (GO G190) G191
                        (EXIT NIL))
                   (EXIT |basis|)))))))) 

(DEFUN |RadicalEigenPackage| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G1906)
        (RETURN
          (COND
            ((LETT #0#
                   (HGET |$ConstructorCache| '|RadicalEigenPackage|)
                   . #1=(|RadicalEigenPackage|))
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache|
                                   '|RadicalEigenPackage|
                                   (LIST
                                    (CONS NIL
                                     (CONS 1 (|RadicalEigenPackage;|))))))
                 (LETT #0# T . #1#))
               (COND
                 ((NOT #0#)
                  (HREM |$ConstructorCache| '|RadicalEigenPackage|))))))))))) 

(DEFUN |RadicalEigenPackage;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|RadicalEigenPackage|)
              . #0=(|RadicalEigenPackage|))
        (LETT $ (GETREFV 68) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|RadicalEigenPackage| NIL
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 (|RadicalSolvePackage| (|Integer|)))
        $)))) 

(MAKEPROP '|RadicalEigenPackage| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL 'RSP (|NonNegativeInteger|)
             (|Matrix| 17) (0 . |nrows|) (|Symbol|) (|Kernel| 13)
             (5 . |kernel|) (|Expression| 18) (10 . |One|)
             (|Matrix| 13) (14 . |zero|) (|Fraction| 35) (|Integer|)
             (20 . |elt|) (27 . |coerce|) (|Kernel| $) (32 . |eval|)
             (39 . |setelt|) (47 . |transpose|) (52 . *) (58 . |elt|)
             (65 . |sqrt|) (70 . |Zero|) (|Boolean|) (74 . =) (80 . /)
             (86 . *) |REP;normalise;2M;3| (92 . |new|)
             (|Polynomial| 18) (|EigenPackage| 18)
             (96 . |characteristicPolynomial|) (102 . |coerce|)
             (|List| 13) (107 . |radicalRoots|)
             |REP;radicalEigenvalues;ML;4| (113 . -) (|List| 45)
             (119 . |nullSpace|) (|Vector| 13) (124 . |coerce|)
             (|List| 15) |REP;radicalEigenvector;EML;5| (|Union| 17 53)
             (|Record| (|:| |eigval| 49) (|:| |eigmult| 7)
                 (|:| |eigvec| (|List| 8)))
             (|List| 50) (129 . |eigenvectors|) (|SuchThat| 10 35)
             (134 . |lhs|) (139 . |rhs|)
             (|Record| (|:| |radval| 13) (|:| |radmult| 18)
                 (|:| |radvect| 47))
             (|List| 56) |REP;radicalEigenvectors;ML;6| (144 . =)
             (150 . |nrows|) |REP;gramschmidt;2L;7| (155 . |copy|)
             (160 . |horizConcat|) (|Union| 15 '"failed")
             |REP;eigenMatrix;MU;8| (166 . |symmetric?|)
             |REP;orthonormalBasis;ML;9|)
          '#(|radicalEigenvectors| 171 |radicalEigenvector| 176
             |radicalEigenvalues| 182 |orthonormalBasis| 187
             |normalise| 192 |gramschmidt| 197 |eigenMatrix| 202)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 67
                                '(1 8 7 0 9 1 11 0 10 12 0 13 0 14 2 15
                                  0 7 7 16 3 8 17 0 18 18 19 1 13 0 17
                                  20 3 13 0 0 21 0 22 4 15 13 0 18 18
                                  13 23 1 15 0 0 24 2 15 0 0 0 25 3 15
                                  13 0 18 18 26 1 13 0 0 27 0 13 0 28 2
                                  13 29 0 0 30 2 13 0 0 0 31 2 15 0 13
                                  0 32 0 10 0 34 2 36 35 8 10 37 1 17 0
                                  35 38 2 6 39 17 10 40 2 13 0 0 0 42 1
                                  15 43 0 44 1 15 0 45 46 1 36 51 8 52
                                  1 53 10 0 54 1 53 35 0 55 2 47 29 0 0
                                  59 1 15 7 0 60 1 15 0 0 62 2 15 0 0 0
                                  63 1 8 29 0 66 1 0 57 8 58 2 0 47 13
                                  8 48 1 0 39 8 41 1 0 47 8 67 1 0 15
                                  15 33 1 0 47 47 61 1 0 64 8 65)))))
          '|lookupComplete|)) 

(MAKEPROP '|RadicalEigenPackage| 'NILADIC T) 
