Daniel Russel wrote: > Anyway, it seems like the DerivativeAccumulator is worth having. For now > we can punt on weights and say that the first person who wants them > writes a WeightedRestraintSet class which stores a weight and a set of > restraints and manipulates its restraints.
Ah, this is why it's better not to write emails and just wait to read yours. ;) I was just about to say something similar.
I was going to write the DerivativeAccumulator code today, since (as Daniel also points out) it's useful regardless of whether we want weights (e.g. if we want to sum derivatives as plnp rather than just p). But if somebody else wants to write it, let me know!
Once that is in place, it's easy to do weights using any of the methods we've discussed.
Ben