
(/VERSIONCHECK 2) 

(DEFUN |QFORM;quadraticForm;Sm$;1| (|m| $)
  (COND
    ((NULL (SPADCALL |m| (QREFELT $ 10)))
     (|error| "quadraticForm requires a symmetric matrix"))
    ('T |m|))) 

(PUT '|QFORM;matrix;$Sm;2| '|SPADreplace| '(XLAM (|q|) |q|)) 

(DEFUN |QFORM;matrix;$Sm;2| (|q| $) |q|) 

(DEFUN |QFORM;elt;$DpK;3| (|q| |v| $)
  (SPADCALL |v|
      (SPADCALL (SPADCALL |q| (QREFELT $ 12)) |v| (QREFELT $ 14))
      (QREFELT $ 15))) 

(DEFUN |QFORM;convert;$If;4| (|q| $)
  (SPADCALL
      (LIST '|quadraticForm|
            (SPADCALL (SPADCALL |q| (QREFELT $ 12)) (QREFELT $ 18)))
      (QREFELT $ 20))) 

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

(DEFUN |QuadraticForm;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|QuadraticForm|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$| (LIST '|QuadraticForm| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 28) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| (|SquareMatrix| |#1| |#2|)
                                '(|ConvertibleTo| (|InputForm|))))) . #0#))
        (|haddProp| |$ConstructorCache| '|QuadraticForm|
            (LIST DV$1 DV$2) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 (|SquareMatrix| |#1| |#2|))
        (COND
          ((|testBitVector| |pv$| 1)
           (QSETREFV $ 18
               (CONS (|dispatchFunction| |QFORM;convert;$If;4|) $))))
        $)))) 

(MAKEPROP '|QuadraticForm| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL (|SquareMatrix| 6 7) (|local| |#1|)
             (|local| |#2|) '|Rep| (|Boolean|) (0 . |symmetric?|)
             |QFORM;quadraticForm;Sm$;1| |QFORM;matrix;$Sm;2|
             (|DirectProduct| 6 7) (5 . *) (11 . |dot|)
             |QFORM;elt;$DpK;3| (|InputForm|) (17 . |convert|)
             (|List| $) (22 . |convert|) (|Integer|)
             (|NonNegativeInteger|) (|Union| $ '"failed")
             (|PositiveInteger|) (|SingleInteger|) (|String|)
             (|OutputForm|))
          '#(~= 27 |zero?| 33 |subtractIfCan| 38 |sample| 44
             |quadraticForm| 48 |matrix| 53 |latex| 58 |hash| 63 |elt|
             68 |convert| 74 |coerce| 79 |Zero| 84 = 88 - 94 + 105 *
             111)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0 0 0 0 0 1))
                (CONS '#(|AbelianGroup&| NIL |AbelianMonoid&|
                         |AbelianSemiGroup&| |SetCategory&|
                         |BasicType&| NIL NIL)
                      (CONS '#((|AbelianGroup|)
                               (|CancellationAbelianMonoid|)
                               (|AbelianMonoid|) (|AbelianSemiGroup|)
                               (|SetCategory|) (|BasicType|)
                               (|CoercibleTo| 27) (|ConvertibleTo| 17))
                            (|makeByteWordVec2| 27
                                '(1 8 9 0 10 2 8 13 0 13 14 2 13 7 0 0
                                  15 1 0 17 0 18 1 17 0 19 20 2 0 9 0 0
                                  1 1 0 9 0 1 2 0 23 0 0 1 0 0 0 1 1 0
                                  0 5 11 1 0 5 0 12 1 0 26 0 1 1 0 25 0
                                  1 2 0 7 0 13 16 1 1 17 0 18 1 0 27 0
                                  1 0 0 0 1 2 0 9 0 0 1 2 0 0 0 0 1 1 0
                                  0 0 1 2 0 0 0 0 1 2 0 0 21 0 1 2 0 0
                                  22 0 1 2 0 0 24 0 1)))))
          '|lookupComplete|)) 
