IMP  2.1.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-2013 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/kernel/Restraint.h>
17 #include <IMP/restraint_macros.h>
18 #include <IMP/UnaryFunction.h>
19 
20 IMPCORE_BEGIN_NAMESPACE
21 
22 //! Restrain the diameter of a set of points
23 /** This class also serves as an example of how to build restraints which
24  have internal ScoreStates and perhaps more than one actual restraint
25  object.
26 
27  The diameter scored includes the radius of the involved particles.
28 
29  \note, Currently, decomposing this restraint results in pieces which
30  score deviations from the diameter with a harmonic upper bound of strength
31  1.
32  */
33 class IMPCOREEXPORT DiameterRestraint : public kernel::Restraint {
36  Float diameter_;
39  FloatKey dr_;
40  void init();
41 
42  public:
43  //! Use f to restraint sc to be withing diameter of one another
44  /** f should have a minimum at 0 and be an upper bound-style function.
45  */
47 
48  virtual double unprotected_evaluate(
49  IMP::kernel::DerivativeAccumulator *accum) const IMP_OVERRIDE;
50  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
52 #ifndef IMP_DOXYGEN
55 #endif
56 };
57 
58 IMPCORE_END_NAMESPACE
59 
60 #endif /* IMPCORE_DIAMETER_RESTRAINT_H */
Class for adding derivatives from restraints to the model.
Import IMP/kernel/SingletonContainer.h in the namespace.
A smart pointer to a ref-counted Object that is a class memeber.
Definition: base/Pointer.h:146
Import IMP/kernel/UnaryFunction.h in the namespace.
Abstract single variable functor class for score functions.
Import IMP/kernel/restraint_macros.h in the namespace.
Import IMP/kernel/PairContainer.h in the namespace.
Abstract base class for all restraints.
Restrain the diameter of a set of points.
A restraint is a term in an IMP ScoringFunction.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
virtual Restraints do_create_current_decomposition() const
virtual ModelObjectsTemp do_get_inputs() const =0
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
virtual Restraints do_create_decomposition() const
A shared container for Singletons.