Function: qfnorm
Section: linear_algebra
C-Name: qfnorm
Prototype: GDG
Help: qfnorm(x,{q}): evaluate the binary quadratic form q (symmetric matrix)
 at x; if q omitted, use the standard Euclidean form.
Doc: evaluate the binary quadratic form $q$ (symmetric matrix)
 at the vector $x$. If $q$ omitted, use the standard Euclidean form,
 corresponding to the identity matrix.

 Equivalent to \kbd{x\til * q * x}, but about twice faster and
 more convenient (does not distinguish between column and row vectors):
 \bprog
 ? x = [1,2,3]~; qfnorm(x)
 %1 = 14
 ? q = [1,2,3;2,2,-1;3,-1,0]; qfnorm(x, q)
 %2 = 23
 ? for(i=1,10^6, qfnorm(x,q))
 time = 384ms.
 ? for(i=1,10^6, x~*q*x)
 time = 729ms.
 @eprog\noindent We also allow \typ{MAT}s of compatible dimensions for $x$,
 and return \kbd{x\til * q * x} in this case as well:
 \bprog
 ? M = [1,2,3;4,5,6;7,8,9]; qfnorm(M) \\ Gram matrix
 %5 =
 [66  78  90]

 [78  93 108]

 [90 108 126]

 ? for(i=1,10^6, qfnorm(M,q))
 time = 2,144 ms.
 ? for(i=1,10^6, M~*q*M)
 time = 2,793 ms.
 @eprog
 \noindent The polar form is also available, as \tet{qfbil}.
