dlvhex
2.5.0
|
Implements the ModelGraph. More...
#include <include/dlvhex2/ModelGraph.h>
Data Structures | |
struct | EvalUnitModels |
Stores the models for one EvalUnit. More... | |
struct | ModelDepPropertyBundle |
Couples a model dependency with its properties. More... | |
struct | ModelPropertyBundle |
Couples a model with its properties. More... | |
Public Types | |
typedef ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT > | Self |
typedef EvalGraphT | MyEvalGraph |
typedef ModelPropertyBaseT | ModelPropertyBase |
typedef ModelDepPropertyBaseT | ModelDepPropertyBase |
typedef EvalGraphT::EvalUnit | EvalUnit |
typedef EvalGraphT::EvalUnitDep | EvalUnitDep |
typedef ModelGraphInt::vertex_descriptor | Model |
typedef ModelGraphInt::edge_descriptor | ModelDep |
typedef Traits::vertex_iterator | ModelIterator |
typedef Traits::out_edge_iterator | PredecessorIterator |
typedef Traits::in_edge_iterator | SuccessorIterator |
typedef std::list< Model > | ModelList |
typedef boost::vector_property_map < EvalUnitModels > | EvalUnitModelsPropertyMap |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((boost::Convertible< EvalGraphT, EvalGraph< typename EvalGraphT::EvalUnitPropertyBase, typename EvalGraphT::EvalUnitDepPropertyBase > >)) | |
BOOST_CONCEPT_ASSERT ((boost::Convertible< typename EvalGraphT::EvalUnitPropertyBundle, EvalUnitProjectionProperties >)) | |
ModelGraph (EvalGraphT &eg) | |
Constructor. | |
Model | addModel (EvalUnit location, ModelType type, const std::vector< Model > &deps=std::vector< Model >()) |
Create a new model including dependencies. | |
boost::optional< Model > | getSuccessorIntersection (EvalUnit location, const std::vector< Model > &mm) const |
Intersect sets of successors of models mm . | |
std::pair< ModelIterator, ModelIterator > | getModels () const |
Retrieves all models in this graph. | |
const ModelGraphInt & | getInternalGraph () const |
Retrieves the internal model graph. | |
const ModelList & | modelsAt (EvalUnit unit, ModelType type) const |
Return helper list that stores for each unit the set of i/omodels there. | |
const ModelList & | relevantIModelsAt (EvalUnit unit) const |
Return list of relevant imodels at unit (depends on projection whether this is MT_IN or MT_INPROJ). | |
const ModelList & | relevantOModelsAt (EvalUnit unit) const |
Return list of relevant omodels at unit (depends on projection whether this is MT_OUT or MT_OUTPROJ). | |
const ModelPropertyBundle & | propsOf (Model m) const |
Retrieves the properties of a given model. | |
ModelPropertyBundle & | propsOf (Model m) |
Retrieves the properties of a given model. | |
const ModelDepPropertyBundle & | propsOf (ModelDep d) const |
Retrieves the properties of a given depndency. | |
ModelDepPropertyBundle & | propsOf (ModelDep d) |
Retrieves the properties of a given depndency. | |
std::pair< PredecessorIterator, PredecessorIterator > | getPredecessors (Model m) const |
Predecessors are models this model is based on. | |
std::pair< SuccessorIterator, SuccessorIterator > | getSuccessors (Model m) const |
Successors are models this model contributed to. | |
Model | sourceOf (ModelDep d) const |
Retrieves the source of a dependency. | |
Model | targetOf (ModelDep d) const |
Retrieves the target of a dependency. | |
unsigned | countModels () const |
Retrieves the number of models in the graph. | |
unsigned | countModelDeps () const |
Retrieves the number of depndencies in the graph. | |
Private Types | |
typedef boost::adjacency_list < boost::listS, boost::listS, boost::bidirectionalS, ModelPropertyBundle, ModelDepPropertyBundle > | ModelGraphInt |
typedef boost::graph_traits < ModelGraphInt > | Traits |
Private Attributes | |
EvalGraphT & | eg |
The eval graph this model graph is linked to. | |
ModelGraphInt | mg |
Model graph. | |
EvalUnitModelsPropertyMap | mau |
"exterior property map" for the eval graph: which models are present at which unit. |
Implements the ModelGraph.
The ModelGraph template manages a generic model graph, corresponding to an EvalGraph type: * it manages projection for units and corresponding model types * it manages correspondance of dependencies between models and units * it manages correspondance of join orders between model and unit dependencies.
Definition at line 85 of file ModelGraph.h.
typedef EvalGraphT::EvalUnit ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::EvalUnit |
Definition at line 103 of file ModelGraph.h.
typedef EvalGraphT::EvalUnitDep ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::EvalUnitDep |
Definition at line 104 of file ModelGraph.h.
typedef boost::vector_property_map<EvalUnitModels> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::EvalUnitModelsPropertyMap |
Definition at line 243 of file ModelGraph.h.
typedef ModelGraphInt::vertex_descriptor ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::Model |
Definition at line 122 of file ModelGraph.h.
typedef ModelGraphInt::edge_descriptor ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelDep |
Definition at line 123 of file ModelGraph.h.
typedef ModelDepPropertyBaseT ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelDepPropertyBase |
Definition at line 94 of file ModelGraph.h.
typedef boost::adjacency_list< boost::listS, boost::listS, boost::bidirectionalS, ModelPropertyBundle, ModelDepPropertyBundle> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelGraphInt [private] |
Definition at line 112 of file ModelGraph.h.
typedef Traits::vertex_iterator ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelIterator |
Definition at line 124 of file ModelGraph.h.
typedef std::list<Model> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelList |
Definition at line 207 of file ModelGraph.h.
typedef ModelPropertyBaseT ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelPropertyBase |
Definition at line 93 of file ModelGraph.h.
typedef EvalGraphT ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::MyEvalGraph |
Definition at line 92 of file ModelGraph.h.
typedef Traits::out_edge_iterator ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::PredecessorIterator |
Definition at line 125 of file ModelGraph.h.
typedef ModelGraph<EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::Self |
Definition at line 91 of file ModelGraph.h.
typedef Traits::in_edge_iterator ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::SuccessorIterator |
Definition at line 126 of file ModelGraph.h.
typedef boost::graph_traits<ModelGraphInt> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::Traits [private] |
Definition at line 119 of file ModelGraph.h.
ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelGraph | ( | EvalGraphT & | eg | ) | [inline] |
Constructor.
Initialize with link to eval graph
eg | Evaluation graph. |
Definition at line 266 of file ModelGraph.h.
ModelGraph< EvalGraphT, ModelPropertiesT, ModelDepPropertiesT >::Model ModelGraph< EvalGraphT, ModelPropertiesT, ModelDepPropertiesT >::addModel | ( | EvalUnit | location, |
ModelType | type, | ||
const std::vector< Model > & | deps = std::vector<Model>() |
||
) |
Create a new model including dependencies.
Returns the new model. * modelsAtUnit is automatically updated. * order of dependencies determines join order.
MT_IN models: * checks if join order is equal to join order of eval graph. * checks if input models depend on all units this unit depends on.
MT_INPROJ models: * checks if model depends on MT_IN model at same unit. * checks if projection is configured for unit.
MT_OUT models: * checks if model depends on MT_IN or MT_INPROJ at same unit iff unit has predecessors
MT_OUTPROJ models: * checks if model depends on MT_OUT at same unit. * checks if projection is configured for unit.
location | ModelGraph::location. |
type | ModelGraph::type. |
deps | Set of models to add. |
Definition at line 442 of file ModelGraph.h.
References DBGLOG, ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelPropertyBundle::location, LOG, LOG_VSCOPE, MT_IN, MT_INPROJ, MT_OUT, MT_OUTPROJ, and ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelPropertyBundle::type.
ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::BOOST_CONCEPT_ASSERT | ( | (boost::Convertible< EvalGraphT, EvalGraph< typename EvalGraphT::EvalUnitPropertyBase, typename EvalGraphT::EvalUnitDepPropertyBase > >) | ) |
ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::BOOST_CONCEPT_ASSERT | ( | (boost::Convertible< typename EvalGraphT::EvalUnitPropertyBundle, EvalUnitProjectionProperties >) | ) |
unsigned ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::countModelDeps | ( | ) | const [inline] |
Retrieves the number of depndencies in the graph.
Definition at line 433 of file ModelGraph.h.
unsigned ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::countModels | ( | ) | const [inline] |
Retrieves the number of models in the graph.
Definition at line 426 of file ModelGraph.h.
const ModelGraphInt& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::getInternalGraph | ( | ) | const [inline] |
Retrieves the internal model graph.
Definition at line 322 of file ModelGraph.h.
std::pair<ModelIterator, ModelIterator> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::getModels | ( | ) | const [inline] |
Retrieves all models in this graph.
Definition at line 317 of file ModelGraph.h.
std::pair<PredecessorIterator, PredecessorIterator> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::getPredecessors | ( | Model | m | ) | const [inline] |
Predecessors are models this model is based on.
Predecessors are dependencies, so predecessors are at targetOf(iterators).
m | Model. |
m
represented by a pair of begin and end iterator. Definition at line 392 of file ModelGraph.h.
boost::optional< typename ModelGraph< EvalGraphT, ModelPropertiesT, ModelDepPropertiesT >::Model > ModelGraph< EvalGraphT, ModelPropertiesT, ModelDepPropertiesT >::getSuccessorIntersection | ( | EvalUnit | location, |
const std::vector< Model > & | mm | ||
) | const |
Intersect sets of successors of models mm
.
location | See ModelGraph::location. |
Definition at line 594 of file ModelGraph.h.
References DBGLOG, DBGLOG_INDENT, DBGLOG_SCOPE, MT_OUT, and MT_OUTPROJ.
std::pair<SuccessorIterator, SuccessorIterator> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::getSuccessors | ( | Model | m | ) | const [inline] |
Successors are models this model contributed to.
Successors are dependencies, so successors are at sourceOf(iterators).
m | Model. |
m
represented by a pair of begin and end iterator. Definition at line 403 of file ModelGraph.h.
const ModelList& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::modelsAt | ( | EvalUnit | unit, |
ModelType | type | ||
) | const [inline] |
Return helper list that stores for each unit the set of i/omodels there.
unit | EvalUnit. |
type | ModelType. |
unit
. Definition at line 329 of file ModelGraph.h.
Referenced by BOOST_FIXTURE_TEST_CASE(), main(), ModelGraph< EvalGraphT, ModelProperties >::relevantIModelsAt(), and ModelGraph< EvalGraphT, ModelProperties >::relevantOModelsAt().
const ModelPropertyBundle& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::propsOf | ( | Model | m | ) | const [inline] |
Retrieves the properties of a given model.
m | Mode. |
m
. Definition at line 359 of file ModelGraph.h.
Referenced by BOOST_FIXTURE_TEST_CASE(), OnlineModelBuilder< EvalGraphT >::clearIModel(), OnlineModelBuilder< EvalGraphT >::clearOModel(), and main().
ModelPropertyBundle& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::propsOf | ( | Model | m | ) | [inline] |
Retrieves the properties of a given model.
m | Mode. |
m
. Definition at line 367 of file ModelGraph.h.
const ModelDepPropertyBundle& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::propsOf | ( | ModelDep | d | ) | const [inline] |
Retrieves the properties of a given depndency.
d | Depndency. |
d
. Definition at line 374 of file ModelGraph.h.
ModelDepPropertyBundle& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::propsOf | ( | ModelDep | d | ) | [inline] |
Retrieves the properties of a given depndency.
d | Depndency. |
d
. Definition at line 382 of file ModelGraph.h.
const ModelList& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::relevantIModelsAt | ( | EvalUnit | unit | ) | const [inline] |
Return list of relevant imodels at unit (depends on projection whether this is MT_IN or MT_INPROJ).
unit | EvalUnit. |
unit
. Definition at line 337 of file ModelGraph.h.
const ModelList& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::relevantOModelsAt | ( | EvalUnit | unit | ) | const [inline] |
Return list of relevant omodels at unit (depends on projection whether this is MT_OUT or MT_OUTPROJ).
unit | EvalUnit. |
unit
. Definition at line 348 of file ModelGraph.h.
Model ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::sourceOf | ( | ModelDep | d | ) | const [inline] |
Retrieves the source of a dependency.
d | Depndency. |
d
. Definition at line 411 of file ModelGraph.h.
Referenced by OnlineModelBuilder< EvalGraphT >::clearOModel(), OnlineModelBuilder< EvalGraphT >::getOModel(), and OnlineModelBuilder< EvalGraphT >::printEUMBPhelper().
Model ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::targetOf | ( | ModelDep | d | ) | const [inline] |
Retrieves the target of a dependency.
d | Depndency. |
d
. Definition at line 419 of file ModelGraph.h.
Referenced by OnlineModelBuilder< EvalGraphT >::printEUMBPhelper().
EvalGraphT& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::eg [private] |
The eval graph this model graph is linked to.
Definition at line 250 of file ModelGraph.h.
Referenced by ModelGraph< EvalGraphT, ModelProperties >::relevantIModelsAt(), and ModelGraph< EvalGraphT, ModelProperties >::relevantOModelsAt().
EvalUnitModelsPropertyMap ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::mau [private] |
"exterior property map" for the eval graph: which models are present at which unit.
"mau" stands for "models at unit".
Definition at line 256 of file ModelGraph.h.
Referenced by ModelGraph< EvalGraphT, ModelProperties >::ModelGraph(), and ModelGraph< EvalGraphT, ModelProperties >::modelsAt().
ModelGraphInt ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::mg [private] |
Model graph.
Definition at line 252 of file ModelGraph.h.
Referenced by ModelGraph< EvalGraphT, ModelProperties >::countModelDeps(), ModelGraph< EvalGraphT, ModelProperties >::countModels(), ModelGraph< EvalGraphT, ModelProperties >::getInternalGraph(), ModelGraph< EvalGraphT, ModelProperties >::getModels(), ModelGraph< EvalGraphT, ModelProperties >::getPredecessors(), ModelGraph< EvalGraphT, ModelProperties >::getSuccessors(), ModelGraph< EvalGraphT, ModelProperties >::propsOf(), ModelGraph< EvalGraphT, ModelProperties >::sourceOf(), and ModelGraph< EvalGraphT, ModelProperties >::targetOf().