mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | Friends
m::pe::hs::search_states::EdgesBottomUp Struct Reference

#include <HeuristicSearchPlanEnumerator.hpp>

Inheritance diagram for m::pe::hs::search_states::EdgesBottomUp:
[legend]
Collaboration diagram for m::pe::hs::search_states::EdgesBottomUp:
[legend]

Public Types

using base_type = Base< EdgesBottomUp >
 
using allocator_type = boost::container::node_allocator< unsigned >
 
using size_type = typename base_type::size_type
 
using iterator = unsigned *
 
using const_iterator = const unsigned *
 
using actual_type = ConcreteType
 

Public Member Functions

 EdgesBottomUp ()=default
 
 EdgesBottomUp (size_type num_joins_to_goal, double g, size_type num_joins, unsigned *joins)
 Creates a state with actual costs g and given subproblems.
 
 EdgesBottomUp (size_type num_joins_to_goal, size_type num_joins, unsigned *joins)
 Creates an initial state with the given subproblems.
 
template<typename It >
 EdgesBottomUp (size_type num_joins_to_goal, double g, It begin, It end)
 Creates a state with actual costs g and subproblems in range [begin; end).
 
 EdgesBottomUp (const EdgesBottomUp &other)
 Copy c'tor.
 
 EdgesBottomUp (EdgesBottomUp &&other)
 Move c'tor.
 
EdgesBottomUpoperator= (EdgesBottomUp other)
 Assignment.
 
 ~EdgesBottomUp ()
 D'tor.
 
template<typename PlanTable >
bool is_goal (const PlanTable &, const QueryGraph &, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &) const
 
double g () const
 
void decrease_g (double new_g) const
 
size_type num_joins () const
 
size_type num_subproblems (const QueryGraph &G) const
 
size_type num_joins_to_goal () const
 
unsigned operator[] (std::size_t idx) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
template<typename Callback >
void for_each_subproblem (Callback &&callback, const QueryGraph &G) const
 
bool operator== (const EdgesBottomUp &other) const
 Returns true iff this and other have the exact same joins.
 
bool operator!= (const EdgesBottomUp &other) const
 
void compute_datasource_to_subproblem_index (const QueryGraph &G, Subproblem *subproblems, uint8_t *datasource_to_subproblem) const
 Computes the Subproblems produced by the Joins of this state in subproblems.
 
void dump (std::ostream &out) const
 
void dump () const
 
const EdgesBottomUpparent () const
 
bool is_bottom (const PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF, const CardinalityEstimator &CE) const
 
bool is_top (const PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF, const CardinalityEstimator &CE) const
 
double decrease_g (const EdgesBottomUp *new_parent, double new_g) const
 Reduces the g value of the state.
 
bool operator== (const Base &other) const
 
bool operator!= (const Base &other) const
 
bool operator< (const Base &other) const
 
void for_each_successor (Callback &&callback, PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF, const CardinalityEstimator &CE) const
 Returns true iff this and other have the exact same Subproblems.
 
actual_typeactual ()
 
const actual_typeactual () const
 

Static Public Member Functions

static allocator_typeget_allocator ()
 

‍returns a reference to the class-wide allocator


 
static EdgesBottomUp CreateInitial (const QueryGraph &G, const AdjacencyMatrix &)
 
static void RESET_STATE_COUNTERS ()
 
static unsigned NUM_STATES_GENERATED ()
 
static unsigned NUM_STATES_EXPANDED ()
 
static unsigned NUM_STATES_CONSTRUCTED ()
 
static unsigned NUM_STATES_DISPOSED ()
 
static void INCREMENT_NUM_STATES_GENERATED ()
 
static void INCREMENT_NUM_STATES_EXPANDED ()
 
static void INCREMENT_NUM_STATES_CONSTRUCTED ()
 
static void INCREMENT_NUM_STATES_DISPOSED ()
 
static state_counters_t STATE_COUNTERS ()
 
static state_counters_t STATE_COUNTERS (state_counters_t new_counters)
 

Private Attributes

size_type num_joins_to_goal_ = 0
 

‍number of joins necessary to reach goal


 
double g_
 

‍the cost to reach this state from the initial state


 
size_type num_joins_ = 0
 

‍number of joins performed to reach this state


 
unsigned * joins_ = nullptr
 

‍array of IDs of joins performed


 
friend CRTPBaseType< actual_type, TParams... >
 

