IMP  2.1.0
The Integrative Modeling Platform
ConstantRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/ConstantRestraint.h \brief Constant restraint.
3  *
4  * Just return a constant.
5  *
6  * Copyright 2007-2013 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPCORE_CONSTANT_RESTRAINT_H
11 #define IMPCORE_CONSTANT_RESTRAINT_H
12 
13 #include <IMP/core/core_config.h>
14 
15 #include <IMP/kernel/Restraint.h>
16 #include <IMP/PairScore.h>
17 #include <IMP/restraint_macros.h>
18 
19 IMPCORE_BEGIN_NAMESPACE
20 
21 //! Return a constant value.
22 /** This restraint is mostly for testing, but can also be used to make
23  the total score look nicer.
24  */
25 class IMPCOREEXPORT ConstantRestraint : public kernel::Restraint {
26  Float v_;
27 
28  public:
29  //! Add v to the total score.
31 
32  virtual double unprotected_evaluate(
33  IMP::kernel::DerivativeAccumulator *accum) const IMP_OVERRIDE;
34  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
36 };
37 
38 IMPCORE_END_NAMESPACE
39 
40 #endif /* IMPCORE_CONSTANT_RESTRAINT_H */
Class for adding derivatives from restraints to the model.
Import IMP/kernel/restraint_macros.h in the namespace.
Abstract base class for all restraints.
Import IMP/kernel/PairScore.h in the namespace.
A restraint is a term in an IMP ScoringFunction.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Return a constant value.
virtual ModelObjectsTemp do_get_inputs() const =0
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20