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>
78 m->get_sphere(std::get<0>(p)).get_center(),
79 internal::get_direction(m, std::get<0>(p)),
80 m->get_sphere(std::get<1>(p)).get_center(), &delta);
88 std::pair<double, double> sp = ds_.get_score_and_derivative(m, p, dist);
89 m->add_to_coordinate_derivatives(std::get<0>(p), -delta * sp.second, *da);
90 m->add_to_coordinate_derivatives(std::get<1>(p), delta * sp.second, *da);
93 return ds_.get_score(m, p, dist);
97 template <
class DistanceScore>
99 DistanceScore>::do_get_inputs(
100 Model *m,
const ParticleIndexes &pis)
const {
102 ret += ds_.get_inputs(m, pis);
120 #if defined(SWIG) || defined(IMP_DOXYGEN)
121 template <
class DistanceScoreT>
125 const DistanceScore &t0,
126 std::string name =
"FunctorSurfaceHeightPairScore %1%");
129 template <
class DistanceScore>
136 return internal::get_height_above_surface(center, normal, point, delta);
139 SurfaceHeightPairScore(
140 const DistanceScore &t0,
141 std::string name =
"FunctorSurfaceHeightPairScore %1%")
142 : SurfaceDistancePairScore<DistanceScore>(t0, name) {}
159 #if defined(SWIG) || defined(IMP_DOXYGEN)
160 template <
class DistanceScoreT>
164 const DistanceScore &t0,
165 std::string name =
"FunctorSurfaceDepthPairScore %1%");
168 template <
class DistanceScore>
175 return internal::get_depth_below_surface(center, normal, point, delta);
178 SurfaceDepthPairScore(
179 const DistanceScore &t0,
180 std::string name =
"FunctorSurfaceDepthPairScore %1%")
181 : SurfaceDistancePairScore<DistanceScore>(t0, name) {}
185 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.