本文整理汇总了C++中ParticleIndexes::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleIndexes::begin方法的具体用法?C++ ParticleIndexes::begin怎么用?C++ ParticleIndexes::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleIndexes
的用法示例。
在下文中一共展示了ParticleIndexes::begin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_bond
/* This is implemented like this so that it doesn't read any particles other
than a and b. To do otherwise would make it rather annoying to use in
evaluate.
*/
Bond get_bond(Bonded a, Bonded b) {
if (a == b) return Bond();
ParticleIndexes ba = a.get_bond_indexes();
ParticleIndexes bb = b.get_bond_indexes();
std::sort(bb.begin(), bb.end());
for (unsigned int i = 0; i < ba.size(); ++i) {
if (std::binary_search(bb.begin(), bb.end(), ba[i])) {
return Bond(a.get_model(), ba[i]);
}
}
return Bond();
}
示例2: get_close_pairs
ParticleIndexPairs GridClosePairsFinder::get_close_pairs(
Model *m, const ParticleIndexes &ca,
const ParticleIndexes &cb) const {
IMP_OBJECT_LOG;
set_was_used(true);
ParticleIndexPairs out;
internal::ParticleIndexHelper::fill_close_pairs(
internal::ParticleIndexHelper::get_particle_set(ca.begin(), ca.end(), 0),
internal::ParticleIndexHelper::get_particle_set(cb.begin(), cb.end(), 1),
internal::ParticleIndexTraits(m, get_distance()),
internal::ParticleIndexPairSink(m, access_pair_filters(), out));
return out;
}
示例3: remove_if_not_equal
void SingletonPredicate::remove_if_not_equal(Model *m,
ParticleIndexes& ps,
int value) const {
ps.erase(std::remove_if(ps.begin(), ps.end(),
make_predicate_not_equal(this, m, value)),
ps.end());
}
示例4: all
bool InternalDynamicListTripletContainer::
check_list(const ParticleIndexes& cp) const {
ParticleIndexes app
= IMP::internal::get_index(scope_->get_all_possible_particles());
compatibility::set<ParticleIndex> all(app.begin(),
app.end());
for (unsigned int i=0; i< cp.size(); ++i) {
IMP_USAGE_CHECK(all.find(cp[i]) != all.end(),
"Particle " << cp[i]
<< " is not in the list of all possible particles");
}
return true;
}
示例5: get_simulation_particle_indexes
ParticleIndexes Simulator::get_simulation_particle_indexes() const {
IMP_OBJECT_LOG;
ParticleIndexes ps;
if (get_number_of_particles() == 0) {
Model *m = get_model();
ParticleIndexes pis = m->get_particle_indexes();
for (ParticleIndexes::const_iterator it = pis.begin();
it != pis.end(); ++it) {
if (get_is_simulation_particle(*it)) {
ps.push_back(*it);
}
}
} else {
ps = IMP::internal::get_index(
ParticlesTemp(particles_begin(), particles_end()));
}
return ps;
}