ParticleIndexPairs AllPairContainer::get_range_indexes() const { ParticleIndexes ia = c_->get_range_indexes(); ParticleIndexPairs ret; ret.reserve(ia.size() * (ia.size() - 1) / 2); for (unsigned int i = 0; i < ia.size(); ++i) { for (unsigned int j = 0; j < i; ++j) { ret.push_back(ParticleIndexPair(ia[i], ia[j])); } } return ret; }
ParticleIndexPairs DummyPairContainer::get_range_indexes() const { ParticleIndexes pis = c_->get_range_indexes(); ParticleIndexPairs ret; ret.reserve(pis.size() * (pis.size() - 1) / 2); for (unsigned int i = 0; i < pis.size(); ++i) { for (unsigned int j = 0; j < i; ++j) { ret.push_back(ParticleIndexPair(pis[i], pis[j])); } } return ret; }
ParticleIndexPairs CoreCloseBipartitePairContainer::get_all_possible_indexes() const { ParticleIndexes pis= sc_[0]->get_all_possible_indexes(); ParticleIndexes pjs= sc_[1]->get_all_possible_indexes(); ParticleIndexPairs ret; ret.reserve(pis.size()*pjs.size()); for (unsigned int i=0; i< pis.size(); ++i) { for (unsigned int j=0; j< pjs.size(); ++j) { ret.push_back(ParticleIndexPair(pis[i], pjs[j])); } } return ret; }
ParticleIndexPairs BondPairContainer::get_range_indexes() const { ParticleIndexes ia = sc_->get_range_indexes(); ParticleIndexPairs ret; ret.reserve(ia.size()); for (unsigned int i = 0; i < ia.size(); ++i) { Bond b(get_model(), ia[i]); ret.push_back( ParticleIndexPair(b.get_bonded(0).get_particle_index(), b.get_bonded(1).get_particle_index())); } return ret; }
ParticleIndexPairs QuadraticClosePairsFinder::get_close_pairs( Model *m, const ParticleIndexes &pt) const { set_was_used(true); IMP_OBJECT_LOG; IMP_LOG_TERSE("Adding close pairs from " << pt.size() << " particles with threshold " << get_distance() << std::endl); ParticleIndexPairs ret; for (unsigned int i = 0; i < pt.size(); ++i) { for (unsigned int j = 0; j < i; ++j) { if (get_are_close(m, pt[i], pt[j])) { ret.push_back(ParticleIndexPair(pt[i], pt[j])); } } } return ret; }
ParticleIndexPairs QuadraticClosePairsFinder::get_close_pairs( Model *m, const ParticleIndexes &pta, const ParticleIndexes &ptb) const { set_was_used(true); IMP_OBJECT_LOG; IMP_LOG_TERSE("Quadratic add_close_pairs called with " << pta.size() << " and " << ptb.size() << std::endl); ParticleIndexPairs ret; for (unsigned int i = 0; i < pta.size(); ++i) { for (unsigned int j = 0; j < ptb.size(); ++j) { if (get_are_close(m, pta[i], ptb[j])) { ret.push_back(ParticleIndexPair(pta[i], ptb[j])); } } } return ret; }