LatticeHashForest
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting > Class Template Reference

The main LatticeHashForest structure. This class can be used as-is with a type or derived for additional functionality as needed. More...

#include <lhf.hpp>

Collaboration diagram for lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >:
Collaboration graph
[legend]

Classes

struct  Index
 Index returned by an operation. The struct ensures type safety and possible future extensions. More...
 

Public Types

using PropertyElement = typename Nesting::template PropertyElement< PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter >
 
using PropertySet = std::vector< PropertyElement >
 
using PropertySetMap = std::unordered_map< const PropertySet *, IndexValue, SetHash< PropertySet, PropertyElement, typename PropertyElement::Hash >, SetEqual< PropertySet, PropertyElement, typename PropertyElement::FullEqual > >
 
using UnaryOperationMap = HashMap< IndexValue, IndexValue >
 
using BinaryOperationMap = HashMap< OperationNode, IndexValue >
 
using RefList = typename Nesting::LHFReferenceList
 

Public Member Functions

 LatticeHashForest (RefList reflist={})
 
bool is_empty (const Index &i) const
 
Index register_set_single (const PropertyElement &c)
 Inserts a (or gets an existing) single-element set into property set storage.
 
Index register_set_single (const PropertyElement &c, bool &cold)
 Inserts a (or gets an existing) single-element set into the property set storage, and reports whether this set was already present or not.
 
void prepare_vector_set (PropertySet &c)
 
template<bool disable_integrity_check = false>
Index register_set (const PropertySet &c)
 Inserts a (or gets an existing) set into property set storage.
 
template<bool disable_integrity_check = false>
Index register_set (const PropertySet &c, bool &cold)
 Inserts a (or gets an existing) set into property set storage, and reports whether this set was already present or not.
 
template<bool disable_integrity_check = false>
Index register_set (PropertySet &&c)
 
template<bool disable_integrity_check = false>
Index register_set (PropertySet &&c, bool &cold)
 
const PropertySetget_value (const Index &index) const
 Gets the actual property set specified by index.
 
std::size_t property_set_count () const
 Returns the total number of property sets currently in the LHF.
 
std::size_t size_of (const Index &index) const
 Returns the size of the set at index
 
Optional< PropertyElementfind_key (const Index &index, const PropertyT &p) const
 Finds a property element in the set based on the key provided.
 
bool contains (const Index &index, const PropertyElement &prop) const
 Determines whether the property set at index contains the element prop or not.
 
Index set_union (const Index &_a, const Index &_b)
 Calculates, or returns a cached result of the union of a and b
 
Index set_insert_single (const Index &a, const PropertyElement &b)
 Inserts a single element from a given set (and returns the index of the set). This is a wrapper over the union operation.
 
Index set_difference (const Index &a, const Index &b)
 Calculates, or returns a cached result of the difference of a from b
 
Index set_remove_single (const Index &a, const PropertyElement &b)
 Removes a single element from a given set (and returns the index of the set). This is a wrapper over the diffrerence operation.
 
Index set_remove_single_key (const Index &a, const PropertyT &p)
 Removes a single element from a given set if the "key" element matches.
 
Index set_intersection (const Index &_a, const Index &_b)
 Calculates, or returns a cached result of the intersection of a and b
 
Index set_filter (Index s, std::function< bool(const PropertyT &)> filter_func, HashMap< IndexValue, IndexValue > &cache)
 Filters a set based on a criterion function. This is supposed to be an abstract filtering mechanism that derived classes will use to implement caching on a filter operation rather than letting them implement their own.
 
String property_set_to_string (const Index &idx)
 
String dump () const
 Dumps the current state of the LHF to a string.
 
String dump_perf () const
 Dumps a performance information.
 

Static Public Member Functions

static bool less (const PropertyElement &a, const PropertyElement &b)
 Less than comparator for operations. You MUST use this instead of directly using anything else like "<".
 
static bool less_key (const PropertyElement &a, const PropertyT &b)
 
static bool equal (const PropertyElement &a, const PropertyElement &b)
 Equality comparator for operations. You MUST use this instead of directly using anything else like "<".
 
static bool equal_key (const PropertyElement &a, const PropertyT &b)
 
static String property_set_to_string (const PropertySet &set)
 Converts the property set to a string.
 

Protected Member Functions

SubsetRelation is_subset (const Index &a, const Index &b) const
 Returns whether we currently know whether a is a subset or a superset of b.
 
void store_subset (const Index &a, const Index &b)
 Stores index a as the subset of index b if a < b, else stores index a as the superset of index b
 

