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

#include <HeuristicSearchPlanEnumerator.hpp>

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

Data Structures

struct  the_iterator
 

Public Types

using base_type = Base< SubproblemTableBottomUp >
 
using allocator_type = boost::container::node_allocator< Subproblem >
 
using size_type = typename base_type::size_type
 
using iterator = the_iterator< false >
 
using const_iterator = the_iterator< true >
 
using actual_type = ConcreteType
 

Public Member Functions

 SubproblemTableBottomUp ()=default
 
template<typename PlanTable >
 SubproblemTableBottomUp (const PlanTable &, const QueryGraph &G, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &, double g, size_type size, Subproblem marker, Subproblem *table)
 Creates a state with cost g and given table.
 
template<typename PlanTable >
 SubproblemTableBottomUp (const PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF, const CardinalityEstimator &CE)
 Creates an initial state.
 
 SubproblemTableBottomUp (const SubproblemTableBottomUp &)=delete
 Copy c'tor.
 
template<typename PlanTable >
 SubproblemTableBottomUp (const SubproblemTableBottomUp &other, const PlanTable &, const QueryGraph &G, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &)
 
 SubproblemTableBottomUp (SubproblemTableBottomUp &&other)
 Move c'tor.
 
SubproblemTableBottomUpoperator= (SubproblemTableBottomUp other)
 Assignment.
 
 ~SubproblemTableBottomUp ()
 D'tor.
 
template<typename PlanTable >
bool is_goal (const PlanTable &, const QueryGraph &, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &) const
 
double g () const
 
Subproblem marker () const
 
void decrease_g (double new_g) const
 
size_type size () const
 
Subproblemoperator[] (std::size_t idx)
 
const Subproblemoperator[] (std::size_t idx) const
 
template<typename PlanTable >
unsigned partition_id (const PlanTable &, const QueryGraph &, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &) const
 
template<typename Callback >
void for_each_subproblem (Callback &&callback, const QueryGraph &) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
bool operator== (const SubproblemTableBottomUp &other) const
 Returns true iff this and other have the exact same Subproblems.
 
bool operator!= (const SubproblemTableBottomUp &other) const
 
bool operator< (const SubproblemTableBottomUp &) const
 
void dump (std::ostream &out) const
 
void dump () const
 
const SubproblemTableBottomUpparent () 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 SubproblemTableBottomUp *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


 
template<typename PlanTable >
static unsigned num_partitions (const PlanTable &, const QueryGraph &G, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &)
 
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

double g_
 

‍the cost to reach this state from the initial state


 
size_type size_ = 0
 

‍number of subproblems in this state


 
Subproblem marker_
 

‍the last formed subproblem


 
Subproblemtable_ = nullptr
 

‍array of subproblems


 
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 (SubproblemTableBottomUp &first, SubproblemTableBottomUp &second)
 
M_LCOV_EXCL_START friend std::ostream & operator<< (std::ostream &out, const SubproblemTableBottomUp &S)
 

Detailed Description

Definition at line 415 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

Definition at line 418 of file HeuristicSearchPlanEnumerator.hpp.

◆ base_type

Definition at line 417 of file HeuristicSearchPlanEnumerator.hpp.

◆ const_iterator

Definition at line 481 of file HeuristicSearchPlanEnumerator.hpp.

◆ iterator

Definition at line 480 of file HeuristicSearchPlanEnumerator.hpp.

◆ size_type

Definition at line 419 of file HeuristicSearchPlanEnumerator.hpp.

Constructor & Destructor Documentation

◆ SubproblemTableBottomUp() [1/6]

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

◆ SubproblemTableBottomUp() [2/6]

template<typename PlanTable >
m::pe::hs::search_states::SubproblemTableBottomUp::SubproblemTableBottomUp ( const PlanTable &  ,
const QueryGraph G,
const AdjacencyMatrix ,
const CostFunction ,
const CardinalityEstimator ,
double  g,
size_type  size,
Subproblem  marker,
Subproblem table 
)
inline

◆ SubproblemTableBottomUp() [3/6]

template<typename PlanTable >
m::pe::hs::search_states::SubproblemTableBottomUp::SubproblemTableBottomUp ( const PlanTable &  PT,
const QueryGraph G,
const AdjacencyMatrix M,
const CostFunction CF,
const CardinalityEstimator CE 
)
inline

