IMP logo
IMP Reference Guide  2.6.2
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-2016 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/Restraint.h>
16 #include <IMP/PairScore.h>
17 
18 IMPCORE_BEGIN_NAMESPACE
19 
20 //! Return a constant value.
21 /** This restraint is mostly for testing, but can also be used to make
22  the total score look nicer.
23  */
24 class IMPCOREEXPORT ConstantRestraint : public Restraint {
25  Float v_;
26 
27  public:
28  //! Add v to the total score.
30 
31  virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum)
32  const IMP_OVERRIDE;
35 };
36 
37 IMPCORE_END_NAMESPACE
38 
39 #endif /* IMPCORE_CONSTANT_RESTRAINT_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Define PairScore.
Return a constant value.
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:20
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.
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:52