Static Private Attributes

static allocator_type allocator_
 

‍class-wide allocator, used by all instances


 
static state_counters_t state_counters_
 

Friends

void swap (EdgesBottomUp &first, EdgesBottomUp &second)
 
M_LCOV_EXCL_START friend std::ostream & operator<< (std::ostream &out, const EdgesBottomUp &S)
 

Detailed Description

Definition at line 638 of file HeuristicSearchPlanEnumerator.hpp.

Member Typedef Documentation

◆ actual_type

template<typename ConcreteType , template< typename... > typename CRTPBaseType, typename... TParams>
using m::crtp< ConcreteType, CRTPBaseType, TParams >::actual_type = ConcreteType
inherited

Definition at line 51 of file crtp.hpp.

◆ allocator_type

using m::pe::hs::search_states::EdgesBottomUp::allocator_type = boost::container::node_allocator<unsigned>

Definition at line 641 of file HeuristicSearchPlanEnumerator.hpp.

◆ base_type

Definition at line 640 of file HeuristicSearchPlanEnumerator.hpp.

◆ const_iterator

Definition at line 644 of file HeuristicSearchPlanEnumerator.hpp.

◆ iterator

Definition at line 643 of file HeuristicSearchPlanEnumerator.hpp.

◆ size_type

Definition at line 642 of file HeuristicSearchPlanEnumerator.hpp.

Constructor & Destructor Documentation

◆ EdgesBottomUp() [1/6]

m::pe::hs::search_states::EdgesBottomUp::EdgesBottomUp ( )
default

Referenced by CreateInitial().

◆ EdgesBottomUp() [2/6]

m::pe::hs::search_states::EdgesBottomUp::EdgesBottomUp ( size_type  num_joins_to_goal,
double  g,
size_type  num_joins,
unsigned *  joins 
)
inline

Creates a state with actual costs g and given subproblems.

Definition at line 677 of file HeuristicSearchPlanEnumerator.hpp.

References cbegin(), cend(), m::pe::hs::search_states::Base< EdgesBottomUp >::INCREMENT_NUM_STATES_CONSTRUCTED(), joins_, M_insist, and num_joins_.

◆ EdgesBottomUp() [3/6]

m::pe::hs::search_states::EdgesBottomUp::EdgesBottomUp ( size_type  num_joins_to_goal,
size_type  num_joins,
unsigned *  joins 
)
inline

Creates an initial state with the given subproblems.

Definition at line 693 of file HeuristicSearchPlanEnumerator.hpp.

◆ EdgesBottomUp() [4/6]

template<typename It >
m::pe::hs::search_states::EdgesBottomUp::EdgesBottomUp ( size_type  num_joins_to_goal,
double  g,
It  begin,
It  end 
)
inline

Creates a state with actual costs g and subproblems in range [begin; end).

Definition at line 699 of file HeuristicSearchPlanEnumerator.hpp.

References begin(), cbegin(), cend(), end(), m::pe::hs::search_states::Base< EdgesBottomUp >::INCREMENT_NUM_STATES_CONSTRUCTED(), M_insist, and num_joins_.

◆ EdgesBottomUp() [5/6]

m::pe::hs::search_states::EdgesBottomUp::EdgesBottomUp ( const EdgesBottomUp other)
inlineexplicit

◆ EdgesBottomUp() [6/6]

m::pe::hs::search_states::EdgesBottomUp::EdgesBottomUp ( EdgesBottomUp &&  other)
inline

Move c'tor.

Definition at line 731 of file HeuristicSearchPlanEnumerator.hpp.

References swap.

◆ ~EdgesBottomUp()

m::pe::hs::search_states::EdgesBottomUp::~EdgesBottomUp ( )
inline

Member Function Documentation

◆ actual() [1/2]

template<typename ConcreteType , template< typename... > typename CRTPBaseType, typename... TParams>
actual_type & m::crtp< ConcreteType, CRTPBaseType, TParams >::actual ( )
inlineinherited

◆ actual() [2/2]

template<typename ConcreteType , template< typename... > typename CRTPBaseType, typename... TParams>
const actual_type & m::crtp< ConcreteType, CRTPBaseType, TParams >::actual ( ) const
inlineinherited

Definition at line 53 of file crtp.hpp.

◆ begin() [1/2]

iterator m::pe::hs::search_states::EdgesBottomUp::begin ( )
inline

