%@Yipei Wang, contact: yipeiw@cmu.edu

A=[1,2, 0;1,0,1];
C=[];
tic
for i=1:size(A, 1)
    for k=1:size(A, 1)
        T = 0;
        for j=1:size(A, 2)
            T = T+A(i, j)*A(k, j);         
        end
        C(i, k) = T;
    end
end
n1=toc

tic
B = A*A';
n2=toc

C-B