function G=computeGrammian(M)
for i=1:size(M,1),
    for j=1:size(M,1),
        G(i,j)=sum(M(i,:).*M(j,:));
    end
end
