IMP logo
IMP Reference Guide  2.11.0
The Integrative Modeling Platform
IMP::domino::RestraintCache Class Reference

#include <IMP/domino/subset_scores.h>

+ Inheritance diagram for IMP::domino::RestraintCache:

Detailed Description

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.

Public Member Functions

 RestraintCache (ParticleStatesTable *pst, unsigned int size=std::numeric_limits< unsigned int >::max())
 
void add_restraints (const RestraintsAdaptor &rs)
 
double get_hit_rate () const
 
unsigned int get_number_of_entries () const
 Return the number of entries currently in the cache. More...
 
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
 Return the slice for that restraint given the subset. More...
 
virtual std::string get_type_name () const
 
virtual ::IMP::VersionInfo get_version_info () const
 Get information about the module and version of the object. More...
 
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
 Print out information about the known restraints and restraint sets. More...
 
void validate () const
 Check the entries in the cache. More...
 
- Public Member Functions inherited from IMP::Object
virtual void clear_caches ()
 
CheckLevel get_check_level () const
 
LogLevel get_log_level () const
 
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::Object
 Object (std::string name)
 Construct an object with the given name. More...
 
virtual void do_destroy ()
 

Member Function Documentation

void IMP::domino::RestraintCache::add_restraints ( const RestraintsAdaptor 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 219 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

Get the score of a set or restraint.

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 176 of file subset_scores.h.

+ Here is the call graph for this function:

double IMP::domino::RestraintCache::get_score ( Restraint r,
const Subset s,
const Assignment a 
) const

Get the score for a restraint given a subset and assignment on that subset.

Slice IMP::domino::RestraintCache::get_slice ( Restraint r,
const Subset s 
) const

Return the slice for that restraint given the subset.

virtual ::IMP::VersionInfo IMP::domino::RestraintCache::get_version_info ( ) const
virtual

Get information about the module and version of the object.

Reimplemented from IMP::Object.

Definition at line 227 of file subset_scores.h.

void IMP::domino::RestraintCache::load_last_score ( Restraint r,
const Subset s,
const Assignment a 
)

Make it so Restraint::get_last_score() returns the score.

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.

Parameters
[in]particle_orderingAn ordering for the particles.
[in]restraintsWhich restraints to write out entries for. You probably want to use get_restraints() to generate this.
[in]max_entriesHow many entries to write out at most.
[in]groupWhere 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.


The documentation for this class was generated from the following file: