Ejemplo n.º 1
0
ModelObjectsTemp TransformationAndReflectionSymmetry::do_get_inputs(
    kernel::Model *m, const kernel::ParticleIndexes &pis) const {
  kernel::ModelObjectsTemp ret(2 * pis.size());
  for (unsigned int i = 0; i < pis.size(); ++i) {
    ret[2 * i + 0] = m->get_particle(pis[i]);
    ret[2 * i + 0] = Reference(m, pis[i]).get_reference_particle();
  }
  return ret;
}
Ejemplo n.º 2
0
ModelObjectsTemp AngleSingletonScore::do_get_inputs(
    kernel::Model *m, const kernel::ParticleIndexes &pi) const {
  kernel::ModelObjectsTemp ret(4 * pi.size());
  for (unsigned int i = 0; i < pi.size(); ++i) {
    Angle ad(m, pi[i]);
    ret[4 * i + 0] = ad.get_particle(0);
    ret[4 * i + 1] = ad.get_particle(1);
    ret[4 * i + 2] = ad.get_particle(2);
    ret[4 * i + 3] = m->get_particle(pi[i]);
  }
  return ret;
}
Ejemplo n.º 3
0
ParticleIndexPairs QuadraticClosePairsFinder::get_close_pairs(
    kernel::Model *m, const kernel::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);
  kernel::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(kernel::ParticleIndexPair(pt[i], pt[j]));
      }
    }
  }
  return ret;
}
Ejemplo n.º 4
0
ParticleIndexPairs QuadraticClosePairsFinder::get_close_pairs(
    kernel::Model *m, const kernel::ParticleIndexes &pta,
    const kernel::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);
  kernel::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(kernel::ParticleIndexPair(pta[i], ptb[j]));
      }
    }
  }
  return ret;
}
Ejemplo n.º 5
0
ModelObjectsTemp LeavesRefiner::do_get_inputs(
    kernel::Model *m, const kernel::ParticleIndexes &pis) const {
  kernel::ModelObjectsTemp ret;
  for (unsigned int i = 0; i < pis.size(); ++i) {
    ret += get_all_descendants(Hierarchy(m, pis[i], traits_));
  }
  return ret;
}
Ejemplo n.º 6
0
ModelObjectsTemp TransformationSymmetry::do_get_inputs(
    kernel::Model *m, const kernel::ParticleIndexes &pis) const {
  kernel::ModelObjectsTemp ret = IMP::kernel::get_particles(m, pis);
  for (unsigned int i = 0; i < pis.size(); ++i) {
    ret.push_back(Reference(m, pis[i]).get_reference_particle());
  }
  return ret;
}
Ejemplo n.º 7
0
ModelObjectsTemp DerivativesToRefined::do_get_outputs(
    kernel::Model *m, const kernel::ParticleIndexes &pis) const {
  kernel::ModelObjectsTemp ret;
  for (unsigned int i = 0; i < pis.size(); ++i) {
    ret +=
        IMP::kernel::get_particles(m, refiner_->get_refined_indexes(m, pis[i]));
  }
  return ret;
}
Ejemplo n.º 8
0
ModelObjectsTemp SoftCylinderPairScore::do_get_inputs(
    kernel::Model *m, const kernel::ParticleIndexes &pis) const {
  kernel::ModelObjectsTemp ret(pis.size() * 3);
  for (unsigned int i = 0; i < pis.size(); ++i) {
    ret[3 * i + 0] = m->get_particle(pis[i]);
    ret[3 * i + 1] = atom::Bond(m, pis[i]).get_bonded(0);
    ret[3 * i + 2] = atom::Bond(m, pis[i]).get_bonded(1);
  }
  return ret;
}
Ejemplo n.º 9
0
void Selection::set_hierarchies(kernel::Model *m,
                                const kernel::ParticleIndexes &pi) {
  m_ = m;
  h_ = pi;
  for (unsigned int i = 0; i < pi.size(); ++i) {
    Hierarchy h(m_, pi[i]);
    IMP_USAGE_CHECK(h.get_is_valid(true), "Hierarchy " << h
                                                       << " is not valid.");
  }
}
Ejemplo n.º 10
0
ModelObjectsTemp RefinedPairsPairScore::do_get_inputs(
    kernel::Model *m, const kernel::ParticleIndexes &pis) const {
  kernel::ParticleIndexes ps;
  for (unsigned int i = 0; i < pis.size(); ++i) {
    ps += get_indexes(get_set(m->get_particle(pis[i]), r_));
  }
  kernel::ModelObjectsTemp ret;
  ret += f_->get_inputs(m, ps);
  ret += r_->get_inputs(m, ps);
  return ret;
}