00001
00002
00003
00004
00005
00006
00007
00008 #ifndef IMPDOMINO_MAPPED_DISCRETE_SET_H
00009 #define IMPDOMINO_MAPPED_DISCRETE_SET_H
00010
00011 #include "IMP/Particle.h"
00012 #include <map>
00013 #include <sstream>
00014 #include "IMP/base_types.h"
00015 #include "domino_config.h"
00016 #include "DiscreteSet.h"
00017
00018 IMPDOMINO_BEGIN_NAMESPACE
00019
00020
00021 #ifndef IMP_SWIG
00022
00023 IMPDOMINOEXPORT StringKey node_name_key();
00024 #endif
00025
00026
00027 class IMPDOMINOEXPORT MappedDiscreteSet : public DiscreteSet
00028 {
00029 public:
00030
00031
00032
00033
00034 MappedDiscreteSet(const Particles &ps_target);
00035
00036
00037
00038
00039
00040 MappedDiscreteSet(Particles *ps_target,
00041 const std::vector<FloatKey> &atts);
00042
00043
00044
00045
00046
00047
00048
00049 void add_mapped_state(Particle* sampled_p,Particle *state);
00050
00051
00052
00053
00054
00055
00056 Particle * get_mapped_state(Particle *p_target,long state_ind) const;
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 Float get_mapped_state_val(Particle* p_target,
00067 long state_ind, IMP::FloatKey key) const;
00068
00069
00070 long get_number_of_mapped_states(Particle *p_target) const;
00071
00072
00073 bool is_valid() const;
00074
00075 void show(std::ostream& out=std::cout) const;
00076
00077 Particles get_particles() const {
00078 Particles ps;
00079 for(std::map<Particle *, Particles >::const_iterator it=
00080 states_map_.begin(); it != states_map_.end(); it++) {
00081 ps.push_back(it->first);
00082 }
00083 return ps;
00084 }
00085 protected:
00086 std::map<Particle *, Particles> states_map_;
00087 };
00088
00089 IMPDOMINO_END_NAMESPACE
00090
00091 #endif