IMP logo
Public Member Functions
IMP::container::ClosePairContainer Class Reference

Detailed Description

Return all close unordered pairs of particles taken from the SingletonContainer.

This maintains a list of particles whose inter-sphere distance is smaller than the distance parameter.

In order to do this efficiently the class actually computes all pairs within distance+slack of one another. As long as the particles don't move more than the slack amount, the list is still valid and doesn't need to be recomputed. The container keeps track internally of how far the particles have moved using a score state, and is also updated via a score state.

Note:
The maintenance of the invariant is done by an associated IMP::Constraint. As a result, the state is only guaranteed to be correct either during model evaluation, or immediately following model evaluation before any particles have been changed.

Here is a simple example of using this for a nonbonded list

import IMP
import IMP.core
import IMP.atom
import IMP.container

# This example addes a restraint on nonbonded interactions
# after excluding a set of bonded interactions.

m= IMP.Model()
# The set of particles
ps = IMP.container.ListSingletonContainer(IMP.core.create_xyzr_particles(m, 20, 1.0))

# create a bond between two particles
bd0= IMP.atom.Bonded.setup_particle(ps.get_particle(0))
bd1= IMP.atom.Bonded.setup_particle(ps.get_particle(1))
IMP.atom.create_custom_bond(bd0, bd1, 2.0)

# Set up the nonbonded list for all pairs at are touching
# and let things move 3 before updating the list
nbl= IMP.container.ClosePairContainer(ps, 0.0, 3.0)
nbl.add_pair_filter(IMP.atom.BondedPairFilter())

# Set up excluded volume
sdps= IMP.core.SoftSpherePairScore(1)
evr= IMP.container.PairsRestraint(sdps, nbl)
m.add_restraint(evr)

# Set up optimizer
o= IMP.core.ConjugateGradients()
o.set_model(m)

o.optimize(1000)
Note:
This class uses the IMP::core::BoxSweepClosePairsFinder by default if CGAL is available.
See also:
CloseBipartitePairContainer
ClosePairsFinder

Examples: chain, filter close pairs, nonbonded interactions, charmm forcefield verbose, initialize chains, basic optimization, rigid collisions, charmm forcefield, assess dope, excluded volume

+ Inheritance diagram for IMP::container::ClosePairContainer:

List of all members.

Public Member Functions

 ClosePairContainer (SingletonContainer *c, double distance, double slack=1)
 Get the individual particles from the passed SingletonContainer.
 ClosePairContainer (SingletonContainer *c, double distance, core::ClosePairsFinder *cpf, double slack=1)
 Get the individual particles from the passed SingletonContainer.
bool get_is_up_to_date () const
double get_slack () const
 IMP_IMPLEMENT_PAIR_CONTAINER (ClosePairContainer)
void set_slack (double s)

Methods to control the set of filters

PairContainer objects can be used as filters to prevent the addition of pairs to the containeroutput list. Pairs which are contained in any container added to this list will be excluded from the close pairs list.

void remove_pair_filter (PairFilter *d)
template<class F >
void remove_pair_filters_if (const F &f)
template<class List >
void remove_pair_filters (List d)
template<class List >
void set_pair_filters (List ps)
template<class List >
void set_pair_filters_order (List ps)
unsigned int add_pair_filter (PairFilter *obj)
template<class List >
void add_pair_filters (List objs)
void clear_pair_filters ()
unsigned int get_number_of_pair_filters () const
bool get_has_pair_filters () const
PairFilterget_pair_filter (unsigned int i) const
PairFilters get_pair_filters () const
void reserve_pair_filters (unsigned int sz)
PairFilterIterator pair_filters_begin ()
PairFilterIterator pair_filters_end ()
PairFilterConstIterator pair_filters_begin () const
PairFilterConstIterator pair_filters_end () const

Constructor & Destructor Documentation

IMP::container::ClosePairContainer::ClosePairContainer ( SingletonContainer c,
double  distance,
double  slack = 1 
)

Get the individual particles from the passed SingletonContainer.

IMP::container::ClosePairContainer::ClosePairContainer ( SingletonContainer c,
double  distance,
core::ClosePairsFinder cpf,
double  slack = 1 
)

Get the individual particles from the passed SingletonContainer.


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

Generated on Fri Feb 10 2012 23:36:24 for IMP by doxygen 1.7.5.1