function mg = MGInit(A, M, bd)

% Build the Multigrid data structure with the cell data


mg = struct('Levels',1,'A',cell(1,1),'M',cell(1,1),'P',-1,'bd',cell(1,1));
mg.A{1,1} = A;
if size(M,1) > 0
    mg.M{1,1} = M;
else
    mg.M{1,1} = [];
end
if nargin == 3
    mg.bd{1,1} = bd;  
end
mg.N = size(A,1);