10 #ifndef IMPNPCTRANSPORT_UTIL_H
11 #define IMPNPCTRANSPORT_UTIL_H
13 #include "npctransport_config.h"
15 #include <IMP/npctransport/internal/util.h>
27 IMPNPCTRANSPORT_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");
136 template<
class t_ordered_set>
137 inline 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());
158 template<
class t_value>
159 inline std::pair<t_value, t_value>
162 return (v0 >= v1) ? std::make_pair(v0,v1) : std::make_pair(v1,v0);
175 std::set< std::pair<Particle*, Particle*> >
177 for(
unsigned int i = 0; i < ps0.size(); i++)
179 for(
unsigned int j = 0; j < ps1.size(); j++)
181 if(ps0[i]->
get_index()==ps1[j]->get_index()){
184 all_unordered_pairs.insert
188 return all_unordered_pairs.size();
193 template<
typename V3iter>
195 (V3iter first, V3iter last,
double radius)
198 for(V3iter it = first;it != last; it++) {
207 IMPNPCTRANSPORTEXPORT
212 IMPNPCTRANSPORTEXPORT
220 IMPNPCTRANSPORTEXPORT
227 IMPNPCTRANSPORTEXPORT
232 IMPNPCTRANSPORTEXPORT
234 SimulationData* trg_sd);
236 IMPNPCTRANSPORT_END_NAMESPACE
std::pair< IMP::core::ParticleType, IMP::core::ParticleType > InteractionType
an interaction that involves particles of two types
void copy_FGs_coordinates(SimulationData const *src_sd, SimulationData *trg_sd)
copy coordinates of src_sd to trg_sd for FG repeats only
algebra::Sphere3Ds get_spheres_from_vectors(algebra::Vector3Ds const &vs, double radius)
convert vectors to spheres of passed radius
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)
void copy_hierarchy_reference_frame_recursive(Particle *src_p, Particle *trg_p)
A particle with a user-defined type.
ParticlesTemp get_non_optimizable_particles(ParticlesTemp const &particles)
void copy_particle_reference_frame_if_applicable(Particle *src_p, Particle *trg_p)
Ints get_index(const ParticlesTemp &particles, const Subset &subset, const Subsets &excluded)
ParticleIndexes get_particle_indexes(ParticlesTemp const &particles)
functionality for defining rigid bodies
algebra::Vector3D get_global_from_local_v3(Particle *p, const algebra::Vector3D &local)
const Transformation3D & get_transformation_to() const
Return transformation from local to global coordinates.
ParticlesTemp get_optimizable_particles(ParticlesTemp const &particles)
unsigned int find_or_add_fg_chain_of_type(::npctransport_proto::Statistics *s, IMP::core::ParticleType pt)
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.
unsigned int find_or_add_fg_bead_of_type(::npctransport_proto::Statistics *s, IMP::core::ParticleType pt)
unsigned int get_maximal_number_of_unordered_pairs(ParticlesTemp const &ps0, ParticlesTemp const &ps1)
Class to handle individual particles of a Model object.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
unsigned int find_or_add_floater_of_type(::npctransport_proto::Statistics *s, IMP::core::ParticleType pt)
boost::tuple< unsigned int, unsigned int > get_n_lost_and_gained(t_ordered_set old, t_ordered_set cur)
A decorator for a rigid body.
IMP::algebra::ReferenceFrame3D get_reference_frame() const
forward declaration of incomplete protobuf files for the main data structures used ...