
%% max_width_impl
%    determines the maximum width from a current grid, the maximum
%    widht represents the number of levels of subgrids from a given
%    grid.
% inputs:
%   object:Grid - current Grid object
% outputs:
%   m:integer - value representing the maximum width from the
%   current grid.
% Author: Colin Eles elesc@mcmaster.ca
% Author: Matthew Dawson matthew@mjdsystems.ca
% Organization: McMaster Centre for Software Certification
function m = max_width_impl(object,grid,width)
temp = [width];
for i=1:size(grid,2)
    if (~isempty(grid{i}.grid))
        temp = [temp object.max_width_impl(grid{i}.grid, width+1)];
    end
    
end
m = max(temp);
end

