IMP logo
Public Types | Public Member Functions | Protected Member Functions

IMP::PairContainer Class Reference


Detailed Description

A shared container for Pairs.

Stores a searchable shared collection of Pairs.

Implementors
Developers who wish to implement a PairContainer should inherit from this class and use the IMP_PAIR_CONTAINER() macro to help define the needed functions. Lamentably, we do not provide an example.
Inheritance diagram for IMP::PairContainer:

Public Types

typedef ParticlePair ContainedType

Public Member Functions

virtual void apply (const PairModifier *sm)=0
 Apply a SingletonModifier to the contents.
virtual void apply (const PairModifier *sm, DerivativeAccumulator &da)=0
 Apply a SingletonModifier to the contents.
virtual double evaluate (const PairScore *s, DerivativeAccumulator *da) const =0
 Evaluate a score on the contents.
virtual bool get_contains_particle_pair (const ParticlePair &v) const =0
virtual unsigned int get_number_of_particle_pairs () const =0
 return the number of Pairs in the container
virtual ParticlePair get_particle_pair (unsigned int i) const =0
ParticlePairsTemp get_particle_pairs () const
ParticlePairIterator particle_pairs_begin () const
 begin iterating through the Pairs
ParticlePairIterator particle_pairs_end () const
 iterate through the Pairs
Incremental Scoring

When incremental scoring is used, the container keeps track of changes to it since the last Model::evaluate() call.

Warning: PairContainer::get_removed_container() has not been stabilized and is likely to change without notice.
The address of the objects returned should not change over the lifetime of this container (but, of course, their contents will).
PairContainerget_removed_container () const
PairContainerget_added_container () const
virtual double evaluate_change (const PairScore *o, DerivativeAccumulator *da) const =0
virtual double evaluate_prechange (const PairScore *o, DerivativeAccumulator *da) const =0

Protected Member Functions

 PairContainer (Model *m, std::string name="PairContainer %1%")
virtual PairContainerPair get_added_and_removed_containers () const =0
bool get_has_added_and_removed_containers () const

Member Function Documentation

virtual double IMP::PairContainer::evaluate_change ( const PairScore o,
DerivativeAccumulator da 
) const [pure virtual]

Return the change in score (and derivatives) since the last evaluate of the current contents of the container.

virtual double IMP::PairContainer::evaluate_prechange ( const PairScore o,
DerivativeAccumulator da 
) const [pure virtual]

Return the score of the last evaluate for the current contents of the container.

virtual PairContainerPair IMP::PairContainer::get_added_and_removed_containers ( ) const [protected, pure virtual]

Containers must have containers that keep track of the particles which have been added or since the last step. These containers must be registered with the parent PairContainer.

Containers which are themselves returned by the get_added/removed functions do not have to register such containers.

virtual bool IMP::PairContainer::get_contains_particle_pair ( const ParticlePair v) const [pure virtual]
Note:
This function may be linear. Be aware of the complexity bounds of your particular container.
virtual unsigned int IMP::PairContainer::get_number_of_particle_pairs ( ) const [pure virtual]

return the number of Pairs in the container

Note:
this isn't always constant time

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

Generated on Thu Mar 24 2011 02:01:44 for IMP by doxygen 1.7.3