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>
13 #include <IMP/score_functor/internal/direction_helpers.h>
17 IMPSCOREFUNCTOR_BEGIN_NAMESPACE
31 template <
class DistanceScoreT>
41 return internal::get_distance_from_surface(center, normal, point, delta);
45 typedef DistanceScoreT DistanceScore;
48 const DistanceScore &t0,
49 std::string name =
"FunctorSurfaceDistancePairScore %1%")
56 virtual double evaluate_index(
Model *m,
63 DistanceScoreT& get_score_functor()
71 template <
class DistanceScore>
77 double dist =
get_distance(m->get_sphere(p[0]).get_center(),
78 internal::get_direction(m, p[0]),
79 m->get_sphere(p[1]).get_center(), &delta);
87 std::pair<double, double> sp = ds_.get_score_and_derivative(m, p, dist);
88 m->add_to_coordinate_derivatives(p[0], -delta * sp.second, *da);
89 m->add_to_coordinate_derivatives(p[1], delta * sp.second, *da);
92 return ds_.get_score(m, p, dist);
96 template <
class DistanceScore>
98 DistanceScore>::do_get_inputs(
99 Model *m,
const ParticleIndexes &pis)
const {
101 ret += ds_.get_inputs(m, pis);
119 #if defined(SWIG) || defined(IMP_DOXYGEN)
120 template <
class DistanceScoreT>
124 const DistanceScore &t0,
125 std::string name =
"FunctorSurfaceHeightPairScore %1%");
128 template <
class DistanceScore>
135 return internal::get_height_above_surface(center, normal, point, delta);
138 SurfaceHeightPairScore(
139 const DistanceScore &t0,
140 std::string name =
"FunctorSurfaceHeightPairScore %1%")
141 : SurfaceDistancePairScore<DistanceScore>(t0, name) {}
158 #if defined(SWIG) || defined(IMP_DOXYGEN)
159 template <
class DistanceScoreT>
163 const DistanceScore &t0,
164 std::string name =
"FunctorSurfaceDepthPairScore %1%");
167 template <
class DistanceScore>
174 return internal::get_depth_below_surface(center, normal, point, delta);
177 SurfaceDepthPairScore(
178 const DistanceScore &t0,
179 std::string name =
"FunctorSurfaceDepthPairScore %1%")
180 : SurfaceDistancePairScore<DistanceScore>(t0, name) {}
184 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.
Class for adding derivatives from restraints to the model.