
(/VERSIONCHECK 2) 

(DEFUN |MCALCFN;localGradient| (|v| |xlist| $)
  (PROG (#0=#:G1818 |x| #1=#:G1819)
    (RETURN
      (SEQ (SPADCALL
               (PROGN
                 (LETT #0# NIL . #2=(|MCALCFN;localGradient|))
                 (SEQ (LETT |x| NIL . #2#) (LETT #1# |xlist| . #2#)
                      G190
                      (COND
                        ((OR (ATOM #1#)
                             (PROGN (LETT |x| (CAR #1#) . #2#) NIL))
                         (GO G191)))
                      (SEQ (EXIT (LETT #0#
                                       (CONS
                                        (SPADCALL |v| |x|
                                         (QREFELT $ 10))
                                        #0#) . #2#)))
                      (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (QREFELT $ 13)))))) 

(DEFUN |MCALCFN;gradient;FFLASV;2| (|v| |xflas| $)
  (PROG (|xlist|)
    (RETURN
      (SEQ (LETT |xlist| (SPADCALL |xflas| (QREFELT $ 15))
                 |MCALCFN;gradient;FFLASV;2|)
           (EXIT (|MCALCFN;localGradient| |v| |xlist| $)))))) 

(DEFUN |MCALCFN;localDivergence| (|vf| |xlist| $)
  (PROG (#0=#:G1822 |n| |i| |ans|)
    (RETURN
      (SEQ (LETT |n|
                 (MIN (LENGTH |xlist|)
                      (PROG1 (LETT #0# (QVSIZE |vf|)
                                   . #1=(|MCALCFN;localDivergence|))
                        (|check-subtype| (>= #0# 0)
                            '(|NonNegativeInteger|) #0#))) . #1#)
           (LETT |ans| (|spadConstant| $ 17) . #1#)
           (SEQ (LETT |i| 1 . #1#) G190
                (COND ((QSGREATERP |i| |n|) (GO G191)))
                (SEQ (EXIT (LETT |ans|
                                 (SPADCALL |ans|
                                     (SPADCALL
                                      (SPADCALL |vf| |i|
                                       (QREFELT $ 19))
                                      (SPADCALL |xlist| |i|
                                       (QREFELT $ 20))
                                      (QREFELT $ 10))
                                     (QREFELT $ 21)) . #1#)))
                (LETT |i| (QSADD1 |i|) . #1#) (GO G190) G191
                (EXIT NIL))
           (EXIT |ans|))))) 

(DEFUN |MCALCFN;divergence;FLAFFLASF;4| (|vf| |xflas| $)
  (PROG (|xlist| #0=#:G1826 |n| |i| |ans|)
    (RETURN
      (SEQ (LETT |xlist| (SPADCALL |xflas| (QREFELT $ 15))
                 . #1=(|MCALCFN;divergence;FLAFFLASF;4|))
           (LETT |n|
                 (MIN (LENGTH |xlist|)
                      (PROG1 (LETT #0#
                                   (SPADCALL |vf| (QREFELT $ 22)) . #1#)
                        (|check-subtype| (>= #0# 0)
                            '(|NonNegativeInteger|) #0#))) . #1#)
           (LETT |ans| (|spadConstant| $ 17) . #1#)
           (SEQ (LETT |i| 1 . #1#) G190
                (COND ((QSGREATERP |i| |n|) (GO G191)))
                (SEQ (EXIT (LETT |ans|
                                 (SPADCALL |ans|
                                     (SPADCALL
                                      (SPADCALL |vf| |i|
                                       (QREFELT $ 23))
                                      (SPADCALL |xlist| |i|
                                       (QREFELT $ 20))
                                      (QREFELT $ 10))
                                     (QREFELT $ 21)) . #1#)))
                (LETT |i| (QSADD1 |i|) . #1#) (GO G190) G191
                (EXIT NIL))
           (EXIT |ans|))))) 

(DEFUN |MCALCFN;laplacian;FFLASF;5| (|v| |xflas| $)
  (PROG (|xlist| |gv|)
    (RETURN
      (SEQ (LETT |xlist| (SPADCALL |xflas| (QREFELT $ 15))
                 . #0=(|MCALCFN;laplacian;FFLASF;5|))
           (LETT |gv| (|MCALCFN;localGradient| |v| |xlist| $) . #0#)
           (EXIT (|MCALCFN;localDivergence| |gv| |xlist| $)))))) 

(DEFUN |MCALCFN;hessian;FFLASM;6| (|v| |xflas| $)
  (PROG (|xlist| #0=#:G1836 |y| #1=#:G1837 #2=#:G1838 |x| #3=#:G1839)
    (RETURN
      (SEQ (LETT |xlist| (SPADCALL |xflas| (QREFELT $ 15))
                 . #4=(|MCALCFN;hessian;FFLASM;6|))
           (EXIT (SPADCALL
                     (PROGN
                       (LETT #0# NIL . #4#)
                       (SEQ (LETT |y| NIL . #4#)
                            (LETT #1# |xlist| . #4#) G190
                            (COND
                              ((OR (ATOM #1#)
                                   (PROGN
                                     (LETT |y| (CAR #1#) . #4#)
                                     NIL))
                               #5=(GO G191)))
                            (SEQ (EXIT (LETT #0#
                                        (CONS
                                         (PROGN
                                           (LETT #2# NIL . #4#)
                                           (SEQ (LETT |x| NIL . #4#)
                                            (LETT #3# |xlist| . #4#)
                                            G190
                                            (COND
                                              ((OR (ATOM #3#)
                                                (PROGN
                                                  (LETT |x|
                                                   (CAR #3#) . #4#)
                                                  NIL))
                                               #5#))
                                            (SEQ
                                             (EXIT
                                              (LETT #2#
                                               (CONS
                                                (SPADCALL |v|
                                                 (LIST |x| |y|)
                                                 (QREFELT $ 26))
                                                #2#) . #4#)))
                                            (LETT #3# (CDR #3#) . #4#)
                                            #6=(GO G190) G191
                                            (EXIT (NREVERSE0 #2#))))
                                         #0#) . #4#)))
                            (LETT #1# (CDR #1#) . #4#) #6# G191
                            (EXIT (NREVERSE0 #0#))))
                     (QREFELT $ 29))))))) 

(DEFUN |MCALCFN;jacobian;FLAFFLASM;7| (|vf| |xflas| $)
  (PROG (|xlist| #0=#:G1844 |i| #1=#:G1845 #2=#:G1846 |x| #3=#:G1847)
    (RETURN
      (SEQ (LETT |xlist| (SPADCALL |xflas| (QREFELT $ 15))
                 . #4=(|MCALCFN;jacobian;FLAFFLASM;7|))
           (EXIT (SPADCALL
                     (PROGN
                       (LETT #0# NIL . #4#)
                       (SEQ (LETT |i| 1 . #4#)
                            (LETT #1#
                                  (SPADCALL |vf| (QREFELT $ 22)) . #4#)
                            G190
                            (COND ((QSGREATERP |i| #1#) #5=(GO G191)))
                            (SEQ (EXIT (LETT #0#
                                        (CONS
                                         (PROGN
                                           (LETT #2# NIL . #4#)
                                           (SEQ (LETT |x| NIL . #4#)
                                            (LETT #3# |xlist| . #4#)
                                            G190
                                            (COND
                                              ((OR (ATOM #3#)
                                                (PROGN
                                                  (LETT |x|
                                                   (CAR #3#) . #4#)
                                                  NIL))
                                               #5#))
                                            (SEQ
                                             (EXIT
                                              (LETT #2#
                                               (CONS
                                                (SPADCALL
                                                 (SPADCALL |vf| |i|
                                                  (QREFELT $ 23))
                                                 |x| (QREFELT $ 10))
                                                #2#) . #4#)))
                                            (LETT #3# (CDR #3#) . #4#)
                                            #6=(GO G190) G191
                                            (EXIT (NREVERSE0 #2#))))
                                         #0#) . #4#)))
                            (LETT |i| (QSADD1 |i|) . #4#) #6# G191
                            (EXIT (NREVERSE0 #0#))))
                     (QREFELT $ 29))))))) 

(DEFUN |MCALCFN;bandedHessian;FFLASNniM;8| (|v| |xflas| |k| $)
  (PROG (|xlist| |n| |bandM| |iw| #0=#:G1853 |j| #1=#:G1854)
    (RETURN
      (SEQ (LETT |xlist| (SPADCALL |xflas| (QREFELT $ 15))
                 . #2=(|MCALCFN;bandedHessian;FFLASNniM;8|))
           (LETT |n| (LENGTH |xlist|) . #2#)
           (LETT |bandM|
                 (SPADCALL (+ |k| 1) |n| (|spadConstant| $ 17)
                     (QREFELT $ 34)) . #2#)
           (SEQ (LETT |j| 1 . #2#) G190
                (COND ((QSGREATERP |j| |n|) #3=(GO G191)))
                (SEQ (EXIT (SPADCALL |bandM| 1 |j|
                               (SPADCALL |v|
                                   (SPADCALL |xlist| |j|
                                    (QREFELT $ 20))
                                   2 (QREFELT $ 35))
                               (QREFELT $ 36))))
                (LETT |j| (QSADD1 |j|) . #2#) #4=(GO G190) G191
                (EXIT NIL))
           (SEQ (LETT |iw| 2 . #2#) (LETT #0# (+ |k| 1) . #2#) G190
                (COND ((QSGREATERP |iw| #0#) #3#))
                (SEQ (EXIT (SEQ (LETT |j| 1 . #2#)
                                (LETT #1# (+ (- |n| |iw|) 1) . #2#)
                                G190 (COND ((QSGREATERP |j| #1#) #3#))
                                (SEQ (EXIT
                                      (SPADCALL |bandM| |iw| |j|
                                       (SPADCALL |v|
                                        (LIST
                                         (SPADCALL |xlist| |j|
                                          (QREFELT $ 20))
                                         (SPADCALL |xlist|
                                          (- (+ |j| |iw|) 1)
                                          (QREFELT $ 20)))
                                        (QREFELT $ 26))
                                       (QREFELT $ 36))))
                                (LETT |j| (QSADD1 |j|) . #2#) #4# G191
                                (EXIT NIL))))
                (LETT |iw| (QSADD1 |iw|) . #2#) #4# G191 (EXIT NIL))
           (EXIT |bandM|))))) 

(DEFUN |MCALCFN;jacobian;FLAFFLASM;9| (|vf| |xflas| $)
  (PROG (|xlist| #0=#:G1859 |i| #1=#:G1860 #2=#:G1861 |x| #3=#:G1862)
    (RETURN
      (SEQ (LETT |xlist| (SPADCALL |xflas| (QREFELT $ 15))
                 . #4=(|MCALCFN;jacobian;FLAFFLASM;9|))
           (EXIT (SPADCALL
                     (PROGN
                       (LETT #0# NIL . #4#)
                       (SEQ (LETT |i| 1 . #4#)
                            (LETT #1#
                                  (SPADCALL |vf| (QREFELT $ 22)) . #4#)
                            G190
                            (COND ((QSGREATERP |i| #1#) #5=(GO G191)))
                            (SEQ (EXIT (LETT #0#
                                        (CONS
                                         (PROGN
                                           (LETT #2# NIL . #4#)
                                           (SEQ (LETT |x| NIL . #4#)
                                            (LETT #3# |xlist| . #4#)
                                            G190
                                            (COND
                                              ((OR (ATOM #3#)
                                                (PROGN
                                                  (LETT |x|
                                                   (CAR #3#) . #4#)
                                                  NIL))
                                               #5#))
                                            (SEQ
                                             (EXIT
                                              (LETT #2#
                                               (CONS
                                                (SPADCALL
                                                 (SPADCALL |vf| |i|
                                                  (QREFELT $ 23))
                                                 |x| (QREFELT $ 10))
                                                #2#) . #4#)))
                                            (LETT #3# (CDR #3#) . #4#)
                                            #6=(GO G190) G191
                                            (EXIT (NREVERSE0 #2#))))
                                         #0#) . #4#)))
                            (LETT |i| (QSADD1 |i|) . #4#) #6# G191
                            (EXIT (NREVERSE0 #0#))))
                     (QREFELT $ 29))))))) 

(DEFUN |MCALCFN;bandedJacobian;FLAFFLAS2NniM;10|
       (|vf| |xflas| |kl| |ku| $)
  (PROG (|xlist| |n| |bandM| #0=#:G1870 #1=#:G1871 |iw| |j|)
    (RETURN
      (SEQ (LETT |xlist| (SPADCALL |xflas| (QREFELT $ 15))
                 . #2=(|MCALCFN;bandedJacobian;FLAFFLAS2NniM;10|))
           (LETT |n| (LENGTH |xlist|) . #2#)
           (LETT |bandM|
                 (SPADCALL (+ (+ |kl| |ku|) 1) |n|
                     (|spadConstant| $ 17) (QREFELT $ 34)) . #2#)
           (SEQ (LETT |j| 1 . #2#) G190
                (COND ((QSGREATERP |j| |n|) #3=(GO G191)))
                (SEQ (EXIT (SPADCALL |bandM| (+ |ku| 1) |j|
                               (SPADCALL
                                   (SPADCALL |vf| |j| (QREFELT $ 23))
                                   (SPADCALL |xlist| |j|
                                    (QREFELT $ 20))
                                   (QREFELT $ 10))
                               (QREFELT $ 36))))
                (LETT |j| (QSADD1 |j|) . #2#) #4=(GO G190) G191
                (EXIT NIL))
           (SEQ (LETT |iw| (+ |ku| 2) . #2#)
                (LETT #0# (+ (+ |ku| |kl|) 1) . #2#) G190
                (COND ((> |iw| #0#) #3#))
                (SEQ (EXIT (SEQ (LETT |j| 1 . #2#)
                                (LETT #1#
                                      (+ (+ (- |n| |iw|) |ku|) 1) . #2#)
                                G190 (COND ((QSGREATERP |j| #1#) #3#))
                                (SEQ (EXIT
                                      (SPADCALL |bandM| |iw| |j|
                                       (SPADCALL
                                        (SPADCALL |vf|
                                         (- (- (+ |j| |iw|) 1) |ku|)
                                         (QREFELT $ 23))
                                        (SPADCALL |xlist| |j|
                                         (QREFELT $ 20))
                                        (QREFELT $ 10))
                                       (QREFELT $ 36))))
                                (LETT |j| (QSADD1 |j|) . #2#) #4# G191
                                (EXIT NIL))))
                (LETT |iw| (+ |iw| 1) . #2#) #4# G191 (EXIT NIL))
           (SEQ (LETT |iw| 1 . #2#) G190
                (COND ((QSGREATERP |iw| |ku|) #3#))
                (SEQ (EXIT (SEQ (LETT |j| (- (+ |ku| 2) |iw|) . #2#)
                                G190 (COND ((> |j| |n|) #3#))
                                (SEQ (EXIT
                                      (SPADCALL |bandM| |iw| |j|
                                       (SPADCALL
                                        (SPADCALL |vf|
                                         (- (- (+ |j| |iw|) 1) |ku|)
                                         (QREFELT $ 23))
                                        (SPADCALL |xlist| |j|
                                         (QREFELT $ 20))
                                        (QREFELT $ 10))
                                       (QREFELT $ 36))))
                                (LETT |j| (+ |j| 1) . #2#) #4# G191
                                (EXIT NIL))))
                (LETT |iw| (QSADD1 |iw|) . #2#) #4# G191 (EXIT NIL))
           (EXIT |bandM|))))) 

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

(DEFUN |MultiVariableCalculusFunctions;| (|#1| |#2| |#3| |#4|)
  (PROG (DV$1 DV$2 DV$3 DV$4 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|MultiVariableCalculusFunctions|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT |dv$|
              (LIST '|MultiVariableCalculusFunctions| DV$1 DV$2 DV$3
                    DV$4) . #0#)
        (LETT $ (GETREFV 39) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache|
            '|MultiVariableCalculusFunctions|
            (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 '|MultiVariableCalculusFunctions| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) (0 . D) (|List| 7)
             (|Vector| 7) (6 . |vector|) (|List| 6) (11 . |parts|)
             |MCALCFN;gradient;FFLASV;2| (16 . |Zero|) (|Integer|)
             (20 . |elt|) (26 . |elt|) (32 . +) (38 . |maxIndex|)
             (43 . |elt|) |MCALCFN;divergence;FLAFFLASF;4|
             |MCALCFN;laplacian;FFLASF;5| (49 . D) (|List| 11)
             (|Matrix| 7) (55 . |matrix|) |MCALCFN;hessian;FFLASM;6|
             |MCALCFN;jacobian;FLAFFLASM;9| (60 . |One|)
             (|NonNegativeInteger|) (64 . |new|) (71 . D)
             (78 . |setelt|) |MCALCFN;bandedHessian;FFLASNniM;8|
             |MCALCFN;bandedJacobian;FLAFFLAS2NniM;10|)
          '#(|laplacian| 86 |jacobian| 92 |hessian| 98 |gradient| 104
             |divergence| 110 |bandedJacobian| 116 |bandedHessian| 124)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 38
                                '(2 7 0 0 6 10 1 12 0 11 13 1 9 14 0 15
                                  0 7 0 17 2 12 7 0 18 19 2 14 6 0 18
                                  20 2 7 0 0 0 21 1 8 18 0 22 2 8 7 0
                                  18 23 2 7 0 0 14 26 1 28 0 27 29 0 7
                                  0 32 3 28 0 33 33 7 34 3 7 0 0 6 33
                                  35 4 28 7 0 18 18 7 36 2 0 7 7 9 25 2
                                  0 28 8 9 31 2 0 28 7 9 30 2 0 12 7 9
                                  16 2 0 7 8 9 24 4 0 28 8 9 33 33 38 3
                                  0 28 7 9 33 37)))))
          '|lookupComplete|)) 
