/** * \file anchor_graph.cpp * \brief anchor graph utilities * * Copyright 2007-2013 IMP Inventors. All rights reserved. * */ #include #include #include #include IMPMULTIFIT_BEGIN_NAMESPACE ProbabilisticAnchorGraph::ProbabilisticAnchorGraph( algebra::Vector3Ds anchor_positions) :Object("ProbabilisticAnchorGraph%1%"){ GVertex u; for(unsigned int i=0;i0, "no solutions provided\n"); IMP_NEW(algebra::NearestNeighborD<3>, nn, (positions_)); Ints anchor_counters; anchor_counters.insert(anchor_counters.end(),positions_.size(),0); for (unsigned int i=0;iget_nearest_neighbor(loc)]++; } Floats probs; for (unsigned int i=0;i=min_prob) { anchors.push_back(positions_[i]); } } return anchors; } Floats ProbabilisticAnchorGraph::get_particle_probabilities(Particle *p) const { IMP_USAGE_CHECK(particle_to_anchor_probabilities_.find(p) != particle_to_anchor_probabilities_.end(), "Particle:"<get_name()<<" is not found\n"); return particle_to_anchor_probabilities_.find(p)->second; } void ProbabilisticAnchorGraph::show(std::ostream& out) const { out<<"( nodes:"<::const_iterator it = particle_to_anchor_probabilities_.begin(); it != particle_to_anchor_probabilities_.end(); it++) { out<first->get_name();//<<" : "<second<