Definition at line 773 of file HeuristicSearchPlanEnumerator.hpp.

References joins_.

Referenced by cbegin(), EdgesBottomUp(), and end().

◆ begin() [2/2]

const_iterator m::pe::hs::search_states::EdgesBottomUp::begin ( ) const
inline

Definition at line 775 of file HeuristicSearchPlanEnumerator.hpp.

References joins_.

◆ cbegin()

const_iterator m::pe::hs::search_states::EdgesBottomUp::cbegin ( ) const
inline

◆ cend()

const_iterator m::pe::hs::search_states::EdgesBottomUp::cend ( ) const
inline

◆ compute_datasource_to_subproblem_index()

void m::pe::hs::search_states::EdgesBottomUp::compute_datasource_to_subproblem_index ( const QueryGraph G,
Subproblem subproblems,
uint8_t *  datasource_to_subproblem 
) const
inline

Computes the Subproblems produced by the Joins of this state in subproblems.

Simultaniously, buils a reverse index that maps from DataSource ID to Subproblem in datasource_to_subproblem.

Definition at line 813 of file HeuristicSearchPlanEnumerator.hpp.

References m::SmallBitset::All(), m::SmallBitset::empty(), id, m::QueryGraph::joins(), M_insist, m::QueryGraph::num_sources(), num_subproblems(), m::SmallBitset::Singleton(), and m::Join::sources().

Referenced by for_each_subproblem(), and m::pe::hs::expansions::BottomUpComplete::operator()().

◆ CreateInitial()

static EdgesBottomUp m::pe::hs::search_states::EdgesBottomUp::CreateInitial ( const QueryGraph G,
const AdjacencyMatrix  
)
inlinestatic

◆ decrease_g() [1/2]

double m::pe::hs::search_states::Base< EdgesBottomUp >::decrease_g ( const EdgesBottomUp new_parent,
double  new_g 
) const
inlineinherited

Reduces the g value of the state.

Definition at line 160 of file HeuristicSearchPlanEnumerator.hpp.

◆ decrease_g() [2/2]

void m::pe::hs::search_states::EdgesBottomUp::decrease_g ( double  new_g) const
inline

Definition at line 762 of file HeuristicSearchPlanEnumerator.hpp.

References g_, and M_insist.

◆ dump() [1/2]

void m::pe::hs::search_states::EdgesBottomUp::dump ( ) const
inline

Definition at line 867 of file HeuristicSearchPlanEnumerator.hpp.

References dump().

Referenced by dump().

◆ dump() [2/2]

void m::pe::hs::search_states::EdgesBottomUp::dump ( std::ostream &  out) const
inline

Definition at line 866 of file HeuristicSearchPlanEnumerator.hpp.

◆ end() [1/2]

iterator m::pe::hs::search_states::EdgesBottomUp::end ( )
inline

Definition at line 774 of file HeuristicSearchPlanEnumerator.hpp.

References begin(), and num_joins().

Referenced by cend(), EdgesBottomUp(), and for_each_subproblem().

◆ end() [2/2]

const_iterator m::pe::hs::search_states::EdgesBottomUp::end ( ) const
inline

Definition at line 776 of file HeuristicSearchPlanEnumerator.hpp.

References begin(), and num_joins().

◆ for_each_subproblem()

template<typename Callback >
void m::pe::hs::search_states::EdgesBottomUp::for_each_subproblem ( Callback &&  callback,
const QueryGraph G 
) const
inline

◆ for_each_successor()

void m::pe::hs::search_states::Base< EdgesBottomUp >::for_each_successor ( Callback &&  callback,
PlanTable &  PT,
const QueryGraph G,
const AdjacencyMatrix M,
const CostFunction CF,
const CardinalityEstimator CE 
) const
inlineinherited

Returns true iff this and other have the exact same Subproblems.

Calls callback on every state reachable from this state by a single actions.

Definition at line 171 of file HeuristicSearchPlanEnumerator.hpp.

◆ g()

double m::pe::hs::search_states::EdgesBottomUp::g ( ) const
inline

◆ get_allocator()

static allocator_type & m::pe::hs::search_states::EdgesBottomUp::get_allocator ( )
inlinestatic

‍returns a reference to the class-wide allocator

Definition at line 652 of file HeuristicSearchPlanEnumerator.hpp.

References allocator_.

