IMP  2.0.1
The Integrative Modeling Platform
SingletonConstraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/SingletonConstraint.h
3  * \brief Use a SingletonModifier applied to a ParticlesTemp to
4  * maintain an invariant
5  *
6  * This file is generated by a script (core/tools/make-container).
7  * Do not edit directly.
8  *
9  * Copyright 2007-2013 IMP Inventors. All rights reserved.
10  */
11 
12 #ifndef IMPCORE_SINGLETON_CONSTRAINT_H
13 #define IMPCORE_SINGLETON_CONSTRAINT_H
14 
15 #include <IMP/core/core_config.h>
16 #include <IMP/internal/TupleConstraint.h>
17 #include <IMP/SingletonModifier.h>
19 #include <IMP/score_state_macros.h>
20 
21 IMPCORE_BEGIN_NAMESPACE
22 //! Apply a SingletonFunction to a Singleton
23 /** The score state is passed up to two SingletonModifiers, one to
24  apply before evaluation and the other after. The one after
25  should take a DerivativeAccumulator as its last argument for
26  SingletonModifier::apply() and will only be called if
27  the score was computed with derivatives.
28 
29  \see container::SingletonsConstraint
30  */
32 #if defined(IMP_DOXYGEN) || defined(SWIG)
33 public Constraint
34 #else
35 public IMP::kernel::internal::TupleConstraint<SingletonModifier,
36  SingletonDerivativeModifier>
37 #endif
38 {
39 public:
40  /** before and after are the modifiers to apply before and after
41  evaluate.
42  */
44  SingletonDerivativeModifier *after,
45  Particle* vt,
46  std::string name="SingletonConstraint %1%"):
47  IMP::kernel::internal::TupleConstraint<SingletonModifier,
48  SingletonDerivativeModifier>
49  (before, after, vt, name)
50  {
51  }
52 
53 #if defined(IMP_DOXYGEN) || defined(SWIG)
54  protected:
55  void do_update_attributes();
56  void do_update_derivatives(DerivativeAccumulator *da);
57  virtual ModelObjectsTemp do_get_inputs() const;
58  virtual ModelObjectsTemp do_get_outputs() const;
60 #endif
61 };
62 
63 
64 IMPCORE_END_NAMESPACE
65 
66 #endif /* IMPCORE_SINGLETON_CONSTRAINT_H */