IMP Reference Guide
2.21.0
The Integrative Modeling Platform
|
A cached functor for computing a distance based score for D particles. More...
#include <IMP/score_functor/ScoreWithCache.h>
A cached functor for computing a distance based score for D particles.
This is similar to Score but requires callers to call check_cache_valid() in any scoring function evaluation before any of the methods that use the cache.
Definition at line 24 of file ScoreWithCache.h.
Public Member Functions | |
void | check_cache_valid (Model *m) const |
Make sure the cache is up to date. More... | |
ModelObjectsTemp | get_inputs (Model *m, const ParticleIndexes &pis) const |
template<unsigned int D> | |
bool | get_is_trivially_zero_with_cache (Model *m, const Array< D, ParticleIndex > &p, double squared_distance) const |
template<unsigned int D> | |
double | get_maximum_range (Model *m, const Array< D, ParticleIndex > &p) const |
template<unsigned int D> | |
DerivativePair | get_score_and_derivative_with_cache (Model *m, const Array< D, ParticleIndex > &p, double distance) const |
Return the score and derivative at the passed feature size (eg distance). More... | |
template<unsigned int D> | |
double | get_score_with_cache (Model *m, const Array< D, ParticleIndex > &p, double distance) const |
Return the score at the passed feature size (eg distance). More... | |
void | show (std::ostream &) const |
void IMP::score_functor::ScoreWithCache::check_cache_valid | ( | Model * | m | ) | const |
Make sure the cache is up to date.
This must be called in any scoring function evaluation before any of the methods that use the cache.
ModelObjectsTemp IMP::score_functor::ScoreWithCache::get_inputs | ( | Model * | m, |
const ParticleIndexes & | pis | ||
) | const |
Return the set of particles read when particle p is part of the passed tuples. The default implementation provided here just returns the list containing p.
Definition at line 82 of file ScoreWithCache.h.
bool IMP::score_functor::ScoreWithCache::get_is_trivially_zero_with_cache | ( | Model * | m, |
const Array< D, ParticleIndex > & | p, | ||
double | squared_distance | ||
) | const |
Return true if the function can be easily determined to be zero at the passed squared distance. The default implementation provided here returns false.
Definition at line 62 of file ScoreWithCache.h.
double IMP::score_functor::ScoreWithCache::get_maximum_range | ( | Model * | m, |
const Array< D, ParticleIndex > & | p | ||
) | const |
Return an upper bound on the distance at which the score can be non-zero. The default implementation provided here returns infinity.
Definition at line 73 of file ScoreWithCache.h.
DerivativePair IMP::score_functor::ScoreWithCache::get_score_and_derivative_with_cache | ( | Model * | m, |
const Array< D, ParticleIndex > & | p, | ||
double | distance | ||
) | const |
Return the score and derivative at the passed feature size (eg distance).
The derivative is for the feature decreasing.
double IMP::score_functor::ScoreWithCache::get_score_with_cache | ( | Model * | m, |
const Array< D, ParticleIndex > & | p, | ||
double | distance | ||
) | const |
Return the score at the passed feature size (eg distance).
The involved particle indexes are passed along.