IMP  2.0.0
The Integrative Modeling Platform
QuadsConstraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/container/QuadsConstraint.h
3  * \brief Use a QuadModifier applied to a ParticleQuadsTemp to
4  * maintain an invariant
5  *
6  * WARNING This file was generated from QuadsConstraint.h
7  * in /tmp/nightly-build-5687/imp-2.0.0/tools/build/container_templates/container
8  * by tools/maintenance/setup_containers.py.
9  *
10  * Copyright 2007-2013 IMP Inventors. All rights reserved.
11  */
12 
13 #ifndef IMPCONTAINER_QUADS_CONSTRAINT_H
14 #define IMPCONTAINER_QUADS_CONSTRAINT_H
15 
16 #include <IMP/container/container_config.h>
17 #include <IMP/QuadContainer.h>
18 #include <IMP/QuadModifier.h>
19 #include <IMP/Constraint.h>
20 #include <IMP/score_state_macros.h>
21 #include <IMP/internal/ContainerConstraint.h>
22 
23 IMPKERNEL_BEGIN_NAMESPACE
24 // for swig
25 class QuadContainer;
26 class QuadModifier;
27 IMPKERNEL_END_NAMESPACE
28 
29 IMPCONTAINER_BEGIN_NAMESPACE
30 //! Apply a QuadFunction to a QuadContainer to maintain an invariant
31 /** The score state is passed up to two QuadModifiers, one to
32  apply before evaluation and the other after. The one after
33  should take a DerivativeAccumulator as its last argument for
34  QuadModifier::apply() and will only be called if
35  the score was computed with derivatives.
36 
37  An example showing a how to use such a score state to maintain a cover
38  of the atoms of a protein by a sphere per residue.
39  \verbinclude cover_particles.py
40 
41  \see core::QuadConstraint
42  */
44 #if defined(SWIG) || defined(IMP_DOXYGEN)
45  public Constraint
46 #else
47  public IMP::kernel::internal::ContainerConstraint<QuadModifier,
48  QuadDerivativeModifier,
49  QuadContainer>
50 #endif
51 {
52  typedef IMP::kernel::internal::ContainerConstraint<QuadModifier,
53  QuadDerivativeModifier,
54  QuadContainer> P;
55 public:
56  /** \param[in] c The Container to hold the elements to process
57  \param[in] before The QuadModifier to apply to all elements
58  before evaluate.
59  \param[in] after The QuadModifier to apply to all elements
60  after evaluate.
61  \param[in] name The object name
62  */
64  QuadDerivativeModifier *after,
65  QuadContainerAdaptor c,
66  std::string name="QuadConstraint %1%"):
67  P(before, after, c, name)
68  {}
69 #if defined(IMP_DOXYGEN) || defined(SWIG)
70 protected:
71  void do_update_attributes();
72  void do_update_derivatives(DerivativeAccumulator *da);
73  virtual ModelObjectsTemp do_get_inputs() const;
74  virtual ModelObjectsTemp do_get_outputs() const;
76 #endif
77 };
78 
80 
81 
82 IMPCONTAINER_END_NAMESPACE
83 
84 #endif /* IMPCONTAINER_QUADS_CONSTRAINT_H */