9 #ifndef IMPMULTIFIT_ANCHOR_GRAPH_H
10 #define IMPMULTIFIT_ANCHOR_GRAPH_H
12 #include <boost/graph/adjacency_list.hpp>
15 #include <IMP/multifit/multifit_config.h>
19 IMPMULTIFIT_BEGIN_NAMESPACE
22 typedef boost::property<boost::edge_weight_t, float> EdgeWeightProperty;
23 typedef boost::property<boost::vertex_index_t, int> VertexIndexProperty;
25 typedef boost::adjacency_list<boost::vecS, boost::vecS,
28 EdgeWeightProperty> AnchorGraph;
29 typedef boost::graph_traits<AnchorGraph> GTraits;
30 typedef boost::graph_traits<AnchorGraph const> Const_GTraits;
31 typedef GTraits::vertex_descriptor GVertex;
32 typedef GTraits::edge_descriptor GEdge;
36 void add_edge(
int i,
int j) {
37 boost::add_edge(id2node_[i],id2node_[j],g_);
45 void set_particle_probabilities_on_anchors(
48 void show(std::ostream& out=std::cout)
const;
49 unsigned int get_number_of_anchors()
const {
return boost::num_vertices(g_);}
50 unsigned int get_number_of_edges()
const {
return boost::num_edges(g_);}
54 bool get_are_probabilities_for_particle_set(
Particle *p)
const {
55 return particle_to_anchor_probabilities_.find(p) !=
56 particle_to_anchor_probabilities_.end();
62 std::map<Particle *,Floats> particle_to_anchor_probabilities_;
64 std::vector<GVertex> id2node_;
68 IMPMULTIFIT_END_NAMESPACE