IMP logo
IMP Reference Guide  develop.2f2f70d8d2,2026/03/10
The Integrative Modeling Platform
TripletConstraint.h
Go to the documentation of this file.
1 // Autogenerated by ../../../../tmp/nightly-build-379/imp-20260310.develop.2f2f70d8d2/tools/build/make_containers.py
2 // from ../../../../tmp/nightly-build-379/imp-20260310.develop.2f2f70d8d2/tools/build/container_templates/core/ClassnameConstraint.h
3 // Do not edit - any changes will be lost!
4 
5 /**
6  * \file IMP/core/TripletConstraint.h
7  * \brief Use a TripletModifier applied to a ParticleTripletsTemp to
8  * maintain an invariant
9  *
10  * Copyright 2007-2026 IMP Inventors. All rights reserved.
11  */
12 
13 #ifndef IMPCORE_TRIPLET_CONSTRAINT_H
14 #define IMPCORE_TRIPLET_CONSTRAINT_H
15 
16 #include <IMP/core/core_config.h>
17 #include <IMP/internal/TupleConstraint.h>
18 #include <IMP/TripletModifier.h>
19 #include <cereal/access.hpp>
20 #include <cereal/types/base_class.hpp>
21 
22 IMPCORE_BEGIN_NAMESPACE
23 //! Apply a TripletFunction to a Triplet
24 /** The score state is passed up to two TripletModifiers, one to
25  apply before evaluation and the other after. The one after
26  should take a DerivativeAccumulator as its last argument for
27  TripletModifier::apply() and will only be called if
28  the score was computed with derivatives.
29 
30  \see container::TripletsConstraint
31  */
33 #if defined(IMP_DOXYGEN) || defined(SWIG)
34  public Constraint
35 #else
36  public IMP::internal::TupleConstraint<TripletModifier,
37  TripletModifier>
38 #endif
39  {
40  typedef IMP::internal::TupleConstraint<TripletModifier,
41  TripletModifier> P;
42  friend class cereal::access;
43  template<class Archive> void serialize(Archive &ar) {
44  ar(cereal::base_class<
45  IMP::internal::TupleConstraint<TripletModifier,
46  TripletModifier> >(this));
47  }
49 
50  public:
52  TripletModifier *after, Model *m,
53  const ParticleIndexTriplet& vt,
54  std::string name = "TripletConstraint %1%",
55  bool can_skip=false)
56  : IMP::internal::TupleConstraint<
57  TripletModifier, TripletModifier>(before, after, m,
58  vt, name, can_skip) {}
59 
61 
62  //! Get the TripletModifier object used in this constraint
64  return P::get_before_modifier();
65  }
66 
67 #if defined(IMP_DOXYGEN) || defined(SWIG)
68  //! Get the index(es) used in this constraint
70 
71  protected:
72  void do_update_attributes();
73  void do_update_derivatives(DerivativeAccumulator *da);
74  virtual ModelObjectsTemp do_get_inputs() const;
75  virtual ModelObjectsTemp do_get_outputs() const;
76 #endif
78 };
79 
80 IMPCORE_END_NAMESPACE
81 
82 #endif /* IMPCORE_TRIPLET_CONSTRAINT_H */
A class to store a fixed array of same-typed values.
Definition: Array.h:40
#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
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
Ints get_index(const ParticlesTemp &particles, const Subset &subset, const Subsets &excluded)
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition: object_macros.h:95
Apply a TripletFunction to a Triplet.
A base class for modifiers of ParticleTripletsTemp.
TripletModifier * get_before_modifier() const
Get the TripletModifier object used in this constraint.
A Modifier on ParticleTripletsTemp.
Class for adding derivatives from restraints to the model.