IMP logo
IMP Reference Guide  2.5.0
The Integrative Modeling Platform
PairScore.h
Go to the documentation of this file.
1 // Autogenerated by ../../../../tmp/nightly-build-6636/imp-2.5.0/tools/build/make_containers.py
2 // from ../../../../tmp/nightly-build-6636/imp-2.5.0/tools/build/container_templates/kernel/ClassnameScore.h
3 // Do not edit - any changes will be lost!
4 
5 /**
6  * \file IMP/PairScore.h
7  * \brief Define PairScore.
8  *
9  * Copyright 2007-2015 IMP Inventors. All rights reserved.
10  */
11 
12 #ifndef IMPKERNEL_PAIR_SCORE_H
13 #define IMPKERNEL_PAIR_SCORE_H
14 
15 #include <IMP/kernel_config.h>
16 #include "base_types.h"
17 #include "ParticleTuple.h"
18 #include "DerivativeAccumulator.h"
19 #include "internal/container_helpers.h"
20 #include <IMP/utility_macros.h>
21 #include "model_object_helpers.h"
22 
23 IMPKERNEL_BEGIN_NAMESPACE
24 
25 //! Abstract class for scoring object(s) of type ParticleIndexPair.
26 /** PairScore will evaluate the score and derivatives
27  for passed object(s) of type ParticleIndexPair.
28 
29  Use in conjunction with various
30  restraints such as IMP::container::PairsRestraint or
31  IMP::core::PairRestraint. The restraints couple the score
32  functions with appropriate lists of object(s) of type ParticleIndexPair.
33 
34  Implementers should check out IMP_PAIR_SCORE().
35 
36  \see PredicatePairRestraint
37 */
38 class IMPKERNELEXPORT PairScore : public ParticleInputs,
39  public Object {
40  public:
41  typedef ParticlePair Argument;
43  typedef const ParticlePair& PassArgument;
44  typedef const ParticleIndexPair& PassIndexArgument;
45  typedef PairModifier Modifier;
46  PairScore(std::string name = "PairScore %1%");
47 
48  //! Compute the score and the derivative if needed.
49  /** @param m the model of vt
50  @param vt the index in m of an object of type ParticlePair
51  @param da a DerivativeAccumulator that weights
52  computed derivatives. If nullptr, derivatives
53  will not be computed.
54  */
55  virtual double evaluate_index(Model *m, const ParticleIndexPair& vt,
56  DerivativeAccumulator *da) const = 0;
57 
58  //! Compute the score and the derivative if needed over a set.
59  /** @param m the model of o
60  @param o objects of type ParticlePair, specified by index
61  @param da a derivative accumulator that weights
62  computed derivatives. If nullptr, derivatives
63  will not be computed.
64  @param lower_bound index of first item in o to evaluate
65  @param upper_bound index of last item in o to evaluate
66 
67  @note Implementations for these are provided by
68  the IMP_PAIR_SCORE() macro.
69  */
70  virtual double evaluate_indexes(Model *m, const ParticleIndexPairs &o,
72  unsigned int lower_bound,
73  unsigned int upper_bound) const;
74 
75  //! Compute the score and the derivative if needed, only if "good".
76  /** This functions similarly to evaluate_index(),
77  but may terminate the computation early if the score is higher than max.
78 
79  @return the score if score<= max or some arbitrary value > max otherwise.
80  */
81  virtual double evaluate_if_good_index(Model *m, const ParticleIndexPair& vt,
83  double max) const;
84 
85  /** Compute the score and the derivative if needed over a set, only if "good".
86  This functions similarly to evaluate_indexes(), but may terminate
87  the computation early if the total score is higher than max.
88 
89  @return the score if score<= max or some arbitrary value > max otherwise.
90 
91  @note Implementations for these are provided by the IMP_PAIR_SCORE()
92  macro.
93  */
94  virtual double evaluate_if_good_indexes(Model *m,
95  const ParticleIndexPairs &o,
96  DerivativeAccumulator *da, double max,
97  unsigned int lower_bound,
98  unsigned int upper_bound) const;
99 
100  //! Decompose this pair score acting on the pair into a set of restraints.
101  /** The scoring function and derivatives should
102  be equal to the current score. The default implementation
103  just returns this object bound to the pair. */
104  Restraints create_current_decomposition(Model *m,
105  const ParticleIndexPair& vt) const;
106 
107  protected:
108  //! Overide this to return your own decomposition.
109  virtual Restraints do_create_current_decomposition(Model *m,
110  const ParticleIndexPair& vt) const;
111 
113 };
114 
115 IMPKERNEL_END_NAMESPACE
116 
117 #endif /* IMPKERNEL_PAIR_SCORE_H */
Abstract class for scoring object(s) of type ParticleIndexPair.
Definition: PairScore.h:38
A class to store an fixed array of same-typed values.
Definition: Array.h:33
#define IMP_REF_COUNTED_DESTRUCTOR(Name)
Ref counted objects should have private destructors.
Classes to handle individual model particles.
A base class for modifiers of ParticlePairsTemp.
Definition: PairModifier.h:33
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Common base class for heavy weight IMP objects.
Definition: Object.h:106
Single variable function.
Various general useful macros for IMP.
Class for adding derivatives from restraints to the model.