dlvhex  2.5.0
ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT > Class Template Reference

Implements the ModelGraph. More...

#include <include/dlvhex2/ModelGraph.h>

Inheritance diagram for ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >:

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< ModelModelList
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< ModelgetSuccessorIntersection (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 ModelGraphIntgetInternalGraph () const
 Retrieves the internal model graph.
const ModelListmodelsAt (EvalUnit unit, ModelType type) const
 Return helper list that stores for each unit the set of i/omodels there.
const ModelListrelevantIModelsAt (EvalUnit unit) const
 Return list of relevant imodels at unit (depends on projection whether this is MT_IN or MT_INPROJ).
const ModelListrelevantOModelsAt (EvalUnit unit) const
 Return list of relevant omodels at unit (depends on projection whether this is MT_OUT or MT_OUTPROJ).
const ModelPropertyBundlepropsOf (Model m) const
 Retrieves the properties of a given model.
ModelPropertyBundlepropsOf (Model m)
 Retrieves the properties of a given model.
const ModelDepPropertyBundlepropsOf (ModelDep d) const
 Retrieves the properties of a given depndency.
ModelDepPropertyBundlepropsOf (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.

Detailed Description

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
class ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >

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.


Member Typedef Documentation

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef EvalGraphT::EvalUnit ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::EvalUnit

Definition at line 103 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef EvalGraphT::EvalUnitDep ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::EvalUnitDep

Definition at line 104 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef boost::vector_property_map<EvalUnitModels> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::EvalUnitModelsPropertyMap

Definition at line 243 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef ModelGraphInt::vertex_descriptor ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::Model

Definition at line 122 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef ModelGraphInt::edge_descriptor ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelDep

Definition at line 123 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef ModelDepPropertyBaseT ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelDepPropertyBase

Definition at line 94 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
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.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef Traits::vertex_iterator ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelIterator

Definition at line 124 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef std::list<Model> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelList

Definition at line 207 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef ModelPropertyBaseT ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelPropertyBase

Definition at line 93 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef EvalGraphT ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::MyEvalGraph

Definition at line 92 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef Traits::out_edge_iterator ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::PredecessorIterator

Definition at line 125 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef ModelGraph<EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::Self

Definition at line 91 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef Traits::in_edge_iterator ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::SuccessorIterator

Definition at line 126 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
typedef boost::graph_traits<ModelGraphInt> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::Traits [private]

Definition at line 119 of file ModelGraph.h.


Constructor & Destructor Documentation

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::ModelGraph ( EvalGraphT &  eg) [inline]

Constructor.

Initialize with link to eval graph

Parameters:
egEvaluation graph.

Definition at line 266 of file ModelGraph.h.


Member Function Documentation

template<typename EvalGraphT , typename ModelPropertiesT , typename ModelDepPropertiesT >
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.

Parameters:
locationModelGraph::location.
typeModelGraph::type.
depsSet 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.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::BOOST_CONCEPT_ASSERT ( (boost::Convertible< EvalGraphT, EvalGraph< typename EvalGraphT::EvalUnitPropertyBase, typename EvalGraphT::EvalUnitDepPropertyBase > >)  )
template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::BOOST_CONCEPT_ASSERT ( (boost::Convertible< typename EvalGraphT::EvalUnitPropertyBundle, EvalUnitProjectionProperties >)  )
template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
unsigned ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::countModelDeps ( ) const [inline]

Retrieves the number of depndencies in the graph.

Returns:
Number of depndencies in the graph.

Definition at line 433 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
unsigned ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::countModels ( ) const [inline]

Retrieves the number of models in the graph.

Returns:
Number of models in the graph.

Definition at line 426 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
const ModelGraphInt& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::getInternalGraph ( ) const [inline]

Retrieves the internal model graph.

Returns:
Internal model graph.

Definition at line 322 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
std::pair<ModelIterator, ModelIterator> ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::getModels ( ) const [inline]

Retrieves all models in this graph.

Returns:
Pair of begin and end operator.

Definition at line 317 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
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).

Parameters:
mModel.
Returns:
Predecessors of m represented by a pair of begin and end iterator.

Definition at line 392 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
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.

Parameters:
locationSee ModelGraph::location.
Returns:
First intersected element, boost::none if none.

Definition at line 594 of file ModelGraph.h.

References DBGLOG, DBGLOG_INDENT, DBGLOG_SCOPE, MT_OUT, and MT_OUTPROJ.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
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).

Parameters:
mModel.
Returns:
Successors of m represented by a pair of begin and end iterator.

Definition at line 403 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
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.

Parameters:
unitEvalUnit.
typeModelType.
Returns:
List of input/output models of unit 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().

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
const ModelPropertyBundle& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::propsOf ( Model  m) const [inline]

Retrieves the properties of a given model.

Parameters:
mMode.
Returns:
Properties of m.

Definition at line 359 of file ModelGraph.h.

Referenced by BOOST_FIXTURE_TEST_CASE(), OnlineModelBuilder< EvalGraphT >::clearIModel(), OnlineModelBuilder< EvalGraphT >::clearOModel(), and main().

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
ModelPropertyBundle& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::propsOf ( Model  m) [inline]

Retrieves the properties of a given model.

Parameters:
mMode.
Returns:
Properties of m.

Definition at line 367 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
const ModelDepPropertyBundle& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::propsOf ( ModelDep  d) const [inline]

Retrieves the properties of a given depndency.

Parameters:
dDepndency.
Returns:
Properties of d.

Definition at line 374 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
ModelDepPropertyBundle& ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::propsOf ( ModelDep  d) [inline]

Retrieves the properties of a given depndency.

Parameters:
dDepndency.
Returns:
Properties of d.

Definition at line 382 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
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).

Parameters:
unitEvalUnit.
Returns:
List of models of unit unit.

Definition at line 337 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
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).

Parameters:
unitEvalUnit.
Returns:
List of models of unit unit.

Definition at line 348 of file ModelGraph.h.

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
Model ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::sourceOf ( ModelDep  d) const [inline]

Retrieves the source of a dependency.

Parameters:
dDepndency.
Returns:
Source of d.

Definition at line 411 of file ModelGraph.h.

Referenced by OnlineModelBuilder< EvalGraphT >::clearOModel(), OnlineModelBuilder< EvalGraphT >::getOModel(), and OnlineModelBuilder< EvalGraphT >::printEUMBPhelper().

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
Model ModelGraph< EvalGraphT, ModelPropertyBaseT, ModelDepPropertyBaseT >::targetOf ( ModelDep  d) const [inline]

Retrieves the target of a dependency.

Parameters:
dDepndency.
Returns:
Target of d.

Definition at line 419 of file ModelGraph.h.

Referenced by OnlineModelBuilder< EvalGraphT >::printEUMBPhelper().


Field Documentation

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
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().

template<typename EvalGraphT, typename ModelPropertyBaseT = none_t, typename ModelDepPropertyBaseT = none_t>
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().


The documentation for this class was generated from the following file: