IMP  2.3.0
The Integrative Modeling Platform
DependencyScoreState.h
Go to the documentation of this file.
1 /**
2  * \file IMP/domino/DependencyScoreState.h
3  * \brief Add a dependency to the dependency graph.
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPDOMINO_DEPENDENCY_SCORE_STATE_H
10 #define IMPDOMINO_DEPENDENCY_SCORE_STATE_H
11 
12 #include <IMP/domino/domino_config.h>
13 #include <IMP/ScoreState.h>
14 #include <IMP/container_base.h>
15 
16 IMPDOMINO_BEGIN_NAMESPACE
17 
18 //! Add a dependency to the dependency graph
19 /** This score state doesn't do anything other than add edges to the
20  dependency graph. This can be useful when involved filters are used
21  as they are not included in the dependency graph. This may go away
22  and be replaced by adding dependencies to the SubsetFilterTable.
23  */
24 class IMPDOMINOEXPORT DependencyScoreState : public ScoreState {
25  kernel::ParticlesTemp inputp_, outputp_;
26  ContainersTemp inputc_, outputc_;
27 
28  public:
30  void set_input_particles(const kernel::ParticlesTemp &pt) {
31  IMP_USAGE_CHECK(!get_model(),
32  "Must set dependencies before adding to model.");
33  inputp_ = pt;
34  }
35  void set_output_particles(const kernel::ParticlesTemp &pt) {
36  IMP_USAGE_CHECK(!get_model(),
37  "Must set dependencies before adding to model.");
38  outputp_ = pt;
39  }
40  void set_input_containers(const ContainersTemp &pt) {
41  IMP_USAGE_CHECK(!get_model(),
42  "Must set dependencies before adding to model.");
43  inputc_ = pt;
44  }
45  void set_output_containers(const ContainersTemp &pt) {
46  IMP_USAGE_CHECK(!get_model(),
47  "Must set dependencies before adding to model.");
48  outputc_ = pt;
49  }
50 
51  protected:
52  virtual void do_before_evaluate() IMP_OVERRIDE;
53  virtual void do_after_evaluate(DerivativeAccumulator *da) IMP_OVERRIDE;
57  ;
58 };
59 
60 IMPDOMINO_END_NAMESPACE
61 
62 #endif /* IMPDOMINO_DEPENDENCY_SCORE_STATE_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
ScoreStates maintain invariants in the Model.
Add a dependency to the dependency graph.
IMP::base::Vector< IMP::base::WeakPointer< Container > > ContainersTemp
Import IMP/kernel/ScoreState.h in the namespace.
Import IMP/kernel/container_base.h in the namespace.
virtual ModelObjectsTemp do_get_inputs() const =0
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Definition: check_macros.h:170
virtual ModelObjectsTemp do_get_outputs() const =0
#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