8 #ifndef IMPCORE_BOUNDING_BOX_3DSINGLETON_SCORE_H
9 #define IMPCORE_BOUNDING_BOX_3DSINGLETON_SCORE_H
11 #include <IMP/core/core_config.h>
18 #include "internal/evaluate_distance_pair_score.h"
19 #include <boost/lambda/lambda.hpp>
21 IMPCORE_BEGIN_NAMESPACE
48 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
54 "The unary function should return "
55 " 0 when passed a value of 0. Not "
66 for (
unsigned int i = 0; i < 3; ++i) {
67 if (bb_.get_corner(0)[i] > d.get_coordinate(i)) {
68 cp[i] = bb_.get_corner(0)[i];
70 }
else if (bb_.get_corner(1)[i] < d.get_coordinate(i)) {
71 cp[i] = bb_.get_corner(1)[i];
74 cp[i] = d.get_coordinate(i);
79 <<
" of " << bb_ << std::endl);
81 double v = internal::compute_distance_pair_score(
82 d.get_coordinates() - cp, f_.get(), &deriv, boost::lambda::_1);
84 d.add_to_derivatives(deriv, *da);
94 IMP_GENERIC_OBJECT(BoundingBox3DSingletonScore, bounding_box_3d_singleton_score,
Class for adding derivatives from restraints to the model.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
#define IMP_OBJECT_LOG
Set the log level to the object's log level.
Import IMP/kernel/UnaryFunction.h in the namespace.
IMP::kernel::UnaryFunction UnaryFunction
ParticlesTemp get_particles(kernel::Model *m, const ParticleIndexes &ps)
Import IMP/kernel/singleton_macros.h in the namespace.
#define IMP_LOG_VERBOSE(expr)
Score particles based on how far outside a box they are.
virtual kernel::ModelObjectsTemp do_get_inputs(kernel::Model *m, const kernel::ParticleIndexes &pis) const
A bounding box in D dimensions.
A decorator for a particle with x,y,z coordinates.
Import IMP/kernel/SingletonScore.h in the namespace.
Abstract class for scoring object(s) of type Particle.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
virtual double evaluate_index(kernel::Model *m, kernel::ParticleIndex p, DerivativeAccumulator *da) const
Compute the score and the derivative if needed.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
#define IMP_SINGLETON_SCORE_METHODS(Name)
Class for storing model, its restraints, constraints, and particles.
Import IMP/kernel/generic.h in the namespace.