8 #ifndef IMPSCORE_FUNCTOR_SURFACE_DISTANCE_PAIR_SCORE_H
9 #define IMPSCORE_FUNCTOR_SURFACE_DISTANCE_PAIR_SCORE_H
11 #include <IMP/score_functor/score_functor_config.h>
12 #include <IMP/score_functor/internal/surface_helpers.h>
16 IMPSCOREFUNCTOR_BEGIN_NAMESPACE
30 template <
class DistanceScoreT>
40 return internal::get_distance_from_surface(center, normal, point, delta);
44 typedef DistanceScoreT DistanceScore;
47 const DistanceScore &t0,
48 std::string name =
"FunctorSurfaceDistancePairScore %1%")
55 virtual double evaluate_index(
Model *m,
62 DistanceScoreT& get_score_functor()
70 template <
class DistanceScore>
76 double dist =
get_distance(m->get_sphere(p[0]).get_center(),
77 internal::get_surface_normal(m, p[0]),
78 m->get_sphere(p[1]).get_center(), &delta);
86 std::pair<double, double> sp = ds_.get_score_and_derivative(m, p, dist);
87 m->add_to_coordinate_derivatives(p[0], -delta * sp.second, *da);
88 m->add_to_coordinate_derivatives(p[1], delta * sp.second, *da);
91 return ds_.get_score(m, p, dist);
95 template <
class DistanceScore>
97 DistanceScore>::do_get_inputs(
98 Model *m,
const ParticleIndexes &pis)
const {
100 ret += ds_.get_inputs(m, pis);
118 #if defined(SWIG) || defined(IMP_DOXYGEN)
119 template <
class DistanceScoreT>
123 const DistanceScore &t0,
124 std::string name =
"FunctorSurfaceHeightPairScore %1%");
127 template <
class DistanceScore>
134 return internal::get_height_above_surface(center, normal, point, delta);
137 SurfaceHeightPairScore(
138 const DistanceScore &t0,
139 std::string name =
"FunctorSurfaceHeightPairScore %1%")
140 : SurfaceDistancePairScore<DistanceScore>(t0, name) {}
157 #if defined(SWIG) || defined(IMP_DOXYGEN)
158 template <
class DistanceScoreT>
162 const DistanceScore &t0,
163 std::string name =
"FunctorSurfaceDepthPairScore %1%");
166 template <
class DistanceScore>
173 return internal::get_depth_below_surface(center, normal, point, delta);
176 SurfaceDepthPairScore(
177 const DistanceScore &t0,
178 std::string name =
"FunctorSurfaceDepthPairScore %1%")
179 : SurfaceDistancePairScore<DistanceScore>(t0, name) {}
183 IMPSCOREFUNCTOR_END_NAMESPACE
Abstract class for scoring object(s) of type ParticleIndexPair.
Macros for various classes.
Create efficient surface distance-based pair scores.
#define IMP_PAIR_SCORE_METHODS(Name)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Create efficient surface depth-based pair scores.
Create efficient surface height-based pair scores.
A more IMP-like version of the std::vector.
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Class for storing model, its restraints, constraints, and particles.
double get_distance(const Line3D &s, const Vector3D &p)
Get closest distance between a line and a point.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.