IMP logo
IMP Reference Guide  2.6.2
The Integrative Modeling Platform
dependency_graph.h
Go to the documentation of this file.
1 /**
2  * \file IMP/dependency_graph.h
3  * \brief Build dependency graphs on models.
4  *
5  * Copyright 2007-2016 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_config.h>
13 #include "base_types.h"
14 #include <IMP/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 */
49 IMPKERNELEXPORT DependencyGraph get_dependency_graph(Model *m);
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 #ifndef IMP_DOXYGEN
72 //! Return all Restraints that depend on this Particle.
73 /* Model::set_has_all_dependencies() must be called first.
74  \note The list may contain duplicates. */
75 IMPKERNELEXPORT RestraintsTemp
76  get_dependent_restraints(Model *m, ParticleIndex pi);
77 #endif
78 
79 IMPKERNEL_END_NAMESPACE
80 
81 #endif /* IMPKERNEL_DEPENDENCY_GRAPH_H */
Basic types used by IMP.
DependencyGraph get_dependency_graph(Model *m)
boost::graph DependencyGraph
A directed graph on the interactions between the various objects in the model.
ParticlesTemp get_dependent_particles(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
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
ScoreStatesTemp get_required_score_states(ModelObject *p, const ModelObjectsTemp &all, const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
Single variable function.
DependencyGraph get_pruned_dependency_graph(Model *m)
Various general useful macros for IMP.