powered by
$$M=\sum a_i*x_i*x{'}_i^{T}$$
where $x_i$ is the $i^{th}$ column of the input matrix; $a_i$ is the i th element of the weight vector. Note that $x$ and $x'$ might be different.
xixj(mat,mat.new=NULL,a=NULL)
cov.linear