IMP  2.1.0
The Integrative Modeling Platform
MinimumRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/MinimumRestraint.h
3  * \brief Score based on the k minimum restraints.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPCORE_MINIMUM_RESTRAINT_H
10 #define IMPCORE_MINIMUM_RESTRAINT_H
11 
12 #include <IMP/core/core_config.h>
13 #include <IMP/kernel/Restraint.h>
14 #include <IMP/kernel/Model.h>
15 #include <IMP/macros.h>
16 #include <IMP/generic.h>
17 
18 IMPCORE_BEGIN_NAMESPACE
19 
20 //! Score based on the minimum scoring members of a set of restraints
21 /**
22  */
23 class IMPCOREEXPORT MinimumRestraint : public kernel::Restraint {
24  unsigned int k_;
25  void on_add(kernel::Restraint *r) const;
26 
27  public:
28  /** Score based on the num minimum restraints from rs. The restraints
29  must already be registered with the model (either by being added
30  to the model scoring function, upon constructior or having
31  kernel::Restraint::set_model() called on them.
32  */
33  MinimumRestraint(unsigned int num,
35  std::string name = "MinimumRestraint %1%");
36 
37  void clear_caches();
38 
39  public:
40  double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const
41  IMP_OVERRIDE;
42  IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
44  ;
45 
46  IMP_LIST_ACTION(public, Restraint, Restraints, restraint, restraints,
47  kernel::Restraint *, kernel::Restraints, on_add(obj);
48  , {}, {});
49  void set_model(kernel::Model *m);
50 };
51 
52 IMPCORE_END_NAMESPACE
53 
54 #endif /* IMPCORE_MINIMUM_RESTRAINT_H */
Class for adding derivatives from restraints to the model.
Score based on the minimum scoring members of a set of restraints.
IMP::base::Vector< IMP::base::Pointer< Restraint > > Restraints
Import IMP/kernel/macros.h in the namespace.
virtual void clear_caches()
Abstract base class for all restraints.
A restraint is a term in an IMP ScoringFunction.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
virtual void set_model(kernel::Model *m)
Storage of a model, its restraints, constraints and particles.
virtual ModelObjectsTemp do_get_inputs() const =0
Class for storing model, its restraints, constraints, and particles.
Import IMP/kernel/generic.h in the namespace.