/** * \file TripletScore.h \brief Define TripletScore. * * This file is generated by a script (core/tools/make-container). * Do not edit directly. * * Copyright 2007-2010 IMP Inventors. All rights reserved. */ #ifndef IMP_TRIPLET_SCORE_H #define IMP_TRIPLET_SCORE_H #include "kernel_config.h" #include "base_types.h" #include "ParticleTuple.h" #include "DerivativeAccumulator.h" #include "DecomposableRestraint.h" IMP_BEGIN_NAMESPACE //! Abstract score function /** TripletScores will evaluate the score and derivatives for the passed particles. Use in conjunction with various restraints such as IMP::core::TripletsRestraint or IMP::core::TripletRestraint. Implementers should check out IMP_TRIPLET_SCORE(). */ class IMPEXPORT TripletScore : public Object { public: typedef ParticleTriplet Argument; TripletScore(std::string name="TripletScore %1%"); //! Compute the score and the derivative if needed. virtual double evaluate(const ParticleTriplet& vt, DerivativeAccumulator *da) const = 0; /** Implementations for these are provided by the IMP_TRIPLET_SCORE() macro. */ virtual double evaluate(const ParticleTripletsTemp &o, DerivativeAccumulator *da) const = 0; /** \name Incremental evaluation Compute how much the score has changed since the last evaluate (and writing derivatives if they have changed). Implementations for these are provided by the IMP_TRIPLET_SCORE() macro. @{ */ virtual double evaluate_change(const ParticleTriplet& vt, DerivativeAccumulator *da) const = 0; virtual double evaluate_change(const ParticleTripletsTemp &o, DerivativeAccumulator *da) const = 0; virtual double evaluate_prechange(const ParticleTriplet& vt, DerivativeAccumulator *da) const = 0; virtual double evaluate_prechange(const ParticleTripletsTemp &o, DerivativeAccumulator *da) const = 0; //! Return true if the score for vt might have changed. virtual bool get_is_changed(const ParticleTriplet& vt) const =0; /** @} */ /** Get the set of particles read when applied to the arguments. */ virtual ParticlesTemp get_input_particles(Particle *p) const =0; /** Get the set of input containers when this modifier is applied to the arguments. */ virtual ContainersTemp get_input_containers(Particle *p) const =0; IMP_REF_COUNTED_DESTRUCTOR(TripletScore); }; IMP_OBJECTS(TripletScore,TripletScores); /** A TripletScoreRestraint is a restraint where the score (and derivative values) can be decomposed into an application of a TripletScore onto a ParticleTriplet. */ class IMPEXPORT TripletScoreRestraint: public Restraint { public: TripletScoreRestraint(std::string name); virtual TripletScore *get_score() const =0; virtual ParticleTriplet get_argument() const=0; }; IMP_OBJECTS(TripletScoreRestraint, TripletScoreRestraints); /** A TripletsScoreRestraint is a restraint where the score (and derivative values) can be decomposed into a series of applications of a TripletScore onto a ParticleTriplet. */ class IMPEXPORT TripletsScoreRestraint: public DecomposableRestraint { public: TripletsScoreRestraint(std::string name); virtual TripletScore *get_score() const =0; virtual ParticleTripletsTemp get_arguments() const=0; }; IMP_OBJECTS(TripletsScoreRestraint, TripletsScoreRestraints); IMP_END_NAMESPACE #endif /* IMP_TRIPLET_SCORE_H */