IMP  2.3.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-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;
35 };
36 
37 IMPCORE_END_NAMESPACE
38 
39 #endif /* IMPCORE_CONSTANT_RESTRAINT_H */
Class for adding derivatives from restraints to the model.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Abstract base class for all restraints.
Import IMP/kernel/PairScore.h in the namespace.
A restraint is a term in an IMP ScoringFunction.
Return a constant value.
virtual ModelObjectsTemp do_get_inputs() const =0
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:20
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73