8 #ifndef IMPCORE_ATTRIBUTE_SINGLETON_SCORE_H
9 #define IMPCORE_ATTRIBUTE_SINGLETON_SCORE_H
11 #include <IMP/core/core_config.h>
18 IMPCORE_BEGIN_NAMESPACE
26 IMP::OwnerPointer<UF> f_;
33 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
40 inline Float GenericAttributeSingletonScore<UF>::evaluate(
Particle *b,
45 boost::tie(v,d) = f_->UF::evaluate_with_derivative(b->get_value(k_));
46 b->add_to_derivative(k_, d, *da);
49 return f_->UF::evaluate(b->get_value(k_));
53 inline void GenericAttributeSingletonScore<UF>::do_show(std::ostream &out)
const
55 out <<
"function is " << *f_ <<
" on " << k_;