10#ifndef IMPNPCTRANSPORT_UTIL_H
11#define IMPNPCTRANSPORT_UTIL_H
13#include "npctransport_config.h"
15#include <IMP/npctransport/internal/util.h>
27IMPNPCTRANSPORT_BEGIN_NAMESPACE
34(ParticlesTemp
const& particles);
39(ParticlesTemp
const& particles);
44(ParticlesTemp
const& particles);
55(std::string config_txt, std::string config_pb);
97( ::npctransport_proto::Statistics* s,
115 "Particle must be rigid body in order to use"
116 " its ref frame in get_global_from_local_v3");
120 return t.get_transformed(local);
136template<
class t_ordered_set>
137inline boost::tuple<unsigned int, unsigned int>
140 t_ordered_set lost, gained;
143 internal::is_sorted(old),
144 "get_n_lost_and_gained() is expecting an ordered set only");
147 internal::is_sorted(cur),
148 "get_n_lost_and_gained() is expecting an ordered set only");
149 std::set_difference(old.begin(), old.end(), cur.begin(), cur.end(),
150 std::inserter(lost, lost.begin()) );
151 std::set_difference(cur.begin(), cur.end(), old.begin(), old.end(),
152 std::inserter(gained, gained.begin()) );
153 return boost::make_tuple(lost.size(), gained.size());
158template<
class t_value>
159inline std::pair<t_value, t_value>
162 return (v0 >= v1) ? std::make_pair(v0,v1) : std::make_pair(v1,v0);
167template<
typename V3iter>
169(V3iter first, V3iter last,
double radius)
172 for(V3iter it = first;it != last; it++) {
210IMPNPCTRANSPORT_END_NAMESPACE
A particle with a user-defined type.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Class to handle individual particles of a Model object.
const Transformation3D & get_transformation_to() const
Return transformation from local to global coordinates.
A decorator for a rigid body.
Store all parameters for a simulation.
SphereD< 3 > Sphere3D
Typedef for Python.
IMP::Vector< Sphere3D > Sphere3Ds
Key< 34897493 > ParticleType
An IMP::Key object for identifying types of particles by strings.
algebra::Vector3D get_global_from_local_v3(Particle *p, const algebra::Vector3D &local)
unsigned int find_or_add_floater_of_type(::npctransport_proto::Statistics *s, IMP::core::ParticleType pt)
void copy_hierarchy_reference_frame_recursive(Particle *src_p, Particle *trg_p)
std::pair< t_value, t_value > make_unordered_pair(t_value v0, t_value v1)
Canonize such that v0>=v1 so order doesn't matter.
void get_protobuf_configuration_from_text(std::string config_txt, std::string config_pb)
unsigned int find_or_add_interaction_of_type(::npctransport_proto::Statistics *s, IMP::npctransport::InteractionType it)
boost::tuple< unsigned int, unsigned int > get_n_lost_and_gained(t_ordered_set old, t_ordered_set cur)
std::pair< IMP::core::ParticleType, IMP::core::ParticleType > InteractionType
an interaction that involves particles of two types
ParticlesTemp get_non_optimizable_particles(ParticlesTemp const &particles)
void copy_FGs_coordinates(SimulationData const *src_sd, SimulationData *trg_sd)
copy coordinates of src_sd to trg_sd for FG repeats only
void copy_particle_reference_frame_if_applicable(Particle *src_p, Particle *trg_p)
unsigned int find_or_add_fg_bead_of_type(::npctransport_proto::Statistics *s, IMP::core::ParticleType pt)
unsigned int find_or_add_fg_chain_of_type(::npctransport_proto::Statistics *s, IMP::core::ParticleType pt)
ParticlesTemp get_optimizable_particles(ParticlesTemp const &particles)
algebra::Sphere3Ds get_spheres_from_vectors(V3iter first, V3iter last, double radius)
convert vectors to spheres of passed radius
ParticleIndexes get_particle_indexes(ParticlesTemp const &particles)
Vector< VectorD< 3 > > Vector3Ds
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
forward declaration of incomplete protobuf files for the main data structures used
functionality for defining rigid bodies