IMP  2.1.0
The Integrative Modeling Platform
MinimumSingletonRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/container/MinimumSingletonRestraint.h
3  * \brief Score based on the minimum score over a set of Singletons
4  *
5  * WARNING This file was generated from MinimumSingletonRestraint.h
6  * in /tmp/nightly-build-90783/imp-2.1.0/tools/build/container_templates/container
7  * by tools/maintenance/setup_containers.py.
8  *
9  * Copyright 2007-2013 IMP Inventors. All rights reserved.
10  */
11 
12 #ifndef IMPCONTAINER_MINIMUM_SINGLETON_RESTRAINT_H
13 #define IMPCONTAINER_MINIMUM_SINGLETON_RESTRAINT_H
14 
15 #include <IMP/container/container_config.h>
16 #include <IMP/Restraint.h>
17 #include <IMP/SingletonScore.h>
18 #include <IMP/SingletonContainer.h>
19 #include <IMP/restraint_macros.h>
20 
21 IMPCONTAINER_BEGIN_NAMESPACE
22 
23 //! Score based on the min or max SingletonScore over a set
24 /** The score is evaluated for each of the VALUETYPE in the container
25  and the value of the min or max n scores is used. That is,
26  if n is 1, the value of the restraint is the value of the min or max
27  score over the container.
28  */
29 class IMPCONTAINEREXPORT MinimumSingletonRestraint : public Restraint {
32  unsigned int n_;
33 
34  public:
35  /** n is the number of LCMinimum scores to use.
36  */
37  MinimumSingletonRestraint(SingletonScore *f, SingletonContainerAdaptor c,
38  unsigned int n = 1,
39  std::string name = "MinimumSingletonRestraint %1%");
40 
41  public:
42  double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const
43  IMP_OVERRIDE;
44  IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
46  ;
47 
48  //! Set the number of lowest scores to use.
49  void set_n(unsigned int n) { n_ = n; }
50 #ifndef IMP_DOXYGEN
51  Restraints do_create_current_decomposition() const IMP_OVERRIDE;
52  double unprotected_evaluate_if_good(DerivativeAccumulator *da,
53  double max) const IMP_OVERRIDE;
54 #endif
55 };
56 
57 IMPCONTAINER_END_NAMESPACE
58 
59 #endif /* IMPCONTAINER_MINIMUM_SINGLETON_RESTRAINT_H */
Class for adding derivatives from restraints to the model.
Import IMP/kernel/SingletonContainer.h in the namespace.
A smart pointer to a ref-counted Object that is a class memeber.
Definition: base/Pointer.h:146
Score based on the min or max SingletonScore over a set.
IMP::base::Vector< IMP::base::Pointer< Restraint > > Restraints
Import IMP/kernel/restraint_macros.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.
Import IMP/kernel/SingletonScore.h in the namespace.
virtual Restraints do_create_current_decomposition() const
Abstract score function.
virtual ModelObjectsTemp do_get_inputs() const =0
Import IMP/kernel/Restraint.h in the namespace.
void set_n(unsigned int n)
Set the number of lowest scores to use.