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


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

本文整理汇总了C++中ParticlesTemp::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticlesTemp::push_back方法的具体用法?C++ ParticlesTemp::push_back怎么用?C++ ParticlesTemp::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ParticlesTemp的用法示例。


在下文中一共展示了ParticlesTemp::push_back方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: do_get_inputs

/* Return all particles whose attributes are read by the restraints. To
   do this, ask the pair score what particles it uses.*/
IMP::ModelObjectsTemp UniformBoundedRestraint::do_get_inputs() const {
  ParticlesTemp ret;
  ret.push_back(p_);
  ret.push_back(a_);
  ret.push_back(b_);
  return ret;
}
开发者ID:salilab,项目名称:imp,代码行数:9,代码来源:UniformBoundedRestraint.cpp

示例2: get_input_particles

ParticlesTemp CHARMMStereochemistryRestraint::get_input_particles() const
{
  ParticlesTemp ps;
  for (Particles::const_iterator b = bonds_.begin(); b != bonds_.end(); ++b) {
    ps.push_back(*b);
    ParticlesTemp bps = bond_score_->get_input_particles(*b);
    ps.insert(ps.end(), bps.begin(), bps.end());
  }
  for (Particles::const_iterator a = angles_.begin();
       a != angles_.end(); ++a) {
    ps.push_back(*a);
    ParticlesTemp bps = angle_score_->get_input_particles(*a);
    ps.insert(ps.end(), bps.begin(), bps.end());
  }
  for (Particles::const_iterator d = dihedrals_.begin();
       d != dihedrals_.end(); ++d) {
    ps.push_back(*d);
    ParticlesTemp bps = dihedral_score_->get_input_particles(*d);
    ps.insert(ps.end(), bps.begin(), bps.end());
  }
  for (Particles::const_iterator i = impropers_.begin();
       i != impropers_.end(); ++i) {
    ps.push_back(*i);
    ParticlesTemp bps = improper_score_->get_input_particles(*i);
    ps.insert(ps.end(), bps.begin(), bps.end());
  }
  return ps;
}
开发者ID:drussel,项目名称:imp,代码行数:28,代码来源:CHARMMStereochemistryRestraint.cpp

示例3: do_get_inputs

ModelObjectsTemp NOERestraint::do_get_inputs() const {
  ParticlesTemp ret;
  ret.push_back(p0_);
  ret.push_back(p1_);
  ret.push_back(sigma_);
  ret.push_back(gamma_);
  return ret;
}
开发者ID:j-ma-bu-l-l-ock,项目名称:imp,代码行数:8,代码来源:NOERestraint.cpp

示例4: do_get_inputs

/* Return all particles whose attributes are read by the restraints. To
   do this, ask the pair score what particles it uses.*/
ModelObjectsTemp  SigmoidRestraintSphere::do_get_inputs() const
{
  ParticlesTemp ret;
  ret.push_back(get_model()->get_particle(p1_));
  ret.push_back(get_model()->get_particle(p2_));
  return ret;
}
开发者ID:salilab,项目名称:imp,代码行数:9,代码来源:SigmoidRestraintSphere.cpp

示例5:

const ParticlesTemp
FixedRefiner::get_refined(Particle *) const
{
  ParticlesTemp ps;
  for(unsigned int i=0; i < pis_.size(); i++){
    ps.push_back(m_->get_particle(pis_[i]));
  }
  return ps;
}
开发者ID:j-ma-bu-l-l-ock,项目名称:imp,代码行数:9,代码来源:FixedRefiner.cpp

示例6: get_input_particles

ParticlesTemp RadiusOfGyrationRestraint::get_input_particles() const
{
  ParticlesTemp pt;
  for (ParticleConstIterator it= particles_begin();
       it != particles_end(); ++it) {
      pt.push_back(*it);
  }
  return pt;
}
开发者ID:andreyto,项目名称:imp-fork-proddl,代码行数:9,代码来源:RadiusOfGyrationRestraint.cpp

示例7: do_get_inputs

