IMP  2.0.1
The Integrative Modeling Platform
kernel/QuadScore.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kernel/QuadScore.h
3  * \brief Define QuadScore.
4  *
5  * WARNING This file was generated from QuadScore.h
6  * in /tmp/nightly-build-36540/imp-2.0.1/tools/build/container_templates/kernel
7  * by tools/maintenance/setup_containers.py.
8  *
9  * Copyright 2007-2013 IMP Inventors. All rights reserved.
10  */
11 
12 #ifndef IMPKERNEL_QUAD_SCORE_H
13 #define IMPKERNEL_QUAD_SCORE_H
14 
15 #include <IMP/kernel/kernel_config.h>
16 #include "base_types.h"
17 #include "ParticleTuple.h"
18 #include "DerivativeAccumulator.h"
19 #include "internal/container_helpers.h"
21 #include "input_output_macros.h"
22 
23 IMPKERNEL_BEGIN_NAMESPACE
24 
25 //! Abstract score function
26 /** QuadScores will evaluate the score and derivatives
27  for the passed particles. Use in conjunction with various
28  restraints such as IMP::core::QuadsRestraint or
29  IMP::core::QuadRestraint.
30 
31  Implementers should check out IMP_QUAD_SCORE().
32 */
33 class IMPKERNELEXPORT QuadScore : public base::Object
34 {
35  public:
36  typedef ParticleQuad Argument;
38  typedef const ParticleQuad& PassArgument;
39  typedef const ParticleIndexQuad& PassIndexArgument;
40  typedef QuadModifier Modifier;
41  QuadScore(std::string name="QuadScore %1%");
42  //! Compute the score and the derivative if needed.
44  virtual double evaluate(const ParticleQuad& vt,
45  DerivativeAccumulator *da) const;
46 
47  //! Compute the score and the derivative if needed.
48  virtual double evaluate_index(Model *m, const ParticleIndexQuad& vt,
49  DerivativeAccumulator *da) const;
50 
51  /** Implementations
52  for these are provided by the IMP_QUAD_SCORE()
53  macro.
54  */
55  virtual double evaluate_indexes(Model *m,
56  const ParticleIndexQuads &o,
58  unsigned int lower_bound,
59  unsigned int upper_bound) const ;
60 
61  //! Compute the score and the derivative if needed.
62  virtual double evaluate_if_good_index(Model *m,
63  const ParticleIndexQuad& vt,
65  double max) const;
66 
67  /** Implementations
68  for these are provided by the IMP_QUAD_SCORE()
69  macro.
70  */
71  virtual double evaluate_if_good_indexes(Model *m,
72  const ParticleIndexQuads &o,
74  double max,
75  unsigned int lower_bound,
76  unsigned int upper_bound)
77  const;
78  /** Decompose this pair score acting on the pair into a set of
79  restraints. The scoring function and derivatives should
80  be equal to the current score. The defualt implementation
81  just returns this object bound to the pair.*/
82  Restraints create_current_decomposition(Model *m,
83  const ParticleIndexQuad& vt) const;
84 
86 
87 protected:
88  /** Overide this to return your own decomposition.*/
89  virtual Restraints do_create_current_decomposition
90  (Model *m, const ParticleIndexQuad& vt)const;
91 
93 };
94 
95 IMPKERNEL_END_NAMESPACE
96 
97 #endif /* IMPKERNEL_QUAD_SCORE_H */