wolffd@0: function C = myintersect(A,B) wolffd@0: % MYINTERSECT Intersection of two sets of positive integers (much faster than built-in intersect) wolffd@0: % C = myintersect(A,B) wolffd@0: wolffd@0: A = A(:)'; B = B(:)'; wolffd@0: wolffd@0: if isempty(A) wolffd@0: ma = 0; wolffd@0: else wolffd@0: ma = max(A); wolffd@0: end wolffd@0: wolffd@0: if isempty(B) wolffd@0: mb = 0; wolffd@0: else wolffd@0: mb = max(B); wolffd@0: end wolffd@0: wolffd@0: if ma==0 | mb==0 wolffd@0: C = []; wolffd@0: else wolffd@0: %bits = sparse(1, max(ma,mb)); wolffd@0: bits = zeros(1, max(ma,mb)); wolffd@0: bits(A) = 1; wolffd@0: C = B(logical(bits(B))); wolffd@0: end wolffd@0: wolffd@0: %sum( bitget( bitand( cliquesb(i), cliquesb(j) ), 1:52 ) );