IMP  2.2.1
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-2014 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 
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 kernel::Restraint {
25  Float v_;
26 
27  public:
28  //! Add v to the total score.
30 
31  virtual double unprotected_evaluate(IMP::kernel::DerivativeAccumulator *accum)
32  const IMP_OVERRIDE;
33  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
35 };
36 
37 IMPCORE_END_NAMESPACE
38 
39 #endif /* IMPCORE_CONSTANT_RESTRAINT_H */
Class for adding derivatives from restraints to the model.
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
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72