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