IMP  2.2.1
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-2014 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/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 kernel::Restraint {
35  Float diameter_;
38  FloatKey dr_;
39  void init();
40 
41  public:
42  //! Use f to restraint sc to be withing diameter of one another
43  /** f should have a minimum at 0 and be an upper bound-style function.
44  */
46 
47  virtual double unprotected_evaluate(IMP::kernel::DerivativeAccumulator *accum)
48  const IMP_OVERRIDE;
49  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
51 #ifndef IMP_DOXYGEN
54 #endif
55 };
56 
57 IMPCORE_END_NAMESPACE
58 
59 #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:147
Import IMP/kernel/UnaryFunction.h in the namespace.
Abstract single variable functor class for score functions.
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.