00001 /** 00002 * \file SingletonScore.h \brief Define SingletonScore. 00003 * 00004 * This file is generated by a script (core/tools/make-container). 00005 * Do not edit directly. 00006 * 00007 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00008 */ 00009 00010 #ifndef IMP_SINGLETON_SCORE_H 00011 #define IMP_SINGLETON_SCORE_H 00012 00013 #include "kernel_config.h" 00014 #include "base_types.h" 00015 #include "Particle.h" 00016 #include "DerivativeAccumulator.h" 00017 #include "internal/container_helpers.h" 00018 00019 IMP_BEGIN_NAMESPACE 00020 00021 //! Abstract score function 00022 /** SingletonScores will evaluate the score and derivatives 00023 for the passed particles. Use in conjunction with various 00024 restraints such as IMP::core::SingletonsRestraint or 00025 IMP::core::SingletonRestraint. 00026 00027 Implementers should check out IMP_SINGLETON_SCORE(). 00028 */ 00029 class IMPEXPORT SingletonScore : public Object 00030 { 00031 public: 00032 SingletonScore(std::string name="SingletonScore %1%"); 00033 //! Compute the score and the derivative if needed. 00034 virtual double evaluate(Particle* vt, 00035 DerivativeAccumulator *da) const = 0; 00036 00037 #if !defined(IMP_DOXYGEN) && 1 != 1 00038 // backwards compatibility 00039 virtual double evaluate(Particle *a, 00040 DerivativeAccumulator *da) const { 00041 return evaluate(Particle(a), da); 00042 } 00043 #endif 00044 00045 /** Implementations 00046 for these are provided by the IMP_SINGLETON_SCORE() 00047 macro. 00048 */ 00049 virtual double evaluate(const ParticlesTemp &o, 00050 DerivativeAccumulator *da) const = 0; 00051 00052 /** \name Incremental evaluation 00053 Compute how much the score has changed since the last evaluate 00054 (and writing derivatives if they have changed). Implementations 00055 for these are provided by the IMP_SINGLETON_SCORE() macro. 00056 @{ 00057 */ 00058 virtual double evaluate_change(Particle* vt, 00059 DerivativeAccumulator *da) const = 0; 00060 00061 virtual double evaluate_change(const ParticlesTemp &o, 00062 DerivativeAccumulator *da) const = 0; 00063 virtual double evaluate_prechange(Particle* vt, 00064 DerivativeAccumulator *da) const = 0; 00065 virtual double evaluate_prechange(const ParticlesTemp &o, 00066 DerivativeAccumulator *da) const = 0; 00067 //! Return true if the score for vt might have changed. 00068 virtual bool get_is_changed(Particle* vt) const =0; 00069 /** @} */ 00070 00071 /** Get the set of interaction induced by applying to the 00072 argument. */ 00073 virtual ParticlesList 00074 get_interacting_particles(Particle* vt) const =0; 00075 00076 /** Get the set of particles read when applied to the arguments. */ 00077 virtual ParticlesTemp 00078 get_input_particles(Particle* vt) const =0; 00079 00080 /** Get the set of input containers when this modifier is applied to 00081 the arguments. */ 00082 virtual ContainersTemp 00083 get_input_containers(Particle* vt) const =0; 00084 00085 IMP_REF_COUNTED_DESTRUCTOR(SingletonScore); 00086 }; 00087 00088 IMP_OBJECTS(SingletonScore); 00089 /** \objects{SingletonScore} 00090 */ 00091 /** \objectstemp{SingletonScore} 00092 */ 00093 IMP_END_NAMESPACE 00094 00095 #endif /* IMP_SINGLETON_SCORE_H */