IMP  2.2.0
The Integrative Modeling Platform
kernel/PairScore.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kernel/PairScore.h
3  * \brief Define PairScore.
4  *
5  * WARNING This file was generated from PairScore.h
6  * in /tmp/nightly-build-28832/imp-2.2.0/tools/build/container_templates/kernel
7  * by tools/maintenance/setup_containers.py.
8  *
9  * Copyright 2007-2014 IMP Inventors. All rights reserved.
10  */
11 
12 #ifndef IMPKERNEL_PAIR_SCORE_H
13 #define IMPKERNEL_PAIR_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 "model_object_helpers.h"
22 
23 IMPKERNEL_BEGIN_NAMESPACE
24 
25 //! Abstract score function
26 /** PairScores will evaluate the score and derivatives
27  for the passed particles. Use in conjunction with various
28  restraints such as IMP::core::PairsRestraint or
29  IMP::core::PairRestraint.
30 
31  Implementers should check out IMP_PAIR_SCORE().
32 */
33 class IMPKERNELEXPORT PairScore : public ParticleInputs,
34  public base::Object {
35  public:
38  typedef const kernel::ParticlePair& PassArgument;
40  typedef PairModifier Modifier;
41  PairScore(std::string name = "PairScore %1%");
42  //! Compute the score and the derivative if needed.
43  /** \deprecated_at{2.1} Use the index-based evaluate instead. */
44  IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
45  virtual double evaluate(const kernel::ParticlePair& vt, DerivativeAccumulator *da) const;
46 
47  //! Compute the score and the derivative if needed.
48  virtual double evaluate_index(kernel::Model *m, const kernel::ParticleIndexPair& vt,
49  DerivativeAccumulator *da) const;
50 
51  /** Implementations
52  for these are provided by the IMP_PAIR_SCORE()
53  macro.
54  */
55  virtual double evaluate_indexes(kernel::Model *m, const kernel::ParticleIndexPairs &o,
57  unsigned int lower_bound,
58  unsigned int upper_bound) const;
59 
60  //! Compute the score and the derivative if needed.
61  virtual double evaluate_if_good_index(kernel::Model *m, const kernel::ParticleIndexPair& vt,
63  double max) const;
64 
65  /** Implementations
66  for these are provided by the IMP_PAIR_SCORE()
67  macro.
68  */
69  virtual double evaluate_if_good_indexes(kernel::Model *m,
71  DerivativeAccumulator *da, double max,
72  unsigned int lower_bound,
73  unsigned int upper_bound) const;
74  /** Decompose this pair score acting on the pair into a set of
75  restraints. The scoring function and derivatives should
76  be equal to the current score. The defualt implementation
77  just returns this object bound to the pair.*/
78  Restraints create_current_decomposition(kernel::Model *m,
79  const kernel::ParticleIndexPair& vt) const;
80 
81  protected:
82  /** Overide this to return your own decomposition.*/
83  virtual Restraints do_create_current_decomposition(kernel::Model *m,
84  const kernel::ParticleIndexPair& vt) const;
85 
87 };
88 
89 IMPKERNEL_END_NAMESPACE
90 
91 #endif /* IMPKERNEL_PAIR_SCORE_H */
Class for adding derivatives from restraints to the model.
Class for adding derivatives from restraints to the model.
IMP::kernel::PairScore PairScore
Basic types used by IMP.
#define IMP_REF_COUNTED_DESTRUCTOR(Name)
Ref counted objects should have private destructors.
Single variable function.
A class to store an fixed array of same-typed values.
Definition: base/Array.h:33
Abstract score function.
Various general useful macros for IMP.
Common base class for heavy weight IMP objects.
Definition: base/Object.h:106
Classes to handle individual model particles.
A base class for modifiers of kernel::ParticlePairsTemp.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72