IMP logo
IMP Reference Guide  2.15.0
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-2021 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 //! Directed graph on the interactions between the various objects in the model.
26 /** The vertices are named by the associated Object*. There
27  is an edge from a to b, if a is an input to b. For example, there
28  is an edge from a particle to a restraint if the restraint directly
29  reads the particle.
30 
31  See
32  \ref dependencies "Dependencies" for more information about dependencies.
33 */
34 IMP_GRAPH(DependencyGraph, bidirectional, ModelObject *, int,
35  internal::show_dg_node(vertex, out));
36 
37 class Model;
38 
39 /** The dependency graph captures the interactions between Restraint,
40  ScoreState and Particle objects. The graph has a directed edge if the source
41  of the edge is an input for the target of the edge or the target
42  of the edge is an output for the source. eg, there
43  is an edge connecting a Container to the Restraint which gets
44  its particles from the Container.
45  \see get_pruned_dependency_graph()
46 */
47 IMPKERNELEXPORT DependencyGraph get_dependency_graph(Model *m);
48 
49 /** The pruned dependency graph merges all particles which have the
50  same dependencies to produce a simpler graph.
51 */
53 
54 /** \deprecated_at{2.1} You should act directly on the ModelObjects instead. */
55 IMPKERNEL_DEPRECATED_FUNCTION_DECL(2.1)
56 IMPKERNELEXPORT ScoreStatesTemp
58  const DependencyGraph &dg,
59  const DependencyGraphVertexIndex &index);
60 /** @} */
61 
62 /** \deprecated_at{2.1} You should act directly on the ModelObjects instead. */
63 IMPKERNEL_DEPRECATED_FUNCTION_DECL(2.1)
64 IMPKERNELEXPORT ParticlesTemp
66  const DependencyGraph &dg,
67  const DependencyGraphVertexIndex &index);
68 
69 #ifndef IMP_DOXYGEN
70 //! Return all Restraints that depend on this Particle.
71 /* Model::set_has_all_dependencies() must be called first.
72  \note The list may contain duplicates. */
73 IMPKERNELEXPORT RestraintsTemp
74  get_dependent_restraints(Model *m, ParticleIndex pi);
75 #endif
76 
77 IMPKERNEL_END_NAMESPACE
78 
79 #endif /* IMPKERNEL_DEPENDENCY_GRAPH_H */
Basic types used by IMP.
DependencyGraph get_dependency_graph(Model *m)
boost::graph DependencyGraph
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
A more IMP-like version of the std::vector.
Definition: Vector.h:40
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)
Base class for objects in a Model that depend on other objects.
Definition: ModelObject.h:26
Base class for objects in a Model that depend on other objects.
DependencyGraph get_pruned_dependency_graph(Model *m)
Various general useful macros for IMP.