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
96 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
102 "The unary function should return "
103 " 0 when passed a value of 0. Not "
113 bool outside =
false;
114 for (
unsigned int i = 0; i < 3; ++i) {
115 if (bb_.get_corner(0)[i] > d.get_coordinate(i)) {
116 cp[i] = bb_.get_corner(0)[i];
118 }
else if (bb_.get_corner(1)[i] < d.get_coordinate(i)) {
119 cp[i] = bb_.get_corner(1)[i];
122 cp[i] = d.get_coordinate(i);
126 IMP_LOG_VERBOSE(
"Particle " << Showable(pi) <<
" is outside box: " << d
127 <<
" of " << bb_ << std::endl);
129 double v = internal::compute_distance_pair_score(
130 d.get_coordinates() - cp, f_.get(), &deriv, boost::lambda::_1);
132 d.add_to_derivatives(deriv, *da);
150 (UnaryFunction *f,
const algebra::BoundingBoxD<3> &bb),
153 IMPCORE_END_NAMESPACE
virtual double evaluate_index(Model *m, ParticleIndex p, DerivativeAccumulator *da) const override
#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.
Single variable function.
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.
Abstract class for scoring object(s) of type ParticleIndex.
#define IMP_SINGLETON_SCORE_METHODS(Name)
A bounding box in D dimensions.
A decorator for a particle with x,y,z coordinates.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
GenericBoundingBox3DSingletonScore< UnaryFunction > BoundingBox3DSingletonScore
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Class for adding derivatives from restraints to the model.
Compile-time generic restraint and constraint support.