IMP  2.4.0
The Integrative Modeling Platform
SingletonRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/SingletonRestraint.h
3  * \brief Apply a SingletonScore to a Singleton.
4  *
5  * WARNING This file was generated from SingletonRestraint.h
6  * in /tmp/nightly-build-65532/imp-2.4.0/tools/build/container_templates/core
7  * by tools/build/make_containers.py.
8  *
9  * Copyright 2007-2015 IMP Inventors. All rights reserved.
10  *
11  */
12 
13 #ifndef IMPCORE_SINGLETON_RESTRAINT_H
14 #define IMPCORE_SINGLETON_RESTRAINT_H
15 
16 #include <IMP/core/core_config.h>
17 
18 #include <IMP/kernel/internal/TupleRestraint.h>
19 #include <IMP/SingletonScore.h>
20 
21 #include <iostream>
22 
23 IMPCORE_BEGIN_NAMESPACE
24 
25 //! Applies a SingletonScore to a Singleton.
26 /** This restraint stores a Singleton.
27  \see SingletonRestraint
28  */
30 #if defined(SWIG) || defined(IMP_DOXYGEN)
31  public Restraint
32 #else
33  public IMP::kernel::internal::TupleRestraint<SingletonScore>
34 #endif
35  {
36  public:
37  //! Create the restraint.
38  /** This function takes the function to apply to the
39  stored Singleton and the Singleton.
40  */
42  std::string name = "SingletonRestraint %1%")
43  : IMP::kernel::internal::TupleRestraint<SingletonScore>(
44  ss, IMP::kernel::internal::get_model(vt),
45  IMP::kernel::internal::get_index(vt), name) {}
46 
47  //! Create the restraint.
48  /** This function takes the function to apply to the
49  stored Singleton and the Singleton.
50  */
52  std::string name = "SingletonRestraint %1%")
53  : IMP::kernel::internal::TupleRestraint<SingletonScore>(ss, m, vt, name) {
54  }
55 
56 #if defined(SWIG) || defined(IMP_DOXYGEN)
57  protected:
58  double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const;
59  IMP::kernel::ModelObjectsTemp do_get_inputs() const;
61 #endif
62 };
63 
64 IMPCORE_END_NAMESPACE
65 
66 #endif /* IMPCORE_SINGLETON_RESTRAINT_H */
Class for adding derivatives from restraints to the model.
SingletonRestraint(SingletonScore *ss, kernel::Particle *vt, std::string name="SingletonRestraint %1%")
Create the restraint.
Ints get_index(const kernel::ParticlesTemp &particles, const Subset &subset, const Subsets &excluded)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
SingletonRestraint(kernel::Model *m, SingletonScore *ss, kernel::ParticleIndex vt, std::string name="SingletonRestraint %1%")
Create the restraint.
A restraint is a term in an IMP ScoringFunction.
Class to handle individual model particles.
Import IMP/kernel/SingletonScore.h in the namespace.
Abstract class for scoring object(s) of type Particle.
Applies a SingletonScore to a Singleton.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73