IMP logo
IMP Reference Guide  2.17.0
The Integrative Modeling Platform
DiameterRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/DiameterRestraint.h
3  * \brief A restraint to maintain the diameter of a set of points
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPCORE_DIAMETER_RESTRAINT_H
9 #define IMPCORE_DIAMETER_RESTRAINT_H
10 
11 #include <IMP/core/core_config.h>
12 
13 #include "internal/remove_pointers.h"
14 #include <IMP/PairContainer.h>
15 #include <IMP/SingletonContainer.h>
16 #include <IMP/Restraint.h>
17 #include <IMP/UnaryFunction.h>
18 
19 IMPCORE_BEGIN_NAMESPACE
20 
21 //! Restrain the diameter of a set of points
22 /** This class also serves as an example of how to build restraints which
23  have internal ScoreStates and perhaps more than one actual restraint
24  object.
25 
26  The diameter scored includes the radius of the involved particles.
27 
28  \note Currently, decomposing this restraint results in pieces which
29  score deviations from the diameter with a harmonic upper bound of strength
30  1.
31  */
32 class IMPCOREEXPORT DiameterRestraint : public Restraint {
35  Float diameter_;
38  FloatKey dr_;
39  void init();
40 
41  public:
42  //! Use f to restrain sc to be within diameter of one another
43  /** f should have a minimum at 0 and be an upper bound-style function.
44  */
46 
48  const override;
49  virtual IMP::ModelObjectsTemp do_get_inputs() const override;
51 #ifndef IMP_DOXYGEN
52  Restraints do_create_decomposition() const override;
54 #endif
55 };
56 
57 IMPCORE_END_NAMESPACE
58 
59 #endif /* IMPCORE_DIAMETER_RESTRAINT_H */
A container for Singletons.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Single variable function.
virtual double unprotected_evaluate(DerivativeAccumulator *da) const
Return the unweighted score for the restraint.
virtual Restraints do_create_decomposition() const
Definition: Restraint.h:306
A more IMP-like version of the std::vector.
Definition: Vector.h:40
A container for Pairs.
virtual Restraints do_create_current_decomposition() const
Definition: Restraint.h:316
Restrain the diameter of a set of points.
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
A shared container for Singletons.
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:19
Abstract base class for all restraints.
Abstract single variable functor class for score functions.
Definition: UnaryFunction.h:25
virtual ModelObjectsTemp do_get_inputs() const =0
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:53