Protected Attributes

RefList reflist
 
PerformanceStatistics stat
 
HashMap< String, OperationPerfperf
 
Vector< UniquePointer< PropertySet > > property_sets = {}
 
PropertySetMap property_set_map = {}
 
BinaryOperationMap unions = {}
 
BinaryOperationMap intersections = {}
 
BinaryOperationMap differences = {}
 
HashMap< OperationNode, SubsetRelationsubsets = {}
 

Friends

std::ostream & operator<< (std::ostream &os, const LatticeHashForest &obj)
 

Detailed Description

template<typename PropertyT, typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
class lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >

The main LatticeHashForest structure. This class can be used as-is with a type or derived for additional functionality as needed.

Template Parameters
PropertyTThe type of the property. The property type must satisfy the following:
  • It must be hashable with std::hash
  • It must be less-than comparable
  • It can be checked for equality
PropertyLessCustom less-than comparator (if required)
PropertyHashCustom hasher (if required)
PropertyEqualCustom equality comaparator (if required)
PropertyPrinterPropertyT string representation generator
NestingNesting behaviour of the LHF

Definition at line 842 of file lhf.hpp.

Member Typedef Documentation

◆ BinaryOperationMap

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
using lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::BinaryOperationMap = HashMap<OperationNode, IndexValue>

Definition at line 942 of file lhf.hpp.

◆ PropertyElement

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
using lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::PropertyElement = typename Nesting::template PropertyElement< PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter>

The canonical element of property sets. Changes based on the nesting behaviour supplied.

Definition at line 893 of file lhf.hpp.

◆ PropertySet

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
using lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::PropertySet = std::vector<PropertyElement>

The storage structure for property elements. Currently implemented as sorted vectors.

Definition at line 904 of file lhf.hpp.

◆ PropertySetMap

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
using lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::PropertySetMap = std::unordered_map< const PropertySet *, IndexValue, SetHash< PropertySet, PropertyElement, typename PropertyElement::Hash>, SetEqual< PropertySet, PropertyElement, typename PropertyElement::FullEqual> >

The structure responsible for mapping property sets to their respective unique indices. When a key-value pair is actually inserted into the map, the key is a pointer to a valid storage location held by a member of the property set storage vector.

Note
The reason the 'key type' of the map is a pointer to a property set is because of several reasons:
  • Allows us to query arbitrary/user created property sets on the map.
  • Makes it not necessary to actually directly store the property set as a key.
  • Saves us from having to do some sort of complicated manuever to reserve an index value temporarily and rewrite the hash and equality comparators to retrieve the property sets from the indices instead.

Careful handling, especially in the case of reallocating structures like vectors is needed so that the address of the data does not change. It must remain static for the duration of the existence of the LHF instance.

Definition at line 929 of file lhf.hpp.

◆ RefList

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
using lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::RefList = typename Nesting::LHFReferenceList

Definition at line 943 of file lhf.hpp.

◆ UnaryOperationMap

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
using lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::UnaryOperationMap = HashMap<IndexValue, IndexValue>

Definition at line 941 of file lhf.hpp.

Constructor & Destructor Documentation

◆ LatticeHashForest()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::LatticeHashForest ( RefList  reflist = {})
inlineexplicit

Definition at line 1005 of file lhf.hpp.

Member Function Documentation

◆ contains()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
bool lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::contains ( const Index index,
const PropertyElement prop 
) const
inline

Determines whether the property set at index contains the element prop or not.

Parameters
[in]indexThe index
[in]propThe property
Returns
true if prop is in index, false otherwise.

Definition at line 1338 of file lhf.hpp.

◆ dump()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
String lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::dump ( ) const
inline

Dumps the current state of the LHF to a string.

Returns
The dumped value.

Definition at line 1809 of file lhf.hpp.

◆ dump_perf()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
String lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::dump_perf ( ) const
inline

Dumps a performance information.

Note
Conditionally enabled if LHF_ENABLE_PERFORMANCE_METRICS is set.
Returns
String containing performance information as a human-readable string.

Definition at line 1859 of file lhf.hpp.

◆ equal()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
static bool lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::equal ( const PropertyElement a,
const PropertyElement b 
)
inlinestatic

Equality comparator for operations. You MUST use this instead of directly using anything else like "<".

Parameters
[in]aLHS Property
[in]bRHS Property
Returns
Result of doing a == b according to provided semantics.

Definition at line 1277 of file lhf.hpp.

