dlvhex  2.5.0
CAUAlgorithms Namespace Reference

Function templates related to Common Ancestor Units (CAUs). More...

Data Structures

class  AncestryMarkingVisitor
class  RelevanceMarkingVisitor

Typedefs

typedef std::set< int > Ancestry
typedef
boost::vector_property_map
< Ancestry
AncestryPropertyMap
 Store for each eval unit the ancestry starting from some join.
typedef
boost::vector_property_map
< bool > 
JoinRelevancePropertyMap

Functions

template<typename EvalGraphT >
void findCAUs (std::set< typename EvalGraphT::EvalUnit > &caus, const EvalGraphT &eg, typename EvalGraphT::EvalUnit u, AncestryPropertyMap &apm)
 Finds CAUs of a unit in an evaluation graph.
template<typename EvalGraphT >
void findCAUs (std::set< typename EvalGraphT::EvalUnit > &caus, const EvalGraphT &eg, typename EvalGraphT::EvalUnit u)
 Finds CAUs of a unit in an evaluation graph.
DLVHEX_EXPORT void logAPM (const AncestryPropertyMap &apm)
 Logs a given AncestryPropertyMap.
template<typename EvalGraphT >
void initJoinRelevance (JoinRelevancePropertyMap &jr, const EvalGraphT &eg)
 Stores for each unit whether it is relevant for joining.
template<typename EvalGraphT >
void markJoinRelevance (JoinRelevancePropertyMap &jr, const EvalGraphT &eg, typename EvalGraphT::EvalUnit u, const std::set< typename EvalGraphT::EvalUnit > &caus, const AncestryPropertyMap &apm)
 Given the results of findCAUs(caus, eg, u), mark all units between u and elements of caus as relevant (true), others as irrelevant (false) (do this by going from caus along a DFS through the reversed graph, marking everything that has an ancestry as relevant).
DLVHEX_EXPORT void logJRPM (const JoinRelevancePropertyMap &jr)

Detailed Description

Function templates related to Common Ancestor Units (CAUs).


Typedef Documentation

typedef std::set<int> CAUAlgorithms::Ancestry

Definition at line 50 of file CAUAlgorithms.h.

typedef boost::vector_property_map<Ancestry> CAUAlgorithms::AncestryPropertyMap

Store for each eval unit the ancestry starting from some join.

ancestry is stored in terms of join order integers (if a unit is reachable from multiple join orders, the set contains multiple values).

Definition at line 56 of file CAUAlgorithms.h.

typedef boost::vector_property_map<bool> CAUAlgorithms::JoinRelevancePropertyMap

Definition at line 93 of file CAUAlgorithms.h.


Function Documentation

template<typename EvalGraphT >
void CAUAlgorithms::findCAUs ( std::set< typename EvalGraphT::EvalUnit > &  caus,
const EvalGraphT &  eg,
typename EvalGraphT::EvalUnit  u,
AncestryPropertyMap &  apm 
)

Finds CAUs of a unit in an evaluation graph.

Parameters:
causOutput of the CAUs of u.
egEvaluationGraph.
uThe unit for which we want to find the CAUs.
apmThe ancestry map used for finding the CAUs (this is required for a subsequent call to markJoinRelevance and for debugging).

Definition at line 197 of file CAUAlgorithms.h.

References LOG_VSCOPE.

Referenced by BOOST_FIXTURE_TEST_CASE(), OfflineModelBuilder< EvalGraphT >::buildIModels(), and findCAUs().

template<typename EvalGraphT >
void CAUAlgorithms::findCAUs ( std::set< typename EvalGraphT::EvalUnit > &  caus,
const EvalGraphT &  eg,
typename EvalGraphT::EvalUnit  u 
)

Finds CAUs of a unit in an evaluation graph.

Uses an internal AncestryPropertyMap.

Parameters:
causOutput of the CAUs of u.
egEvaluationGraph.
uThe unit for which we want to find the CAUs.

Definition at line 77 of file CAUAlgorithms.h.

References findCAUs().

template<typename EvalGraphT >
void CAUAlgorithms::initJoinRelevance ( JoinRelevancePropertyMap &  jr,
const EvalGraphT &  eg 
)

Stores for each unit whether it is relevant for joining.

If it is relevant, offline model building ensures to use a common omodel otherwise, offline model building just iterates over all omodels at that unit.

Parameters:
jrJoinRelevancePropertyMap.
uEvalUnit.

Definition at line 252 of file CAUAlgorithms.h.

Referenced by OfflineModelBuilder< EvalGraphT >::buildIModels(), OfflineModelBuilder< EvalGraphT >::buildOModels(), and markJoinRelevance().

void CAUAlgorithms::logAPM ( const AncestryPropertyMap &  apm)

Logs a given AncestryPropertyMap.

Parameters:
apmAncestryPropertyMap to log.

Definition at line 43 of file CAUAlgorithms.cpp.

References DBGLOG, DBGLOG_SCOPE, and printset().

Referenced by BOOST_FIXTURE_TEST_CASE(), and OfflineModelBuilder< EvalGraphT >::buildIModels().

void CAUAlgorithms::logJRPM ( const JoinRelevancePropertyMap &  jr)

Definition at line 56 of file CAUAlgorithms.cpp.

References DBGLOG, and DBGLOG_SCOPE.

Referenced by OfflineModelBuilder< EvalGraphT >::buildIModels(), and markJoinRelevance().

template<typename EvalGraphT >
void CAUAlgorithms::markJoinRelevance ( JoinRelevancePropertyMap &  jr,
const EvalGraphT &  eg,
typename EvalGraphT::EvalUnit  u,
const std::set< typename EvalGraphT::EvalUnit > &  caus,
const AncestryPropertyMap &  apm 
)

Given the results of findCAUs(caus, eg, u), mark all units between u and elements of caus as relevant (true), others as irrelevant (false) (do this by going from caus along a DFS through the reversed graph, marking everything that has an ancestry as relevant).

Parameters:
jrJoinRelevancePropertyMap.
egEvaluationGraph.
uEvalUnit.
causCAUs of u.
AncestryPropertyMapAncestryPropertyMap.

Definition at line 271 of file CAUAlgorithms.h.

References DBGLOG, initJoinRelevance(), and logJRPM().

Referenced by BOOST_FIXTURE_TEST_CASE(), and OfflineModelBuilder< EvalGraphT >::buildIModels().