Creates an initial state.

Definition at line 512 of file HeuristicSearchPlanEnumerator.hpp.

References m::QueryGraph::num_sources(), m::SmallBitset::Singleton(), and table_.

◆ SubproblemTableBottomUp() [4/6]

m::pe::hs::search_states::SubproblemTableBottomUp::SubproblemTableBottomUp ( const SubproblemTableBottomUp )
delete

Copy c'tor.

◆ SubproblemTableBottomUp() [5/6]

template<typename PlanTable >
m::pe::hs::search_states::SubproblemTableBottomUp::SubproblemTableBottomUp ( const SubproblemTableBottomUp other,
const PlanTable &  ,
const QueryGraph G,
const AdjacencyMatrix ,
const CostFunction ,
const CardinalityEstimator  
)
inline

◆ SubproblemTableBottomUp() [6/6]

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

Move c'tor.

Definition at line 537 of file HeuristicSearchPlanEnumerator.hpp.

References swap.

◆ ~SubproblemTableBottomUp()

m::pe::hs::search_states::SubproblemTableBottomUp::~SubproblemTableBottomUp ( )
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::SubproblemTableBottomUp::begin ( )
inline

Definition at line 585 of file HeuristicSearchPlanEnumerator.hpp.

References size_, and table_.

Referenced by cbegin().

◆ begin() [2/2]

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

Definition at line 587 of file HeuristicSearchPlanEnumerator.hpp.

References size_, and table_.

◆ cbegin()

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

Definition at line 589 of file HeuristicSearchPlanEnumerator.hpp.

References begin().

◆ cend()

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

Definition at line 590 of file HeuristicSearchPlanEnumerator.hpp.

References end().

◆ decrease_g() [1/2]