Referenced by lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::contains(), and lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::find_key().

◆ equal_key()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
static bool lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::equal_key ( const PropertyElement a,
const PropertyT &  b 
)
inlinestatic

◆ find_key()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Optional< PropertyElement > lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::find_key ( const Index index,
const PropertyT &  p 
) const
inline

Finds a property element in the set based on the key provided.

Parameters
[in]indexSet Index
[in]pKey
Returns
An optional that contains a property element if the key was found.

Definition at line 1295 of file lhf.hpp.

◆ get_value()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
const PropertySet & lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::get_value ( const Index index) const
inline

◆ is_empty()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
bool lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::is_empty ( const Index i) const
inline

◆ is_subset()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
SubsetRelation lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::is_subset ( const Index a,
const Index b 
) const
inlineprotected

Returns whether we currently know whether a is a subset or a superset of b.

Parameters
[in]aThe first set
[in]bThe second set
Returns
Enum value telling if it's a subset, superset or unknown

Definition at line 973 of file lhf.hpp.

Referenced by lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_intersection(), and lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_union().

◆ less()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
static bool lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::less ( const PropertyElement a,
const PropertyElement b 
)
inlinestatic

◆ less_key()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
static bool lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::less_key ( const PropertyElement a,
const PropertyT &  b 
)
inlinestatic

◆ prepare_vector_set()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
void lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::prepare_vector_set ( PropertySet c)
inline

Deduplicates and sorts a vector (to function equivalently to a set).

The deduplicate-sort function here is based on a stackoverflow answer (chosen for speed metrics): https://stackoverflow.com/a/24477023

Ideally, this shouldn't be used or require being used.

Definition at line 1084 of file lhf.hpp.

◆ property_set_count()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
std::size_t lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::property_set_count ( ) const
inline

Returns the total number of property sets currently in the LHF.

Returns
The count.

Definition at line 1232 of file lhf.hpp.

◆ property_set_to_string() [1/2]

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
String lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::property_set_to_string ( const Index idx)
inline

Definition at line 1800 of file lhf.hpp.

◆ property_set_to_string() [2/2]

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
static String lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::property_set_to_string ( const PropertySet set)
inlinestatic

◆ register_set() [1/4]

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
template<bool disable_integrity_check = false>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set ( const PropertySet c)
inline

Inserts a (or gets an existing) set into property set storage.

Parameters
[in]cThe property set.
Returns
Index of the newly created set.
Todo:
Check whether the cache hit check can be removed.

Definition at line 1109 of file lhf.hpp.

◆ register_set() [2/4]

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
template<bool disable_integrity_check = false>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set ( const PropertySet c,
bool &  cold 
)
inline

Inserts a (or gets an existing) set into property set storage, and reports whether this set was already present or not.

Parameters
[in]cThe property set.
[out]coldReport if this was a cold miss.
Returns
Index of the newly created/existing set.
Todo:
Check whether the cache hit check can be removed.

Definition at line 1144 of file lhf.hpp.

◆ register_set() [3/4]

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
template<bool disable_integrity_check = false>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set ( PropertySet &&  c)
inline

Definition at line 1169 of file lhf.hpp.

◆ register_set() [4/4]

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
template<bool disable_integrity_check = false>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set ( PropertySet &&  c,
bool &  cold 
)
inline

Definition at line 1191 of file lhf.hpp.

◆ register_set_single() [1/2]

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set_single ( const PropertyElement c)
inline

Inserts a (or gets an existing) single-element set into property set storage.

Parameters
[in]cThe single-element property set.
Returns
Index of the newly created/existing set.
Todo:
Check whether the cache hit check can be removed.

Definition at line 1024 of file lhf.hpp.

Referenced by lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_insert_single(), and lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_remove_single().

◆ register_set_single() [2/2]

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set_single ( const PropertyElement c,
bool &  cold 
)
inline

Inserts a (or gets an existing) single-element set into the property set storage, and reports whether this set was already present or not.

Parameters
[in]cThe single-element property set.
[out]coldReport if this was a cold miss.
Returns
Index of the newly created set.

Definition at line 1054 of file lhf.hpp.

◆ set_difference()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_difference ( const Index a,
const Index b 
)
inline

Calculates, or returns a cached result of the difference of a from b

Parameters
[in]aThe first set (what to subtract from)
[in]bThe second set (what will be subtracted)
Returns
Index of the new PropertySet.

Definition at line 1507 of file lhf.hpp.

Referenced by lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_difference(), and lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_remove_single().

