IMP  2.1.1
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-2013 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 ParticlesTemp
60  const DependencyGraph &dg,
61  const DependencyGraphVertexIndex &index);
62 
63 /** \deprecated_at{2.1} You should act directly on the ModelObjects instead. */
64 IMPKERNEL_DEPRECATED_FUNCTION_DECL(2.1)
65 IMPKERNELEXPORT ScoreStatesTemp
67  const DependencyGraph &dg,
68  const DependencyGraphVertexIndex &index);
69 /** @} */
70 
71 /** \deprecated_at{2.1} You should act directly on the ModelObjects instead. */
72 IMPKERNEL_DEPRECATED_FUNCTION_DECL(2.1)
73 IMPKERNELEXPORT ParticlesTemp
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 RestraintsTemp
82  const DependencyGraph &dg,
83  const DependencyGraphVertexIndex &index);
84 
85 /** \deprecated_at{2.1} You should act directly on the ModelObjects instead. */
86 IMPKERNEL_DEPRECATED_FUNCTION_DECL(2.1)
87 IMPKERNELEXPORT ScoreStatesTemp
89  const DependencyGraph &dg,
90  const DependencyGraphVertexIndex &index);
91 
92 #ifndef IMP_DOXYGEN
93 /** Return all Restraints that depend on this Particle.
94  Model::set_has_all_dependencies() must be called first.*/
95 IMPKERNELEXPORT RestraintsTemp
97 #endif
98 
99 IMPKERNEL_END_NAMESPACE
100 
101 #endif /* IMPKERNEL_DEPENDENCY_GRAPH_H */
Various general useful macros for IMP.
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)
Basic types used by IMP.
ParticlesTemp get_required_particles(ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
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.
#define IMP_GRAPH(Name, directionality, VertexData, EdgeData, ShowVertex)
Define a graph object in IMP.
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.