protected Signature mergeSignatures(Signature first,Signature second,int numBins){
  int d2=-1;
  for (int i=0; i < second.spec.length; i+=2) {
    if (second.spec[i] >= 0) {
      assert (d2 == -1) : "Merging with non-1-signature?!?";
      d2=i;
    }
  }
  assert (d2 >= 0) : "Merging with empty signature?";
  if (first.spec[d2] >= 0) {
    return null;
  }
  final ModifiableDBIDs intersection=DBIDUtil.intersection(first.ids,second.ids);
  final int support=intersection.size();
  double width=(second.spec[d2 + 1] - second.spec[d2] + 1.) / (double)numBins;
  double expect=first.ids.size() * width;
  if (support <= expect || support < minClusterSize) {
    return null;
  }
  final double test=PoissonDistribution.rawProbability(support,expect);
  if ((poissonThreshold) <= test) {
    return null;
  }
  int[] spec=first.spec.clone();
  spec[d2]=second.spec[d2];
  spec[d2 + 1]=second.spec[d2];
  final Signature newsig=new Signature(spec,intersection);
  if (LOG.isDebugging()) {
    LOG.debug(newsig.toString());
  }
  return newsig;
}

protected Signature mergeSignatures ( Signature first , Signature second , int numBins ) { int d2 = - 1 ; for ( int i = 0 ; i < second . spec . length ; i += 2 ) { if ( second . spec [ i ] >= 0 ) { assert ( d2 == - 1 ) : "Merging with non-1-signature?!?" ; d2 = i ; } } assert ( d2 >= 0 ) : "Merging with empty signature?" ; if ( first . spec [ d2 ] >= 0 ) { return null ; } final ModifiableDBIDs intersection = DBIDUtil . intersection ( first . ids , second . ids ) ; final int support = intersection . size ( ) ; double width = ( second . spec [ d2 + 1 ] - second . spec [ d2 ] + 1. ) / ( double ) numBins ; double expect = first . ids . size ( ) * width ; if ( support <= expect || support < minClusterSize ) { return null ; } final double test = PoissonDistribution . rawProbability ( support , expect ) ; if ( ( poissonThreshold ) <= test ) { return null ; } int [ ] spec = first . spec . clone ( ) ; spec [ d2 ] = second . spec [ d2 ] ; spec [ d2 + 1 ] = second . spec [ d2 ] ; final Signature newsig = new Signature ( spec , intersection ) ; if ( LOG . isDebugging ( ) ) { LOG . debug ( newsig . toString ( ) ) ; } return newsig ; }
generates a merged signature of this and another one , where the other signature must be a 1 - signature .
