% TestScript C3
% Checks or CholBlockDiag

clc
randn('seed',0)
m = 5; r = 3; n = m*r; U = randn(n,r);
Gblocks = CholBlockDiag(U);
G = chol(eye(n,n)+ U*U','lower');
for k=1:m
    idx = 1+(k-1)*r:k*r;
    Show = [Gblocks{k} G(idx,idx)]
end