IMP logo
IMP Reference Guide  develop.27926d84dc,2024/04/19
The Integrative Modeling Platform
TripletsConstraint.h
Go to the documentation of this file.
1 // Autogenerated by ../../../../tmp/nightly-build-49060/imp-20240419.develop.27926d84dc/tools/build/make_containers.py
2 // from ../../../../tmp/nightly-build-49060/imp-20240419.develop.27926d84dc/tools/build/container_templates/container/ClassnamesConstraint.h
3 // Do not edit - any changes will be lost!
4 
5 /**
6  * \file IMP/container/TripletsConstraint.h
7  * \brief Use a TripletModifier applied to a ParticleTripletsTemp to
8  * maintain an invariant
9  *
10  * Copyright 2007-2023 IMP Inventors. All rights reserved.
11  */
12 
13 #ifndef IMPCONTAINER_TRIPLETS_CONSTRAINT_H
14 #define IMPCONTAINER_TRIPLETS_CONSTRAINT_H
15 
16 #include <IMP/container/container_config.h>
17 #include <IMP/TripletContainer.h>
18 #include <IMP/TripletModifier.h>
19 #include <IMP/Constraint.h>
20 #include <IMP/object_macros.h>
21 #include <IMP/internal/ContainerConstraint.h>
22 #include <cereal/access.hpp>
23 #include <cereal/types/base_class.hpp>
24 
25 IMPKERNEL_BEGIN_NAMESPACE
26 // for swig
27 class TripletContainer;
28 class TripletModifier;
29 IMPKERNEL_END_NAMESPACE
30 
31 IMPCONTAINER_BEGIN_NAMESPACE
32 //! Apply a TripletFunction to a TripletContainer to maintain an invariant
33 /** The score state is passed up to two TripletModifiers, one to
34  apply before evaluation and the other after. The one after
35  should take a DerivativeAccumulator as its last argument for
36  TripletModifier::apply() and will only be called if
37  the score was computed with derivatives.
38 
39  \see core::TripletConstraint
40  */
41 class IMPCONTAINEREXPORT TripletsConstraint :
42 #if defined(SWIG) || defined(IMP_DOXYGEN)
43  public Constraint
44 #else
45  public IMP::internal::ContainerConstraint<
46  TripletModifier, TripletModifier, TripletContainer>
47 #endif
48  {
49  typedef IMP::internal::ContainerConstraint<
51 
52  friend class cereal::access;
53  template<class Archive> void serialize(Archive &ar) {
54  ar(cereal::base_class<P>(this));
55  }
56 
58 
59  public:
60  /** \param[in] c The Container to hold the elements to process
61  \param[in] before The TripletModifier to apply to all elements
62  before evaluate.
63  \param[in] after The TripletModifier to apply to all elements
64  after evaluate.
65  \param[in] name The object name
66  */
69  std::string name = "TripletsConstraint %1%")
70  : P(before, after, c, name) {}
71 
73 
74 #if defined(IMP_DOXYGEN) || defined(SWIG)
75  protected:
76  void do_update_attributes();
77  void do_update_derivatives(DerivativeAccumulator *da);
78  virtual ModelObjectsTemp do_get_inputs() const;
79  virtual ModelObjectsTemp do_get_outputs() const;
81 #endif
82 };
83 
85 
86 IMPCONTAINER_END_NAMESPACE
87 
88 #endif /* IMPCONTAINER_TRIPLETS_CONSTRAINT_H */
Helper macros for implementing IMP Objects.
TripletsConstraint(TripletModifier *before, TripletModifier *after, TripletContainerAdaptor c, std::string name="TripletsConstraint %1%")
A container for Triplets.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A more IMP-like version of the std::vector.
Definition: Vector.h:50
Implement a constraint on the Model.
Definition: Constraint.h:49
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition: object_macros.h:95
A base class for constraints.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition: object_macros.h:44
virtual ModelObjectsTemp do_get_outputs() const =0
Apply a TripletFunction to a TripletContainer to maintain an invariant.
A base class for modifiers of ParticleTripletsTemp.
A shared container for Triplets.
A Modifier on ParticleTripletsTemp.
virtual ModelObjectsTemp do_get_inputs() const =0
Class for adding derivatives from restraints to the model.