IMP logo
IMP Reference Guide  develop.02fce3ae61,2026/01/08
The Integrative Modeling Platform
TripletRestraint.h
Go to the documentation of this file.
1 // Autogenerated by ../../../../tmp/nightly-build-379/imp-20260108.develop.02fce3ae61/tools/build/make_containers.py
2 // from ../../../../tmp/nightly-build-379/imp-20260108.develop.02fce3ae61/tools/build/container_templates/core/ClassnameRestraint.h
3 // Do not edit - any changes will be lost!
4 
5 /**
6  * \file IMP/core/TripletRestraint.h
7  * \brief Apply a TripletScore to a Triplet.
8  *
9  * Copyright 2007-2025 IMP Inventors. All rights reserved.
10  *
11  */
12 
13 #ifndef IMPCORE_TRIPLET_RESTRAINT_H
14 #define IMPCORE_TRIPLET_RESTRAINT_H
15 
16 #include <IMP/core/core_config.h>
17 
18 #include <IMP/internal/TupleRestraint.h>
19 #include <IMP/TripletScore.h>
20 
21 #include <iostream>
22 #include <cereal/access.hpp>
23 #include <cereal/types/base_class.hpp>
24 
25 IMPCORE_BEGIN_NAMESPACE
26 
27 //! Applies a TripletScore to a Triplet.
28 /** This restraint stores a Triplet.
29  \see TripletRestraint
30  */
32 #if defined(SWIG) || defined(IMP_DOXYGEN)
33  public Restraint
34 #else
35  public IMP::internal::TupleRestraint<TripletScore>
36 #endif
37  {
38  typedef IMP::internal::TupleRestraint<TripletScore> P;
39  friend class cereal::access;
40 
41  template<class Archive> void serialize(Archive &ar) {
42  ar(cereal::base_class<
43  IMP::internal::TupleRestraint<TripletScore> >(this));
44  }
46  public:
47  //! Create the restraint.
48  /** This function takes the function to apply to the
49  stored Triplet and the Triplet.
50  */
52  std::string name = "TripletRestraint %1%")
53  : IMP::internal::TupleRestraint<TripletScore>(ss, m, vt, name) {
54  }
55  TripletRestraint() {}
56 
57  //! Get the TripletScore object used in this restraint
58  TripletScore *get_score_object() const { return P::get_score(); }
59 
60 #if defined(SWIG) || defined(IMP_DOXYGEN)
61  //! Get the index(es) used in this restraint
62  typename TripletScore::IndexArgument get_index() const;
63 
64  protected:
65  double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const;
66  IMP::ModelObjectsTemp do_get_inputs() const;
67 #endif
69 };
70 
71 IMPCORE_END_NAMESPACE
72 
73 #endif /* IMPCORE_TRIPLET_RESTRAINT_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
TripletRestraint(Model *m, TripletScore *ss, const ParticleIndexTriplet &vt, std::string name="TripletRestraint %1%")
Create the restraint.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
Applies a TripletScore to a Triplet.
Ints get_index(const ParticlesTemp &particles, const Subset &subset, const Subsets &excluded)
TripletScore * get_score_object() const
Get the TripletScore object used in this restraint.
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition: object_macros.h:95
Define TripletScore.
Abstract class for scoring object(s) of type ParticleIndexTriplet.
Definition: TripletScore.h:44
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:56