8 #ifndef IMPCORE_DISTANCE_TO_SINGLETON_SCORE_H
9 #define IMPCORE_DISTANCE_TO_SINGLETON_SCORE_H
11 #include <IMP/core/core_config.h>
13 #include "internal/evaluate_distance_pair_score.h"
20 #include <boost/lambda/lambda.hpp>
21 #include <cereal/access.hpp>
22 #include <cereal/types/base_class.hpp>
24 IMPCORE_BEGIN_NAMESPACE
42 Float get_coordinate(
unsigned int i) {
return v_[i]; }
49 friend class cereal::access;
51 template<
class Archive>
void serialize(Archive &ar) {
52 ar(cereal::base_class<SingletonScore>(
this), f_, pt_);
70 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
80 double v = internal::evaluate_distance_pair_score(
81 XYZ(m, pi), StaticD(pt_), da, f_.get(), boost::lambda::_1);
83 <<
" scored " << v << std::endl);
109 Float get_coordinate(
unsigned int i) {
return v_[i]; }
129 IMPCORE_END_NAMESPACE
GenericDistanceToSingletonScore< UnaryFunction > DistanceToSingletonScore
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Single variable function.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
Macros for various classes.
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
Get the particles from a list of indexes.
#define IMP_LOG_VERBOSE(expr)
A more IMP-like version of the std::vector.
#define IMP_GENERIC_OBJECT(Name, lcname, targument, carguments, cparguments)
Typedefs a default instantiation for a generic (templated) object.
Class for storing model, its restraints, constraints, and particles.
#define IMP_UNUSED(variable)
Abstract class for scoring object(s) of type ParticleIndex.
#define IMP_SINGLETON_SCORE_METHODS(Name)
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
virtual double evaluate_index(Model *m, ParticleIndex p, DerivativeAccumulator *da) const override
Compute the score and the derivative if needed.
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Apply a function to the distance to a fixed point.
A nullptr-initialized pointer to an IMP Object.
double Float
Basic floating-point value (could be float, double...)
Apply a function to the distance to a fixed point.
Abstract single variable functor class for score functions.
Class for adding derivatives from restraints to the model.
Compile-time generic restraint and constraint support.