IMP logo
IMP Reference Guide  2.15.0
The Integrative Modeling Platform
QuadScore.h
Go to the documentation of this file.
1 // Autogenerated by ../../../../tmp/nightly-build-310/imp-2.15.0/tools/build/make_containers.py
2 // from ../../../../tmp/nightly-build-310/imp-2.15.0/tools/build/container_templates/kernel/ClassnameScore.h
3 // Do not edit - any changes will be lost!
4 
5 /**
6  * \file IMP/QuadScore.h
7  * \brief Define QuadScore.
8  *
9  * Copyright 2007-2021 IMP Inventors. All rights reserved.
10  */
11 
12 #ifndef IMPKERNEL_QUAD_SCORE_H
13 #define IMPKERNEL_QUAD_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 ParticleIndexQuad.
25 /** QuadScore will evaluate the score and derivatives
26  for passed object(s) of type ParticleIndexQuad.
27 
28  Use in conjunction with various
29  restraints such as IMP::container::QuadsRestraint or
30  IMP::core::QuadRestraint. The restraints couple the score
31  functions with appropriate lists of object(s) of type ParticleIndexQuad.
32 
33  Implementers should check out IMP_QUAD_SCORE().
34 
35  \see PredicateQuadRestraint
36 */
37 class IMPKERNELEXPORT QuadScore : public ParticleInputs,
38  public Object {
39  public:
40  typedef ParticleQuad Argument;
42  typedef const ParticleQuad& PassArgument;
43  typedef const ParticleIndexQuad& PassIndexArgument;
44  typedef QuadModifier Modifier;
45  QuadScore(std::string name = "QuadScore %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 ParticleQuad
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 ParticleIndexQuad& 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 ParticleQuad, 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_QUAD_SCORE() macro.
68  */
69  virtual double evaluate_indexes(Model *m, const ParticleIndexQuads &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 ParticleIndexQuad& 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_QUAD_SCORE()
91  macro.
92  */
93  virtual double evaluate_if_good_indexes(Model *m,
94  const ParticleIndexQuads &o,
95  DerivativeAccumulator *da, double max,
96  unsigned int lower_bound,
97  unsigned int upper_bound) const;
98 
99  //! Decompose this QuadScore 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 ParticleIndexQuad& vt) const;
108 
109  protected:
110  //! Override this to return your own decomposition.
111  virtual Restraints do_create_current_decomposition(Model *m,
112  const ParticleIndexQuad& vt) const;
113 
115 };
116 
117 IMPKERNEL_END_NAMESPACE
118 
119 #endif /* IMPKERNEL_QUAD_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
Abstract class for scoring object(s) of type ParticleIndexQuad.
Definition: QuadScore.h:37
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 ParticleQuadsTemp.
Definition: QuadModifier.h:32
Class for adding derivatives from restraints to the model.