当前位置: 首页>>代码示例>>C++>>正文


C++ ParticleIndexes::push_back方法代码示例

本文整理汇总了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;
}
开发者ID:salilab,项目名称:imp,代码行数:11,代码来源:incremental_scoring_function.cpp

示例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;
}
开发者ID:AljGaber,项目名称:imp,代码行数:13,代码来源:MonteCarlo.cpp

示例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);
}
开发者ID:salilab,项目名称:imp,代码行数:23,代码来源:RevoluteJointMover.cpp

示例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;
}
开发者ID:AljGaber,项目名称:imp,代码行数:18,代码来源:Simulator.cpp


注:本文中的ParticleIndexes::push_back方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。