IMP logo

IMP::container::PairsConstraint Class Reference


Detailed Description

Apply a PairFunction to a PairContainer to maintain an invariant.

The score state is passed up to two PairModifiers, one to apply before evaluation and the other after. The one after should take a DerivativeAccumulator as its last argument for PairModifier::apply() and will only be called if the score was computed with derivatives.

An example showing a how to use such a score state to maintain a cover of the atoms of a protein by a sphere per residue.

import IMP
import IMP.core
import IMP.atom
import IMP.atom
import IMP.helper

m= IMP.Model()
prot= IMP.atom.read_pdb(IMP.core.get_example_path('example_protein.pdb'), m)
res= IMP.atom.get_by_type(prot, IMP.atom.RESIDUE_TYPE)
for p in res:
    IMP.core.XYZR.setup_particle(p.get_particle())
mtr=IMP.atom.Hierarchy.get_traits()
pr= IMP.core.ChildrenRefiner(mtr)
for r in res:
    IMP.core.Cover.setup_particle(r.get_particle(), pr)
m.evaluate(False)

See also:
PairConstraint
Inheritance diagram for IMP::container::PairsConstraint:

Inheritance graph
[legend]

Public Member Functions

virtual std::string get_type_name () const
virtual ::IMP::VersionInfo get_version_info () const
 PairsConstraint (PairContainer *c, PairModifier *before, PairModifier *after, std::string name="PairConstraint %1%")
void set_after_evaluate_modifier (PairModifier *f)
 Apply this modifier to all the elements after an evaluate.
void set_before_evaluate_modifier (PairModifier *f)
 Apply this modifier to all the elements before an evaluate.

Protected Member Functions

void do_update_attributes ()
void do_update_derivatives (DerivativeAccumulator *da)
virtual ContainersTemp get_input_containers () const
virtual ParticlesTemp get_input_particles () const
virtual ParticlesList get_interacting_particles () const
virtual ContainersTemp get_output_containers () const
virtual ParticlesTemp get_output_particles () const

Friends

template<class T >
void IMP::internal::unref (T *)

Constructor & Destructor Documentation

IMP::container::PairsConstraint::PairsConstraint ( PairContainer c,
PairModifier before,
PairModifier after,
std::string  name = "PairConstraint %1%" 
)

Parameters:
[in] c The Container to hold the elements to process
[in] before The PairModifier to apply to all elements before evaluate.
[in] after The PairModifier to apply to all elements after evaluate.
[in] name The object name


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

Generated on Mon Mar 8 23:08:53 2010 for IMP by doxygen 1.5.8