double m::pe::hs::search_states::Base< SubproblemTableBottomUp >::decrease_g ( const SubproblemTableBottomUp 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::SubproblemTableBottomUp::decrease_g ( double  new_g) const
inline

Definition at line 557 of file HeuristicSearchPlanEnumerator.hpp.

References g_, and M_insist.

◆ dump() [1/2]

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

Definition at line 633 of file HeuristicSearchPlanEnumerator.hpp.

References dump().

Referenced by dump().

◆ dump() [2/2]

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

Definition at line 632 of file HeuristicSearchPlanEnumerator.hpp.

◆ end() [1/2]

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

Definition at line 586 of file HeuristicSearchPlanEnumerator.hpp.

References size_, and table_.

Referenced by cend().

◆ end() [2/2]

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

Definition at line 588 of file HeuristicSearchPlanEnumerator.hpp.

References size_, and table_.

◆ for_each_subproblem()

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

Definition at line 578 of file HeuristicSearchPlanEnumerator.hpp.

◆ for_each_successor()

void m::pe::hs::search_states::Base< SubproblemTableBottomUp >::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::SubproblemTableBottomUp::g ( ) const
inline

◆ get_allocator()

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

‍returns a reference to the class-wide allocator

Definition at line 427 of file HeuristicSearchPlanEnumerator.hpp.

References allocator_.

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

◆ INCREMENT_NUM_STATES_CONSTRUCTED()

static void m::pe::hs::search_states::Base< SubproblemTableBottomUp >::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< SubproblemTableBottomUp >::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< SubproblemTableBottomUp >::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< SubproblemTableBottomUp >::INCREMENT_NUM_STATES_GENERATED ( )
inlinestaticinherited

Definition at line 112 of file HeuristicSearchPlanEnumerator.hpp.

◆ is_bottom()

bool m::pe::hs::search_states::Base< SubproblemTableBottomUp >::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::SubproblemTableBottomUp::is_goal ( const PlanTable &  ,
const QueryGraph ,
const AdjacencyMatrix ,
const CostFunction ,
const CardinalityEstimator  
) const
inline

Definition at line 550 of file HeuristicSearchPlanEnumerator.hpp.

References size().

◆ is_top()

bool m::pe::hs::search_states::Base< SubproblemTableBottomUp >::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.

◆ marker()

Subproblem m::pe::hs::search_states::SubproblemTableBottomUp::marker ( ) const
inline

◆ num_partitions()

template<typename PlanTable >
static unsigned m::pe::hs::search_states::SubproblemTableBottomUp::num_partitions ( const PlanTable &  ,
const QueryGraph G,
const AdjacencyMatrix ,
const CostFunction ,
const CardinalityEstimator  
)
inlinestatic

Definition at line 563 of file HeuristicSearchPlanEnumerator.hpp.

References m::QueryGraph::num_sources().

◆ NUM_STATES_CONSTRUCTED()

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

Definition at line 109 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_DISPOSED()

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

Definition at line 110 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_EXPANDED()

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

Definition at line 108 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_GENERATED()

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

Definition at line 107 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator!=() [1/2]

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

Definition at line 165 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator!=() [2/2]

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

Definition at line 616 of file HeuristicSearchPlanEnumerator.hpp.

References operator==().

◆ operator<() [1/2]

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

Definition at line 166 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator<() [2/2]

bool m::pe::hs::search_states::SubproblemTableBottomUp::operator< ( const SubproblemTableBottomUp ) const
inline

Definition at line 618 of file HeuristicSearchPlanEnumerator.hpp.

References M_unreachable.

◆ operator=()

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

Assignment.

Definition at line 539 of file HeuristicSearchPlanEnumerator.hpp.

References swap.

◆ operator==() [1/2]

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

Definition at line 164 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator==() [2/2]

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

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

Definition at line 595 of file HeuristicSearchPlanEnumerator.hpp.

References M_insist, size(), m::T(), and m::X.

Referenced by operator!=().

◆ operator[]() [1/2]

Subproblem & m::pe::hs::search_states::SubproblemTableBottomUp::operator[] ( std::size_t  idx)
inline

Definition at line 559 of file HeuristicSearchPlanEnumerator.hpp.

References M_insist, size_, and table_.

◆ operator[]() [2/2]

const Subproblem & m::pe::hs::search_states::SubproblemTableBottomUp::operator[] ( std::size_t  idx) const
inline

Definition at line 560 of file HeuristicSearchPlanEnumerator.hpp.

References table_.

◆ parent()

Definition at line 138 of file HeuristicSearchPlanEnumerator.hpp.

◆ partition_id()

template<typename PlanTable >
unsigned m::pe::hs::search_states::SubproblemTableBottomUp::partition_id ( const PlanTable &  ,
const QueryGraph ,
const AdjacencyMatrix ,
const CostFunction ,
const CardinalityEstimator  
) const
inline

Definition at line 570 of file HeuristicSearchPlanEnumerator.hpp.

References M_insist, and size().

◆ RESET_STATE_COUNTERS()

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

Definition at line 106 of file HeuristicSearchPlanEnumerator.hpp.

◆ size()

size_type m::pe::hs::search_states::SubproblemTableBottomUp::size ( ) const
inline

◆ STATE_COUNTERS() [1/2]

static state_counters_t m::pe::hs::search_states::Base< SubproblemTableBottomUp >::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< SubproblemTableBottomUp >::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 SubproblemTableBottomUp S 
)
friend

Definition at line 623 of file HeuristicSearchPlanEnumerator.hpp.

◆ swap

void swap ( SubproblemTableBottomUp first,
SubproblemTableBottomUp second 
)
friend

Definition at line 486 of file HeuristicSearchPlanEnumerator.hpp.

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

Field Documentation

◆ allocator_

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

‍class-wide allocator, used by all instances

Definition at line 423 of file HeuristicSearchPlanEnumerator.hpp.

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

◆ 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::SubproblemTableBottomUp::g_
mutableprivate

‍the cost to reach this state from the initial state

Definition at line 431 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by decrease_g(), and g().

◆ marker_

Subproblem m::pe::hs::search_states::SubproblemTableBottomUp::marker_
private

‍the last formed subproblem

Definition at line 435 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by marker().

◆ size_

size_type m::pe::hs::search_states::SubproblemTableBottomUp::size_ = 0
private

‍number of subproblems in this state

Definition at line 433 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by begin(), end(), operator[](), size(), and ~SubproblemTableBottomUp().

◆ state_counters_

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

Definition at line 103 of file HeuristicSearchPlanEnumerator.hpp.

◆ table_

Subproblem* m::pe::hs::search_states::SubproblemTableBottomUp::table_ = nullptr
private

‍array of subproblems

Definition at line 437 of file HeuristicSearchPlanEnumerator.hpp.

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


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