8#ifndef IMPCORE_GENERIC_ATTRIBUTE_SINGLETON_SCORE_H
9#define IMPCORE_GENERIC_ATTRIBUTE_SINGLETON_SCORE_H
11#include <IMP/core/core_config.h>
18IMPCORE_BEGIN_NAMESPACE
45#if !defined(SWIG) && !defined(IMP_DOXYGEN)
57 f_->UF::evaluate_with_derivative(m->get_attribute(k_, pi));
58 m->add_to_derivative(k_, pi, d, *da);
61 return f_->UF::evaluate(m->get_attribute(k_, pi));
A nullptr-initialized pointer to an IMP Object.
Single variable function.
Class for adding derivatives from restraints to the model.
Class for storing model, its restraints, constraints, and particles.
Abstract class for scoring object(s) of type ParticleIndex.
Apply a function to an attribute.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
UF * get_unary_function()
get access to the unary function object used for scoring the attribute
virtual double evaluate_index(Model *m, ParticleIndex p, DerivativeAccumulator *da) const override
Compute the score and the derivative if needed.
GenericAttributeSingletonScore(UF *f, FloatKey k)
Apply function f to attribute k.
FloatKey get_key() const
Get the attribute key used.
Compile-time generic restraint and constraint support.
GenericAttributeSingletonScore< UF > * create_generic_attribute_singleton_score(UF *uf, FloatKey k)
GenericAttributeSingletonScore< UnaryFunction > AttributeSingletonScore
Index< ParticleIndexTag > ParticleIndex
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
Get the particles from a list of indexes.
double Float
Basic floating-point value (could be float, double...).
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Key< 0 > FloatKey
The type used to identify float attributes in the Particles.
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Macros for various classes.
#define IMP_SINGLETON_SCORE_METHODS(Name)
A smart pointer to a ref-counted Object that is a class member.