/* Return all particles whose attributes are read by the restraints. To
   do this, ask the pair score what particles it uses.*/
ModelObjectsTemp CrossLinkMSRestraint::do_get_inputs() const {
    ParticlesTemp ret;
    for (unsigned int k = 0; k < get_number_of_contributions(); ++k) {
        if (ppis_[k][0] == ppis_[k][1]) {
            ret.push_back(get_model()->get_particle(ppis_[k][0]));
        } else {
            ret.push_back(get_model()->get_particle(ppis_[k][0]));
            ret.push_back(get_model()->get_particle(ppis_[k][1]));
        }
        if ( sigmass_[k][0] == sigmass_[k][1]) {
            ret.push_back(get_model()->get_particle(sigmass_[k][0]));
        } else {
            ret.push_back(get_model()->get_particle(sigmass_[k][0]));
            ret.push_back(get_model()->get_particle(sigmass_[k][1]));
        }
        ret.push_back(get_model()->get_particle(psis_[k]));
    }
    return ret;
}
开发者ID:j-ma-bu-l-l-ock,项目名称:imp,代码行数:21,代码来源:CrossLinkMSRestraint.cpp

示例8: get_refined

const ParticlesTemp RigidLeavesRefiner::get_refined(Particle *p) const {
  ParticlesTemp members = core::RigidBody(p).get_rigid_members();
  ParticlesTemp ret;
  for (ParticlesTemp::const_iterator it = members.begin(); it != members.end();
       ++it) {
    if (atom::Hierarchy::get_is_setup(*it)
        && atom::Hierarchy(*it).get_number_of_children() == 0) {
      ret.push_back(*it);
    }
  }
  return ret;
}
开发者ID:salilab,项目名称:imp,代码行数:12,代码来源:RigidLeavesRefiner.cpp

示例9: get_output_particles

ParticlesTemp get_output_particles(const ModelObjectsTemp &mo) {
  ParticlesTemp ret;
  for (unsigned int i = 0; i < mo.size(); ++i) {
    ModelObject *o = mo[i];
    Particle *p = dynamic_cast<Particle *>(o);
    if (p)
      ret.push_back(p);
    else {
      ret += get_output_particles(o->get_inputs());
    }
  }
  return ret;
}
开发者ID:j-ma-bu-l-l-ock,项目名称:imp,代码行数:13,代码来源:ModelObject.cpp

示例10: do_propose

core::MonteCarloMoverResult BallMover::do_propose() {
  IMP_OBJECT_LOG;

  // random displacement
  algebra::Vector3D displacement = algebra::get_random_vector_in(
      algebra::Sphere3D(algebra::Vector3D(0.0, 0.0, 0.0), max_tr_));

  // store old coordinates of master particle
  oldcoord_ = core::XYZ(p_).get_coordinates();

  // master particle coordinates after displacement
  algebra::Vector3D nc = oldcoord_ + displacement;

  // find center of the closest cell
  double mindist = 1.0e+24;
  unsigned icell = 0;
  for (unsigned i = 0; i < ctrs_.size(); ++i) {
    // calculate distance between nc and cell center
    double dist = algebra::get_l2_norm(nc - ctrs_[i]);
    // find minimum distance
    if (dist < mindist) {
      mindist = dist;
      icell = i;
    }
  }

  // find inverse transformation
  algebra::Transformation3D cell_tr = trs_[icell].get_inverse();

  // set new coordinates for master particle
  core::XYZ(p_).set_coordinates(cell_tr.get_transformed(nc));

  // set new coordinates for slave particles
  oldcoords_.clear();
  for (unsigned i = 0; i < ps_.size(); ++i) {
    core::XYZ xyz = core::XYZ(ps_[i]);
    algebra::Vector3D oc = xyz.get_coordinates();
    // store old coordinates
    oldcoords_.push_back(oc);
    // apply transformation
    algebra::Vector3D nc = cell_tr.get_transformed(oc);
    xyz.set_coordinates(nc);
  }

  ParticlesTemp ret;
  ret.push_back(p_);
  ret.insert(ret.end(), ps_.begin(), ps_.end());

  return core::MonteCarloMoverResult(get_indexes(ret), 1.0);
}
开发者ID:j-ma-bu-l-l-ock,项目名称:imp,代码行数:50,代码来源:BallMover.cpp

