ParticlePairsTemp BoxSweepClosePairsFinder
::get_close_pairs( const ParticlesTemp &ca,
                   const ParticlesTemp &cb) const {
  set_was_used(true);
  base::Vector<NBLBbox> boxes0, boxes1;
  copy_particles_to_boxes(ca, get_distance(), boxes0);
  copy_particles_to_boxes(cb, get_distance(), boxes1);

  ParticlePairsTemp out;

  CGAL::box_intersection_d( boxes0.begin(), boxes0.end(),
                            boxes1.begin(), boxes1.end(), AddToList(out));
  return out;
}
ParticleIndexPairs BoxSweepClosePairsFinder::get_close_pairs(
    Model *m, const ParticleIndexes &ca,
    const ParticleIndexes &cb) const {
  set_was_used(true);
  Vector<NBLBbox> boxes0, boxes1;
  copy_particles_to_boxes(m, ca, get_distance(), boxes0);
  copy_particles_to_boxes(m, cb, get_distance(), boxes1);

  ParticleIndexPairs out;

  CGAL::box_intersection_d(boxes0.begin(), boxes0.end(), boxes1.begin(),
                           boxes1.end(), AddToList(out));
  return out;
}
ParticleIndexPairs BoxSweepClosePairsFinder::get_close_pairs(
    kernel::Model *m, const kernel::ParticleIndexes &ca) const {
  set_was_used(true);
  kernel::ParticleIndexPairs out;
  base::Vector<NBLBbox> boxes;
  copy_particles_to_boxes(m, ca, get_distance(), boxes);

  CGAL::box_self_intersection_d(boxes.begin(), boxes.end(), AddToList(out));
  return out;
}