8 #ifndef IMPPMI_UTILITIES_H
9 #define IMPPMI_UTILITIES_H
11 #include <IMP/pmi/pmi_config.h>
18 #include <boost/lexical_cast.hpp>
20 IMPPMI_BEGIN_NAMESPACE
28 for (
int n1=0;n1<nps;n1++){
29 for (
int n2=n1+1;n2<nps;n2++){
32 if (dist<dist_cutoff){
37 rs->add_restraint(rx);
47 double mindist = -1.0 ;
49 for (
unsigned int k1 = 0; k1 < m1.size(); ++k1) {
50 for (
unsigned int k2 = 0; k2 < m2.size(); ++k2) {
52 if (mindist < 0.0){mindist=dist;}
53 if (mindist > dist){mindist=dist;}
56 if (mindist < 0 ){mindist = 0;}
61 inline Floats get_list_of_bipartite_minimum_sphere_distance(
const ParticlesTemps & pss) {
63 for (
unsigned int k1 = 0; k1 < pss.size()-1; ++k1) {
64 for (
unsigned int k2 = k1+1; k2 < pss.size(); ++k2) {
67 double dist = IMP::pmi::get_bipartite_minimum_sphere_distance(xyzrs1,xyzrs2);
68 mindistances.push_back(dist);
89 if (atom::Molecule::get_is_setup(h) && atom::Copy::get_is_setup(h)) {
90 return h->get_name() +
"."
91 + boost::lexical_cast<std::string>(
atom::Copy(h).get_copy_index());
100 if (h->get_name()==
"System") {
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Restraint * create_restraint(Score *s, const typename Score::Argument &t, std::string name=std::string())
Distance restraint between two particles.
IMP::Vector< Float > Floats
Standard way to pass a bunch of Float values.
Model * get_model() const
Returns the Model containing the particle.
A decorator for Molecules.
A smart pointer to a reference counted object.
Object used to hold a set of restraints.
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
A decorator for keeping track of copies of a molecule.
double get_distance(const Plane3D &pln, const Vector3D &p)
Return the distance between a plane and a point in 3D.
std::string get_molecule_name_and_copy(atom::Hierarchy h)
Walk up a PMI2 hierarchy/representations and get the "molname.copynum".
The standard decorator for manipulating molecular structures.
RestraintSet * create_elastic_network(const Particles &ps, Float dist_cutoff, Float strength)
Create an elastic network restraint set.
double get_distance(XYZ a, XYZ b)
Compute the distance between a pair of particles.
A decorator for a particle with x,y,z coordinates.
A class for storing lists of IMP items.
A Score on the distance between a pair of particles.
bool get_is_canonical(atom::Hierarchy h)
Walk up a PMI2 hierarchy/representations and check if the root is named System.
#define IMP_THROW(message, exception_name)
Throw an exception with a message.
atom::Hierarchy get_parent_representation(atom::Hierarchy h)
Get the parent, or if non-tree Representation get the fake parent.
Array< 2, WeakPointer< Particle >, Particle * > ParticlePair
double Float
Basic floating-point value (could be float, double...)
A decorator for keeping track of copies of a molecule.
Type get_attribute(TypeKey attribute_key, ParticleIndex particle)
An exception for an invalid value being passed to IMP.
Decorator for a sphere-like particle.