◆ set_filter()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_filter ( Index  s,
std::function< bool(const PropertyT &)>  filter_func,
HashMap< IndexValue, IndexValue > &  cache 
)
inline

Filters a set based on a criterion function. This is supposed to be an abstract filtering mechanism that derived classes will use to implement caching on a filter operation rather than letting them implement their own.

Parameters
[in]sThe set to filter
[in]filter_funcThe filter function (can be a lambda)
cacheThe cache to use (possibly defined by the user)
Template Parameters
is_sort_boundedUseful for telling the function that the filter criterion will have a lower and an upper bound in a sorted list. This can potentially result in a faster filtering.
Todo:
Implement sort bound optimization
Returns
Index of the filtered set.

Definition at line 1743 of file lhf.hpp.

◆ set_insert_single()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_insert_single ( const Index a,
const PropertyElement b 
)
inline

Inserts a single element from a given set (and returns the index of the set). This is a wrapper over the union operation.

Parameters
[in]aThe set to insert the element to
[in]bThe element to be inserted.
Returns
Index of the new PropertySet.

Definition at line 1493 of file lhf.hpp.

◆ set_intersection()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_intersection ( const Index _a,
const Index _b 
)
inline

Calculates, or returns a cached result of the intersection of a and b

Parameters
[in]aThe first set
[in]bThe second set
Returns
Index of the new property set.

Definition at line 1637 of file lhf.hpp.

Referenced by lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_intersection().

◆ set_remove_single()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_remove_single ( const Index a,
const PropertyElement b 
)
inline

Removes a single element from a given set (and returns the index of the set). This is a wrapper over the diffrerence operation.

Parameters
[in]aThe set to remove the element from
[in]bThe element to be removed
Returns
Index of the new PropertySet.

Definition at line 1599 of file lhf.hpp.

◆ set_remove_single_key()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_remove_single_key ( const Index a,
const PropertyT &  p 
)
inline

Removes a single element from a given set if the "key" element matches.

Parameters
[in]aThe set to remove the element from
[in]pThe key of the element with that is to be removed
Returns
Index of the new PropertySet.

Definition at line 1612 of file lhf.hpp.

◆ set_union()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Index lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_union ( const Index _a,
const Index _b 
)
inline

Calculates, or returns a cached result of the union of a and b

Parameters
[in]aThe first set
[in]bThe second set
Returns
Index of the new property set.

Definition at line 1382 of file lhf.hpp.

Referenced by lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_insert_single(), and lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_union().

◆ size_of()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
std::size_t lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::size_of ( const Index index) const
inline

Returns the size of the set at index

Parameters
[in]indexThe index
Returns
size of the set.

Definition at line 1243 of file lhf.hpp.

◆ store_subset()

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
void lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::store_subset ( const Index a,
const Index b 
)
inlineprotected

Friends And Related Symbol Documentation

◆ operator<<

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
std::ostream & operator<< ( std::ostream &  os,
const LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting > &  obj 
)
friend

Definition at line 1846 of file lhf.hpp.

Member Data Documentation

◆ differences

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
BinaryOperationMap lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::differences = {}
protected

◆ intersections

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
BinaryOperationMap lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::intersections = {}
protected

◆ perf

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
HashMap<String, OperationPerf> lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::perf
protected

◆ property_set_map

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
PropertySetMap lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::property_set_map = {}
protected

◆ property_sets

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
Vector<UniquePointer<PropertySet> > lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::property_sets = {}
protected

◆ reflist

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
RefList lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::reflist
protected

◆ stat

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
PerformanceStatistics lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::stat
protected

Definition at line 949 of file lhf.hpp.

Referenced by lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::dump_perf(), lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set(), lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set(), lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set(), lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set(), lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set_single(), lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::register_set_single(), lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_difference(), lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_filter(), lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_intersection(), lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::set_union(), and lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::store_subset().

◆ subsets

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
HashMap<OperationNode, SubsetRelation> lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::subsets = {}
protected

◆ unions

template<typename PropertyT , typename PropertyLess = DefaultLess<PropertyT>, typename PropertyHash = DefaultHash<PropertyT>, typename PropertyEqual = DefaultEqual<PropertyT>, typename PropertyPrinter = DefaultPrinter<PropertyT>, typename Nesting = NestingNone<PropertyT>>
BinaryOperationMap lhf::LatticeHashForest< PropertyT, PropertyLess, PropertyHash, PropertyEqual, PropertyPrinter, Nesting >::unions = {}
protected

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