function num = mgetnblk(tree,node)
%MGETNBLK
%        NUM = MGETNBLK(TREE,NODE);
%

% Initial coding by A S Bozin, 6-4-97.
% Copyright 1997-2000 The MathWorks, Inc.
% $Revision: 1.6 $ $Date: 2000/06/14 16:12:28 $

   num = getnblk(tree,node,1);
   return					   % Last card of MGETNBLK

function num = getnblk(tree,node,num)
%GENNBLK
%

   kids = tree(node).sbChild;
   if (~isempty(kids))
      nch = size(kids,2);
      for (ch = 1:nch)
	 num = getnblk(tree,kids(ch),num);
      end
   end
   parents = tree(node).bkChild(find(tree(node).sibling));
   if (~isempty(parents))
      npr = size(parents,2);
      for (pr = 1:npr)
	 kids = parents{pr};
	 nch = size(kids,2);
	 for (ch = 1:nch)
	    num = getnblk(tree,kids(ch),num);
	 end
      end
   end
   num = num+tree(node).nBlocks;
   return					   % Last card of GETNBLK
