IMP  2.4.0
The Integrative Modeling Platform
kernel/dependency_graph.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kernel/dependency_graph.h
3  * \brief Build dependency graphs on models.
4  *
5  * Copyright 2007-2015 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPKERNEL_DEPENDENCY_GRAPH_H
10 #define IMPKERNEL_DEPENDENCY_GRAPH_H
11 
12 #include <IMP/kernel/kernel_config.h>
13 #include "base_types.h"
14 #include <IMP/base/base_macros.h>
15 #include "internal/utility.h"
16 #include <boost/graph/adjacency_list.hpp>
17 #include "ModelObject.h"
18 
19 IMPKERNEL_BEGIN_NAMESPACE
20 
21 /*
22  Implementations in Model_dependency.cpp
23  */
24 
25 /** \brief A directed graph on the interactions between the various objects in
26  the model.
27 
28  The vertices are named by the associated Object*. There
29  is an edge from a to b, if a is an input to b. For example, there
30  is an edge from a particle to a restraint if the restraint directly
31  reads the particle.
32 
33  See
34  \ref dependencies "Dependencies" for more information about dependencies.
35 */
36 IMP_GRAPH(DependencyGraph, bidirectional, ModelObject *, int,
37  internal::show_dg_node(vertex, out));
38 
39 class Model;
40 
41 /** The dependency graph captures the interactions between Restraint,
42  ScoreState and Particle objects. The graph has a directed edge if the source
43  of the edge is an input for the target of the edge or the target
44  of the edge is an output for the source. eg, there
45  is an edge connecting a Container to the Restraint which gets
46  its particles from the Container.
47  \see get_pruned_dependency_graph()
48 */
50 
51 /** The pruned dependency graph merges all particles which have the
52  same dependencies to produce a simpler graph.
53 */
55 
56 /** \deprecated_at{2.1} You should act directly on the ModelObjects instead. */
57 IMPKERNEL_DEPRECATED_FUNCTION_DECL(2.1)
58 IMPKERNELEXPORT ScoreStatesTemp
60  const DependencyGraph &dg,
61  const DependencyGraphVertexIndex &index);
62 /** @} */
63 
64 /** \deprecated_at{2.1} You should act directly on the ModelObjects instead. */
65 IMPKERNEL_DEPRECATED_FUNCTION_DECL(2.1)
66 IMPKERNELEXPORT ParticlesTemp
68  const DependencyGraph &dg,
69  const DependencyGraphVertexIndex &index);
70 
71 /** \deprecated_at{2.1} You should act directly on the ModelObjects instead. */
72 IMPKERNEL_DEPRECATED_FUNCTION_DECL(2.1)
73 IMPKERNELEXPORT RestraintsTemp
75  const DependencyGraph &dg,
76  const DependencyGraphVertexIndex &index);
77 
78 /** \deprecated_at{2.1} You should act directly on the ModelObjects instead. */
79 IMPKERNEL_DEPRECATED_FUNCTION_DECL(2.1)
80 IMPKERNELEXPORT ScoreStatesTemp
82  const DependencyGraph &dg,
83  const DependencyGraphVertexIndex &index);
84 
85 #ifndef IMP_DOXYGEN
86 /** Return all Restraints that depend on this Particle.
87  Model::set_has_all_dependencies() must be called first.*/
88 IMPKERNELEXPORT RestraintsTemp
90 #endif
91 
92 IMPKERNEL_END_NAMESPACE
93 
94 #endif /* IMPKERNEL_DEPENDENCY_GRAPH_H */
IMP::kernel::ModelObject ModelObject
boost::graph DependencyGraph
A directed graph on the interactions between the various objects in the model.
ScoreStatesTemp get_dependent_score_states(ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
#define IMP_GRAPH(Name, directionality, VertexData, EdgeData, ShowVertex)
Define a graph object in IMP.
Definition: graph_macros.h:29
Basic types used by IMP.
DependencyGraph get_pruned_dependency_graph(kernel::Model *m)
ParticlesTemp get_dependent_particles(ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
DependencyGraph get_dependency_graph(kernel::Model *m)
RestraintsTemp get_dependent_restraints(ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
Single variable function.
ScoreStatesTemp get_required_score_states(ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73
Various general useful macros for IMP.