IMP logo
IMP Reference Guide  2.13.0
The Integrative Modeling Platform
ExampleRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/example/ExampleRestraint.h
3  * \brief A restraint on a list of particle pairs.
4  *
5  * Copyright 2007-2020 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPEXAMPLE_EXAMPLE_RESTRAINT_H
10 #define IMPEXAMPLE_EXAMPLE_RESTRAINT_H
11 
12 #include <IMP/example/example_config.h>
13 #include <IMP/Restraint.h>
14 
15 IMPEXAMPLE_BEGIN_NAMESPACE
16 
17 //! Restrain a particle to be in the x,y plane
18 /** \note Be sure to check out the swig wrapper file and how it
19  wraps this class.
20 
21  The source code is as follows:
22  \include ExampleRestraint.h
23  \include ExampleRestraint.cpp
24 */
25 class IMPEXAMPLEEXPORT ExampleRestraint : public Restraint {
26  ParticleIndex p_;
27  double k_;
28 
29  public:
30  //! Create the restraint.
31  /** Restraints should store the particles they are to act on,
32  preferably in a Singleton or PairContainer as appropriate.
33  */
34  ExampleRestraint(Model *m, ParticleIndex p, double k);
39 };
40 
41 IMPEXAMPLE_END_NAMESPACE
42 
43 #endif /* IMPEXAMPLE_EXAMPLE_RESTRAINT_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
virtual void do_add_score_and_derivatives(ScoreAccumulator sa) const
A restraint should override this to compute the score and derivatives.
A more IMP-like version of the std::vector.
Definition: Vector.h:39
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Class for adding up scores during ScoringFunction evaluation.
Restrain a particle to be in the x,y plane.
Abstract base class for all restraints.
virtual ModelObjectsTemp do_get_inputs() const =0
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:54