function c = find_clique_containing_family(bnet, i, t)
% FIND_CLIQUE_CONTAINING_FAMILY Return the index of a clique containing the family of node i in slice t.
% c = find_clique_containing_family(bnet, i, t)
%
% See also marginal_nodes.

ss = bnet.slice_size;
switch bnet.algo
  case 'jtree',
    i2 = i + (t-1)*ss;
    c = bnet.jtree.cl_containing_family(i2);
  case 'bk',
    if bnet.num_slices == 1 | t==1
      c = bnet.jtree1.cl_containing_family(i);
    else
      c = bnet.jtree.cl_containing_family(i+ss);
    end
  otherwise,
    c = -1;
end
