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::SubproblemsArray Struct Reference

#include <HeuristicSearchPlanEnumerator.hpp>

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

Public Types

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

Public Member Functions

 SubproblemsArray ()=default
 
template<typename PlanTable >
 SubproblemsArray (const PlanTable &, const QueryGraph &G, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &, const SubproblemsArray *parent, double g, size_type size, Subproblem marked, Subproblem *subproblems)
 Creates a state with cost g and given subproblems.
 
 SubproblemsArray (const SubproblemsArray &)=delete
 Copy c'tor.
 
template<typename PlanTable >
 SubproblemsArray (const SubproblemsArray &other, const PlanTable &, const QueryGraph &, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &)
 
 SubproblemsArray (SubproblemsArray &&other)
 Move c'tor.
 
SubproblemsArrayoperator= (SubproblemsArray other)
 Assignment.
 
 ~SubproblemsArray ()
 D'tor.
 
const SubproblemsArrayparent () const
 
template<typename PlanTable >
bool is_bottom (const PlanTable &, const QueryGraph &G, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &) const
 
template<typename PlanTable >
bool is_top (const PlanTable &, const QueryGraph &, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &) const
 
double g () const
 
Subproblem marked () const
 
Subproblem mark (const Subproblem new_marked)
 
void decrease_g (const SubproblemsArray *new_parent, double new_g) const
 
size_type size () const
 
Subproblem operator[] (std::size_t idx) const
 
template<typename PlanTable >
unsigned partition_id (const PlanTable &, const QueryGraph &, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &) 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 &) const
 
bool operator== (const SubproblemsArray &other) const
 Returns true iff this and other have the exact same Subproblems.
 
bool operator!= (const SubproblemsArray &other) const
 
bool operator< (const SubproblemsArray &other) const
 
void dump (std::ostream &out) const
 
void dump () const
 
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 SubproblemsArray Bottom (const PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF, const CardinalityEstimator &CE)
 
template<typename PlanTable >
static SubproblemsArray Top (const PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF, const CardinalityEstimator &CE)
 
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

const SubproblemsArrayparent_ = nullptr
 
double g_
 

‍the cost to reach this state from the initial state


 
size_type size_ = 0
 

‍number of subproblems in this state


 
Subproblem marked_
 

‍marked subproblem, used to avoid redundant paths


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

Detailed Description

Definition at line 196 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 199 of file HeuristicSearchPlanEnumerator.hpp.

◆ base_type

Definition at line 198 of file HeuristicSearchPlanEnumerator.hpp.

◆ const_iterator

Definition at line 202 of file HeuristicSearchPlanEnumerator.hpp.

◆ iterator

Definition at line 201 of file HeuristicSearchPlanEnumerator.hpp.

◆ size_type

Definition at line 200 of file HeuristicSearchPlanEnumerator.hpp.

Constructor & Destructor Documentation

◆ SubproblemsArray() [1/5]

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

Referenced by Bottom(), and Top().

◆ SubproblemsArray() [2/5]

template<typename PlanTable >
m::pe::hs::search_states::SubproblemsArray::SubproblemsArray ( const PlanTable &  ,
const QueryGraph G,
const AdjacencyMatrix ,
const CostFunction ,
const CardinalityEstimator ,
const SubproblemsArray parent,
double  g,
size_type  size,
Subproblem  marked,
Subproblem subproblems 
)
inline

◆ SubproblemsArray() [3/5]

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

Copy c'tor.

◆ SubproblemsArray() [4/5]

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

◆ SubproblemsArray() [5/5]

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

Move c'tor.

Definition at line 271 of file HeuristicSearchPlanEnumerator.hpp.

References swap.

◆ ~SubproblemsArray()

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

Definition at line 365 of file HeuristicSearchPlanEnumerator.hpp.

References subproblems_.

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

◆ begin() [2/2]

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

Definition at line 367 of file HeuristicSearchPlanEnumerator.hpp.

References subproblems_.

◆ Bottom()

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

◆ cbegin()

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

◆ cend()

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

◆ decrease_g()

void m::pe::hs::search_states::SubproblemsArray::decrease_g ( const SubproblemsArray new_parent,
double  new_g 
) const
inline

Definition at line 338 of file HeuristicSearchPlanEnumerator.hpp.

References g(), g_, M_insist, and parent_.

◆ dump() [1/2]

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

Definition at line 410 of file HeuristicSearchPlanEnumerator.hpp.

References dump().

Referenced by dump().

◆ dump() [2/2]

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

Definition at line 409 of file HeuristicSearchPlanEnumerator.hpp.

◆ end() [1/2]

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

Definition at line 366 of file HeuristicSearchPlanEnumerator.hpp.

References begin(), and size().

Referenced by cend(), and SubproblemsArray().