◆ INCREMENT_NUM_STATES_CONSTRUCTED()

static void m::pe::hs::search_states::Base< EdgesBottomUp >::INCREMENT_NUM_STATES_CONSTRUCTED ( )
inlinestaticinherited

Definition at line 114 of file HeuristicSearchPlanEnumerator.hpp.

◆ INCREMENT_NUM_STATES_DISPOSED()

static void m::pe::hs::search_states::Base< EdgesBottomUp >::INCREMENT_NUM_STATES_DISPOSED ( )
inlinestaticinherited

Definition at line 115 of file HeuristicSearchPlanEnumerator.hpp.

◆ INCREMENT_NUM_STATES_EXPANDED()

static void m::pe::hs::search_states::Base< EdgesBottomUp >::INCREMENT_NUM_STATES_EXPANDED ( )
inlinestaticinherited

Definition at line 113 of file HeuristicSearchPlanEnumerator.hpp.

◆ INCREMENT_NUM_STATES_GENERATED()

static void m::pe::hs::search_states::Base< EdgesBottomUp >::INCREMENT_NUM_STATES_GENERATED ( )
inlinestaticinherited

Definition at line 112 of file HeuristicSearchPlanEnumerator.hpp.

◆ is_bottom()

bool m::pe::hs::search_states::Base< EdgesBottomUp >::is_bottom ( const PlanTable &  PT,
const QueryGraph G,
const AdjacencyMatrix M,
const CostFunction CF,
const CardinalityEstimator CE 
) const
inlineinherited

Definition at line 141 of file HeuristicSearchPlanEnumerator.hpp.

◆ is_goal()

template<typename PlanTable >
bool m::pe::hs::search_states::EdgesBottomUp::is_goal ( const PlanTable &  ,
const QueryGraph ,
const AdjacencyMatrix ,
const CostFunction ,
const CardinalityEstimator  
) const
inline

Definition at line 756 of file HeuristicSearchPlanEnumerator.hpp.

References num_joins(), and num_joins_to_goal_.

◆ is_top()

bool m::pe::hs::search_states::Base< EdgesBottomUp >::is_top ( const PlanTable &  PT,
const QueryGraph G,
const AdjacencyMatrix M,
const CostFunction CF,
const CardinalityEstimator CE 
) const
inlineinherited

Definition at line 148 of file HeuristicSearchPlanEnumerator.hpp.

◆ num_joins()

size_type m::pe::hs::search_states::EdgesBottomUp::num_joins ( ) const
inline

◆ num_joins_to_goal()

size_type m::pe::hs::search_states::EdgesBottomUp::num_joins_to_goal ( ) const
inline

◆ NUM_STATES_CONSTRUCTED()

static unsigned m::pe::hs::search_states::Base< EdgesBottomUp >::NUM_STATES_CONSTRUCTED ( )
inlinestaticinherited

Definition at line 109 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_DISPOSED()

static unsigned m::pe::hs::search_states::Base< EdgesBottomUp >::NUM_STATES_DISPOSED ( )
inlinestaticinherited

Definition at line 110 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_EXPANDED()

static unsigned m::pe::hs::search_states::Base< EdgesBottomUp >::NUM_STATES_EXPANDED ( )
inlinestaticinherited

Definition at line 108 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_GENERATED()

static unsigned m::pe::hs::search_states::Base< EdgesBottomUp >::NUM_STATES_GENERATED ( )
inlinestaticinherited

Definition at line 107 of file HeuristicSearchPlanEnumerator.hpp.

◆ num_subproblems()

size_type m::pe::hs::search_states::EdgesBottomUp::num_subproblems ( const QueryGraph G) const
inline

◆ operator!=() [1/2]

bool m::pe::hs::search_states::Base< EdgesBottomUp >::operator!= ( const Base< EdgesBottomUp > &  other) const
inlineinherited

Definition at line 165 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator!=() [2/2]

bool m::pe::hs::search_states::EdgesBottomUp::operator!= ( const EdgesBottomUp other) const
inline

Definition at line 807 of file HeuristicSearchPlanEnumerator.hpp.

References operator==().

◆ operator<()

bool m::pe::hs::search_states::Base< EdgesBottomUp >::operator< ( const Base< EdgesBottomUp > &  other) const
inlineinherited

Definition at line 166 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator=()

EdgesBottomUp & m::pe::hs::search_states::EdgesBottomUp::operator= ( EdgesBottomUp  other)
inline

