IMP logo
IMP Reference Guide  develop.d97d4ead1f,2024/11/21
The Integrative Modeling Platform
MinimumSphereDistancePairScore.h
Go to the documentation of this file.
1 /**
2  * \file IMP/npc/MinimumSphereDistancePairScore.h
3  * \brief Apply a UnaryFunction to the minimum transformed distance
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPNPC_MINIMUM_SPHERE_DISTANCE_PAIR_SCORE_H
9 #define IMPNPC_MINIMUM_SPHERE_DISTANCE_PAIR_SCORE_H
10 
11 #include <IMP/npc/npc_config.h>
12 #include <IMP/PairScore.h>
13 #include <IMP/UnaryFunction.h>
14 #include <IMP/pair_macros.h>
16 #include <cereal/access.hpp>
17 #include <cereal/types/base_class.hpp>
18 
19 IMPNPC_BEGIN_NAMESPACE
20 
21 //! Apply a UnaryFunction to the minimum transformed sphere-sphere distance
22 /** This is like a SphereDistancePairScore in that it calculates the
23  inter-surface distance between two XYZR Particles (spheres) and then
24  scores it with a provided UnaryFunction. However, it also considers
25  the distance between the two particles with the second particle
26  transformed by each of the provided transformations. The transformation
27  which results in the minimum interparticle distance (not necessarily the
28  minimum score) is then used for scoring. This can be used for periodic
29  boundaries or other symmetric systems.
30  */
31 class IMPNPCEXPORT MinimumSphereDistancePairScore : public PairScore {
33  algebra::Transformation3Ds transforms_;
34 
35  friend class cereal::access;
36  template<class Archive> void serialize(Archive &ar) {
37  ar(cereal::base_class<PairScore>(this), f_, transforms_);
38  }
40 
41  public:
43  algebra::Transformation3Ds transforms)
44  : f_(f), transforms_(transforms) {}
45 
47 
48  virtual double evaluate_index(Model *m, const ParticleIndexPair &pi,
49  DerivativeAccumulator *da) const override;
51  Model *m, const ParticleIndexes &pis) const override {
52  return IMP::get_particles(m, pis);
53  }
56 };
57 
58 IMPNPC_END_NAMESPACE
59 
60 #endif /* IMPNPC_MINIMUM_SPHERE_DISTANCE_PAIR_SCORE_H */
Abstract class for scoring object(s) of type ParticleIndexPair.
Definition: PairScore.h:44
Apply a UnaryFunction to the minimum transformed sphere-sphere distance.
Macros for various classes.
#define IMP_PAIR_SCORE_METHODS(Name)
Definition: pair_macros.h:25
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Single variable function.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
Get the particles from a list of indexes.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
Define PairScore.
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition: object_macros.h:95
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:143
Simple 3D transformation class.
Abstract single variable functor class for score functions.
Definition: UnaryFunction.h:27
virtual double evaluate_index(Model *m, const ParticleIndexPair &vt, DerivativeAccumulator *da) const =0
Compute the score and the derivative if needed.
Class for adding derivatives from restraints to the model.