◆ end() [2/2]

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

Definition at line 368 of file HeuristicSearchPlanEnumerator.hpp.

References begin(), and size().

◆ for_each_subproblem()

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

Definition at line 373 of file HeuristicSearchPlanEnumerator.hpp.

◆ for_each_successor()

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

◆ get_allocator()

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

‍returns a reference to the class-wide allocator

Definition at line 210 of file HeuristicSearchPlanEnumerator.hpp.

References allocator_.

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

◆ INCREMENT_NUM_STATES_CONSTRUCTED()

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

Definition at line 112 of file HeuristicSearchPlanEnumerator.hpp.

◆ is_bottom()

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

Definition at line 322 of file HeuristicSearchPlanEnumerator.hpp.

References m::QueryGraph::num_sources(), and size().

◆ is_top()

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

Definition at line 329 of file HeuristicSearchPlanEnumerator.hpp.

References size().

◆ mark()

Subproblem m::pe::hs::search_states::SubproblemsArray::mark ( const Subproblem  new_marked)
inline

Definition at line 337 of file HeuristicSearchPlanEnumerator.hpp.

References marked_.

◆ marked()

Subproblem m::pe::hs::search_states::SubproblemsArray::marked ( ) const
inline

◆ num_partitions()

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

Definition at line 349 of file HeuristicSearchPlanEnumerator.hpp.

References m::QueryGraph::num_sources().

◆ NUM_STATES_CONSTRUCTED()

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

Definition at line 109 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_DISPOSED()

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

Definition at line 110 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_EXPANDED()

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

Definition at line 108 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_GENERATED()

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

Definition at line 107 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator!=() [1/2]

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

Definition at line 165 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator!=() [2/2]

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

Definition at line 393 of file HeuristicSearchPlanEnumerator.hpp.

References operator==().

◆ operator<() [1/2]

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

Definition at line 166 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator<() [2/2]

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

Definition at line 395 of file HeuristicSearchPlanEnumerator.hpp.

References cbegin(), and cend().

◆ operator=()

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

Assignment.

Definition at line 273 of file HeuristicSearchPlanEnumerator.hpp.

References swap.

◆ operator==() [1/2]

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

Definition at line 164 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator==() [2/2]

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

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

Definition at line 381 of file HeuristicSearchPlanEnumerator.hpp.

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

Referenced by operator!=().

◆ operator[]()

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

Definition at line 346 of file HeuristicSearchPlanEnumerator.hpp.

References M_insist, size_, and subproblems_.

◆ parent()

const SubproblemsArray * m::pe::hs::search_states::SubproblemsArray::parent ( ) const
inline

Definition at line 319 of file HeuristicSearchPlanEnumerator.hpp.

References parent_.

◆ partition_id()

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

Definition at line 356 of file HeuristicSearchPlanEnumerator.hpp.

References M_insist, and size().

◆ RESET_STATE_COUNTERS()

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

Definition at line 106 of file HeuristicSearchPlanEnumerator.hpp.

◆ size()

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

◆ STATE_COUNTERS() [1/2]

static state_counters_t m::pe::hs::search_states::Base< SubproblemsArray >::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< SubproblemsArray >::STATE_COUNTERS ( state_counters_t  new_counters)
inlinestaticinherited

Definition at line 118 of file HeuristicSearchPlanEnumerator.hpp.

◆ Top()

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

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 400 of file HeuristicSearchPlanEnumerator.hpp.

◆ swap

void swap ( SubproblemsArray first,
SubproblemsArray second 
)
friend

Definition at line 225 of file HeuristicSearchPlanEnumerator.hpp.

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

Field Documentation

◆ allocator_

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

‍class-wide allocator, used by all instances

Definition at line 206 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by Bottom(), get_allocator(), Top(), and ~SubproblemsArray().

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

‍the cost to reach this state from the initial state

Definition at line 215 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by decrease_g(), and g().

◆ marked_

Subproblem m::pe::hs::search_states::SubproblemsArray::marked_
private

‍marked subproblem, used to avoid redundant paths

Definition at line 219 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by mark(), and marked().

◆ parent_

const SubproblemsArray* m::pe::hs::search_states::SubproblemsArray::parent_ = nullptr
mutableprivate

Definition at line 213 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by decrease_g(), parent(), and SubproblemsArray().

◆ size_

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

‍number of subproblems in this state

Definition at line 217 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by operator[](), size(), and ~SubproblemsArray().

◆ state_counters_

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

Definition at line 103 of file HeuristicSearchPlanEnumerator.hpp.

◆ subproblems_

Subproblem* m::pe::hs::search_states::SubproblemsArray::subproblems_ = nullptr
private

‍array of subproblems

Definition at line 221 of file HeuristicSearchPlanEnumerator.hpp.

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


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