Assignment.

Definition at line 734 of file HeuristicSearchPlanEnumerator.hpp.

References swap.

◆ operator==() [1/2]

bool m::pe::hs::search_states::Base< EdgesBottomUp >::operator== ( const Base< EdgesBottomUp > &  other) const
inlineinherited

Definition at line 164 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator==() [2/2]

bool m::pe::hs::search_states::EdgesBottomUp::operator== ( const EdgesBottomUp other) const
inline

Returns true iff this and other have the exact same joins.

Definition at line 795 of file HeuristicSearchPlanEnumerator.hpp.

References cbegin(), cend(), M_insist, and num_joins().

Referenced by operator!=().

◆ operator[]()

unsigned m::pe::hs::search_states::EdgesBottomUp::operator[] ( std::size_t  idx) const
inline

Definition at line 769 of file HeuristicSearchPlanEnumerator.hpp.

References joins_, M_insist, and num_joins().

◆ parent()

const EdgesBottomUp * m::pe::hs::search_states::Base< EdgesBottomUp >::parent ( ) const
inlineinherited

Definition at line 138 of file HeuristicSearchPlanEnumerator.hpp.

◆ RESET_STATE_COUNTERS()

static void m::pe::hs::search_states::Base< EdgesBottomUp >::RESET_STATE_COUNTERS ( )
inlinestaticinherited

Definition at line 106 of file HeuristicSearchPlanEnumerator.hpp.

◆ STATE_COUNTERS() [1/2]

static state_counters_t m::pe::hs::search_states::Base< EdgesBottomUp >::STATE_COUNTERS ( )
inlinestaticinherited

Definition at line 117 of file HeuristicSearchPlanEnumerator.hpp.

◆ STATE_COUNTERS() [2/2]

static state_counters_t m::pe::hs::search_states::Base< EdgesBottomUp >::STATE_COUNTERS ( state_counters_t  new_counters)
inlinestaticinherited

Definition at line 118 of file HeuristicSearchPlanEnumerator.hpp.

Friends And Related Function Documentation

◆ operator<<

M_LCOV_EXCL_START friend std::ostream & operator<< ( std::ostream &  out,
const EdgesBottomUp S 
)
friend

Definition at line 857 of file HeuristicSearchPlanEnumerator.hpp.

◆ swap

void swap ( EdgesBottomUp first,
EdgesBottomUp second 
)
friend

Definition at line 666 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by EdgesBottomUp(), and operator=().

Field Documentation

◆ allocator_

EdgesBottomUp::allocator_type m::pe::hs::search_states::EdgesBottomUp::allocator_
staticprivate

‍class-wide allocator, used by all instances

Definition at line 648 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by get_allocator(), and ~EdgesBottomUp().

◆ CRTPBaseType< actual_type, TParams... >

template<typename ConcreteType , template< typename... > typename CRTPBaseType, typename... TParams>
friend m::crtp< ConcreteType, CRTPBaseType, TParams >::CRTPBaseType< actual_type, TParams... >
privateinherited

Definition at line 57 of file crtp.hpp.

◆ g_

double m::pe::hs::search_states::EdgesBottomUp::g_
mutableprivate

‍the cost to reach this state from the initial state

Definition at line 658 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by decrease_g(), and g().

◆ joins_

unsigned* m::pe::hs::search_states::EdgesBottomUp::joins_ = nullptr
private

‍array of IDs of joins performed

Definition at line 662 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by begin(), EdgesBottomUp(), operator[](), and ~EdgesBottomUp().

◆ num_joins_

size_type m::pe::hs::search_states::EdgesBottomUp::num_joins_ = 0
private

‍number of joins performed to reach this state

Definition at line 660 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by EdgesBottomUp(), num_joins(), and ~EdgesBottomUp().

◆ num_joins_to_goal_

size_type m::pe::hs::search_states::EdgesBottomUp::num_joins_to_goal_ = 0
private

‍number of joins necessary to reach goal

Definition at line 656 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by is_goal(), and num_joins_to_goal().

◆ state_counters_

Base< EdgesBottomUp >::state_counters_t m::pe::hs::search_states::Base< EdgesBottomUp >::state_counters_
staticprivateinherited

Definition at line 103 of file HeuristicSearchPlanEnumerator.hpp.


The documentation for this struct was generated from the following files: