Daniel Russel wrote: > I think we may want to think about removing the list of particles from > the Restraint base class and providing several restraint subclasses > which use different containers to store the particles (this would be a > fairly minor change given the IMP_RESTRAINT macro and the current > interface). Then, we could have restraints which require a dynamic set > use a std::set, and ones which just have a static list or (like distance > restraint) a fixed number, use a vector or just member variables.
Agreed - although I suggest there's little point in doing that unless we have specific restraints in mind which need such functionality.
> I have ended up rolling my own version of ExclusionVolume. I have a > version which either enforces excluded volume, or, if the particles are > bonded, enforces the bond (it uses the BondDecorator def of bond). I > suspect something on those lines will be more useful in the long run as > we rarely have a set of particles where nothing is interacting tightly.
As you mention elsewhere, this is probably pretty slow. The usual way of doing such a thing efficiently (at least in molecular mechanics packages) is to have two restraints - one is the stereochemical restraint, a simple loop over all bonds (in the Modeller case, this is done just once and restraints are set up for each bond) while the second is the excluded volume restraint, a loop over all nonbonded pairs. Part of the nonbonded pair generation mechanism excludes bonded particles.
Ben