9 #ifndef IMPDOMINO_PARTICLE_STATES_H
10 #define IMPDOMINO_PARTICLE_STATES_H
12 #include <IMP/domino/domino_config.h>
23 #include <IMP/internal/OwnerPointer.h>
29 IMPDOMINO_BEGIN_NAMESPACE
40 virtual unsigned int get_number_of_particle_states()
const=0;
41 virtual void load_particle_state(
unsigned int,
Particle*)
const=0;
56 "Out of range state found, this is not a default "
58 return static_cast<unsigned int>(v[0]);
74 IMP::OwnerPointer<ParticleStates> >
Map;
82 "I don't know about particle " << p->get_name());
83 return enumerators_.find(p)->second;
85 bool get_has_particle(
Particle *p)
const {
86 return enumerators_.find(p) != enumerators_.end();
90 ret.reserve(enumerators_.size());
91 for (Map::const_iterator it= enumerators_.begin();
92 it != enumerators_.end(); ++it) {
93 ret.push_back(it->first);
95 std::sort(ret.begin(), ret.end());
107 "Cannot have 0 states for a particle: \""
108 << p->get_name() <<
"\"\n");
140 nn_(
new algebra::NearestNeighbor3D(states)) {}
152 return nn_->get_nearest_neighbors(v, 1)[0];
207 IMP::OwnerPointer<ParticleStates> a_, b_;
223 IMP::OwnerPointer<ParticleStatesTable> pst_;
238 IMP::OwnerPointer<ParticleStates> inner_;
247 unsigned int cur= permutation_[i];
249 "Out of range state returned. This is perplexing.");
257 PermutationStates::get_number_of_particle_states()
const {
258 return inner_->get_number_of_particle_states();
261 PermutationStates::load_particle_state(
unsigned int i,
Particle *p)
const {
262 return inner_->load_particle_state(get_inner_state(i), p);
278 ParticlesTemp(pst->get_particles()) {
284 IMPDOMINO_END_NAMESPACE