8#ifndef IMPMISC_LOG_PAIR_SCORE_H
9#define IMPMISC_LOG_PAIR_SCORE_H
11#include <IMP/misc/misc_config.h>
14#include <boost/unordered_map.hpp>
16IMPMISC_BEGIN_NAMESPACE
22 mutable boost::unordered_map<ParticlePair, unsigned int> map_;
41 unsigned int>::const_iterator it = map_.begin();
42 it != map_.end(); ++it) {
43 ret.push_back(it->first);
51 return map_.find(pp) != map_.end();
58inline Float LogPairScore::evaluate_index(
Model *m,
61 ParticlePair pp(m->get_particle(p[0]), m->get_particle(p[1]));
62 if (map_.find(pp) == map_.end()) {
Class for adding derivatives from restraints to the model.
Class for storing model, its restraints, constraints, and particles.
Track the pairs of particles passed.
LogPairScore()
create with an empty map
void clear()
Clear the lst of pairs.
bool get_contains(const ParticlePair &pp) const
Return true if the pair is in the list.
virtual ModelObjectsTemp do_get_inputs(Model *, const ParticleIndexes &) const override
Overload this method to specify the inputs.
ParticlePairsTemp get_particle_pairs() const
Get a list of all pairs (without multiplicity).
virtual double evaluate_index(Model *m, const ParticleIndexPair &p, DerivativeAccumulator *da) const override
Compute the score and the derivative if needed.
Compile-time generic restraint and constraint support.
double Float
Basic floating-point value (could be float, double...).
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Array< 2, ParticleIndex > ParticleIndexPair
An ordered pair of particles, each identified by its ParticleIndex.
Array< 2, WeakPointer< Particle >, Particle * > ParticlePair
IMP::Vector< ParticlePair > ParticlePairsTemp
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
#define IMP_PAIR_SCORE_METHODS(Name)