本文整理汇总了C++中ParticleIndexes::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleIndexes::push_back方法的具体用法?C++ ParticleIndexes::push_back怎么用?C++ ParticleIndexes::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleIndexes
的用法示例。
在下文中一共展示了ParticleIndexes::push_back方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_all_possible_indexes
ParticleIndexes DummyPairContainer::get_all_possible_indexes() const {
ParticleIndexes ret = c_->get_all_possible_indexes();
ModelObjectsTemp mos =
cpf_->get_inputs(get_model(), c_->get_indexes());
for (unsigned int i = 0; i < mos.size(); ++i) {
ModelObject *o = mos[i];
Particle *p = dynamic_cast<Particle *>(o);
if (p) ret.push_back(p->get_index());
}
return ret;
}
示例2: get_movable_particles
ParticleIndexes MonteCarlo::get_movable_particles() const {
ParticleIndexes movable;
for (unsigned int i = 0; i < get_number_of_movers(); ++i) {
ModelObjectsTemp t = get_mover(i)->get_outputs();
for (unsigned int j = 0; j < t.size(); ++j) {
ModelObject *mo = t[j];
if (dynamic_cast<Particle *>(mo)) {
movable.push_back(dynamic_cast<Particle *>(mo)->get_index());
}
}
}
return movable;
}
示例3: do_propose
core::MonteCarloMoverResult RevoluteJointMover::do_propose() {
IMP_OBJECT_LOG;
boost::normal_distribution<double> mrng(0, stddev_);
boost::variate_generator<RandomNumberGenerator &,
boost::normal_distribution<double> >
sampler(random_number_generator, mrng);
for (unsigned int i = 0; i < joints_.size(); ++i) {
originals_[i] = joints_[i]->get_angle();
joints_[i]->set_angle(originals_[i] + sampler());
}
//get changed particles' coordinates
ParticleIndexes idx;
core::RigidMembers tmp(joints_[0]->get_parent_node().get_rigid_members());
for (unsigned int i = 0; i < tmp.size(); ++i)
idx.push_back(tmp[i]->get_index());
for (unsigned int j = 0; j < joints_.size(); ++j) {
tmp = joints_[j]->get_child_node().get_rigid_members();
for (unsigned int i = 0; i < tmp.size(); ++i)
idx.push_back(tmp[i]->get_index());
}
return core::MonteCarloMoverResult(idx, 1.0);
}
示例4: 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;
}