IMP
2.0.0
The Integrative Modeling Platform
|
#include <IMP/domino/subset_scores.h>
Public Member Functions | |
RestraintCache (ParticleStatesTable *pst, unsigned int size=std::numeric_limits< unsigned int >::max()) | |
void | add_restraints (const RestraintsTemp &rs) |
double | get_hit_rate () const |
unsigned int | get_number_of_entries () const |
RestraintsTemp | get_restraints (const Subset &s, const Subsets &exclusions) const |
RestraintsTemp | get_restraints () const |
double | get_score (Restraint *r, const Assignment &a) const |
Get the score of a set or restraint. More... | |
double | get_score (Restraint *r, const Subset &s, const Assignment &a) const |
Slice | get_slice (Restraint *r, const Subset &s) const |
void | load_cache (const ParticlesTemp &ps, RMF::HDF5::ConstGroup group) |
void | load_last_score (Restraint *r, const Subset &s, const Assignment &a) |
make it so Restraint::get_last_score() returns the score More... | |
void | save_cache (const ParticlesTemp &particle_ordering, const RestraintsTemp &restraints, RMF::HDF5::Group group, unsigned int max_entries) |
void | show_restraint_information (std::ostream &out=std::cout) const |
void | validate () const |
Public Member Functions inherited from IMP::base::Object | |
virtual void | clear_caches () |
virtual IMP::base::VersionInfo | get_version_info () const =0 |
Get information about the module and version of the object. | |
void | set_check_level (CheckLevel l) |
void | set_log_level (LogLevel l) |
Set the logging level used in this object. More... | |
void | set_was_used (bool tf) const |
void | show (std::ostream &out=std::cout) const |
const std::string & | get_name () const |
void | set_name (std::string name) |
Additional Inherited Members | |
Protected Member Functions inherited from IMP::base::Object | |
Object (std::string name) | |
Construct an object with the given name. More... | |
Related Functions inherited from IMP::base::Object | |
typedef IMP::base::Vector < IMP::base::WeakPointer < Object > > | ObjectsTemp |
Implement a cache for restraint scores as well as management of restraints for domino.
The cache size passed to the constructor is the maximum number of scores that will be saved. A least-recently-used eviction policy is used when that number is exceeded.
Definition at line 37 of file subset_scores.h.
void IMP::domino::RestraintCache::add_restraints | ( | const RestraintsTemp & | rs | ) |
Recursively process the passed restraints (and sets) so all contained restraints and sets that have maximum are known.
unsigned int IMP::domino::RestraintCache::get_number_of_entries | ( | ) | const |
Return the number of entries currently in the cache.
Definition at line 215 of file subset_scores.h.
RestraintsTemp IMP::domino::RestraintCache::get_restraints | ( | const Subset & | s, |
const Subsets & | exclusions | ||
) | const |
Return the restraints that should be evaluated for the subset, given the exclusions.
double IMP::domino::RestraintCache::get_score | ( | Restraint * | r, |
const Assignment & | a | ||
) | const |
The returned score will be std::numeric_limits<double>::max() if any of the limits are violated.
The assignment passed is the assignment for the particles used by the restraint, not that for some whole subset. See the other get_score() function for a perhaps more useful one.
Definition at line 170 of file subset_scores.h.
double IMP::domino::RestraintCache::get_score | ( | Restraint * | r, |
const Subset & | s, | ||
const Assignment & | a | ||
) | const |
The the score for a restraint given a subset and assignment on that subset.
Return the slice for that restraint given the subset.
void IMP::domino::RestraintCache::load_last_score | ( | Restraint * | r, |
const Subset & | s, | ||
const Assignment & | a | ||
) |
This is useful when writing the restraints to disk, as that code often goes off the last score to avoid recomputing the restraints.
void IMP::domino::RestraintCache::save_cache | ( | const ParticlesTemp & | particle_ordering, |
const RestraintsTemp & | restraints, | ||
RMF::HDF5::Group | group, | ||
unsigned int | max_entries | ||
) |
This assumes that restraints are always added to the cache in the same order.
[in] | particle_ordering | An ordering for the particles. |
[in] | restraints | Which restraints to write out entries for. You probably want to use get_restraints() to generate this. |
[in] | max_entries | How many entries to write out at most. |
[in] | group | Where to put the entries. |
void IMP::domino::RestraintCache::show_restraint_information | ( | std::ostream & | out = std::cout | ) | const |
Print out information about the known restraints and restraint sets.
void IMP::domino::RestraintCache::validate | ( | ) | const |
Check the entries in the cache.