function SpotMatVec()
% POD for August 31
n = 10;
A = randn(n,n);
u = randn(n,1);
x = randn(n,1);
y = randn(n,1);
z = randn(n,1);
d = randn(n,1);
v = randperm(n);
alfa1 = MessySum1(A,u,x,y,z,d,v)    % O(n^4)
alfa2 = MessySum2(A,u,x,y,z,d,v)    % O(n^2)


  function alfa = MessySum1(A,u,x,y,z,d,v)
% A is nxn
% u,x,y,z, and d are nx1
% v is a permutation of 1:n
% returns a complicated scalar alfa...
n = length(x);
alfa = 0;
for i=1:n
    for j=1:n
        for p=1:n
            for q=1:n
                alfa = alfa + A(i,p)*A(v(j),q)*u(i)*y(j)*x(q)*z(p)*d(i);
            end
        end
    end
end

function alfa = MessySum2(A,u,x,y,z,d,v)
% Same as MessySum1 only O(n^2)
 