I think it would be good to have an AnglesRestraint which stores a list of chains and applies an AngleRestraint-like restraint to each triple in each chain. It is easier to set up and maintain than a whole mess of AngleRestraints and more efficient too.
Comments?
//! Restraint the angles between particles /** Currently the particles can be added as chains and the angle of each three successive particles in the chain is restrained. \ingroup restraint */ class IMPDLLEXPORT AnglesRestraint : public Restraint { public: //! Create the angle restraint. /** \param[in] score_func Scoring function for the restraint. */ AnglesRestraint(UnaryFunction* score_func); virtual ~AnglesRestraint(){}
IMP_RESTRAINT("0.5", "Daniel Russel");
//! Add a chain of particles /** Each three successive particles are restrained*/ void add_chain(const Particles &ps);
//! Clear all the store chains void clear_chains(); protected: std::auto_ptr<UnaryFunction> score_func_; std::vector<int> chain_splits_; };
Daniel Russel wrote: > I think it would be good to have an AnglesRestraint which stores a list > of chains and applies an AngleRestraint-like restraint to each triple in > each chain. It is easier to set up and maintain than a whole mess of > AngleRestraints and more efficient too. > > Comments?
Why do it this way? It's hardly in line with the way distance restraints are now handled. I instead suggest a TripletScore class which works like the existing SingletonScore and PairScore classes. You get a bit more flexibility that way, surely.
Ben
On Feb 13, 2008, at 12:15 AM, Ben Webb wrote:
> Daniel Russel wrote: >> I think it would be good to have an AnglesRestraint which stores a >> list >> of chains and applies an AngleRestraint-like restraint to each >> triple in >> each chain. It is easier to set up and maintain than a whole mess of >> AngleRestraints and more efficient too. >> >> Comments? > > Why do it this way? It's hardly in line with the way distance > restraints > are now handled. I instead suggest a TripletScore class which works > like > the existing SingletonScore and PairScore classes. You get a bit more > flexibility that way, surely. True. I guess I did it for the same reason you did the AngleRestraint :-)
Anyway, here is the more flexible patch, hopefully not missing too many pieces
%pythonprepend ChainTripletRestraint::ChainTripletRestraint %{ args[0].thisown=0 %} %pythonprepend AngleTripletScore::AngleTripletScore %{ args[0].thisown=0 %}
participants (2)
-
Ben Webb
-
Daniel Russel