示例11: get_input_particles

/* Return all particles whose attributes are read by the restraints. To
   do this, ask the pair score what particles it uses.*/
ParticlesTemp MarginalHBondRestraint::get_input_particles() const
{
  ParticlesTemp ret;
  for (unsigned i=0; i<volumes_.size(); ++i)
  {
      int npairs = contribs_[i]->get_number_of_particle_pairs();
      for (int j=0; j < npairs; ++j)
      {
          ret.push_back(contribs_[i]->get_particle_pair(j)[0]);
          ret.push_back(contribs_[i]->get_particle_pair(j)[1]);
      }
  }
  return ret;
}
开发者ID:andreyto,项目名称:imp-fork-proddl,代码行数:16,代码来源:MarginalHBondRestraint.cpp

示例12: get_clique_graph

IMPDOMINOEXPORT CliqueGraph get_clique_graph(const InteractionGraph& cig) {
  InteractionGraphConstVertexName pm= boost::get(boost::vertex_name, cig);
  typedef base::Vector<InteractionGraphVertex> Clique;
  base::Vector<Clique> cliques;
  internal::maximal_cliques(cig, std::back_inserter(cliques));
  for (unsigned int i=0; i< cliques.size(); ++i) {
    /*std::cout << "Clique is ";
      for (unsigned int j=0; j< cliques[i].size(); ++j) {
      std::cout << cliques[i][j] << " ";
      }*/
    std::sort(cliques[i].begin(), cliques[i].end());
  }
  CliqueGraph cg(cliques.size());
  CliqueGraphVertexName cm
    = boost::get(boost::vertex_name, cg);
  for (unsigned int i=0; i< cliques.size(); ++i) {
    ParticlesTemp cur;
    for (unsigned int j=0; j< cliques[i].size(); ++j) {
      cur.push_back(pm[cliques[i][j]]);
    }
    Subset ss(cur);
    cm[i]=ss;
  }
  for (unsigned int i=0; i< cliques.size(); ++i) {
    for (unsigned int j=0; j< i; ++j) {
      Subset intersection= get_intersection(cm[i], cm[j]);
      if (intersection.size() >0) {
        double minus_weight=intersection.size();
        /*std::cout << "edge " << i << " " << j
          << " has weight "
          << -static_cast<int>(intersection.size()) << std::endl;*/
        boost::add_edge(i, j,
                        CliqueGraph::edge_property_type(-minus_weight),
                        cg);
      }
    }
  }
  return cg;
}
开发者ID:drussel,项目名称:imp,代码行数:39,代码来源:subset_graphs.cpp

示例13: do_get_inputs

ModelObjectsTemp DummyRestraint::do_get_inputs() const {
  ParticlesTemp ret;
  ret.push_back(p0_);
  ret.push_back(p1_);
  return ret;
}
开发者ID:AljGaber,项目名称:imp,代码行数:6,代码来源:DummyRestraint.cpp

示例14: do_get_inputs

ModelObjectsTemp DummyRestraint::do_get_inputs() const {
  ParticlesTemp pt;
  pt.push_back(p1_);
  pt.push_back(p2_);
  return pt;
}
开发者ID:j-ma-bu-l-l-ock,项目名称:imp,代码行数:6,代码来源:merge_tree_utils.cpp

示例15: get_input_particles

ParticlesTemp SameResiduePairFilter::get_input_particles( Particle* t) const {
  ParticlesTemp ret;
  ret.push_back(t);
  ret.push_back(Hierarchy(t).get_parent());
  return ret;
}
开发者ID:andreyto,项目名称:imp-fork-proddl,代码行数:6,代码来源:SameResiduePairFilter.cpp


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