double MAfSyQuad (const float *A, const float x, int N)
Calculate a quadratic form for a symmetric matrix
This routine calculates the quadaratic form s = x'A x for vector x and
symmetric matrix A,
s = SUM SUM x(i) A(i,j) x(j) .
The symmetry of A is used to reduce the number of computations. The result
is accumulated as a double value and returned as a double value.
<- double MAfSyBilin
-> const float *A
A is an array of pointers to the rows of an N by N matrix. The matrix
is assumed to be symmetric. Only the lower triangular portion of the
matrix is accessed. Note that with ANSI C, if the actual parameter
is not declared to have the const attribute, an explicit cast to
(const float **) is required.
-> const float x
Input vector (N elements)
-> int N
Number of of elements in x and y and the size of A
Author / revision
/ Revision 1.5 2003/05/09
Main Index libtsp