souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
30 #define unlikely(x) __builtin_expect((x), 0)
31 #define likely(x) __builtin_expect((x), 1)
49 template <
typename TupleType>
70 inline size_t size() {
80 inline std::atomic<block_t>&
get(
parent_t node)
const {
100 this->
get(x).compare_exchange_strong(xState, newState);
122 if (nextN != x || rankN != oldrank)
return false;
126 return this->
get(x).compare_exchange_strong(oldState, newVal);
148 if (x == y)
return true;
171 if (xrank > yrank || ((xrank == yrank) && x > y)) {
173 std::swap(xrank, yrank);
181 if (xrank == yrank) {
230 template <
typename StorePair>
232 int operator()(
const StorePair& a,
const StorePair&
b) {
233 if (a.first <
b.first) {
235 }
else if (
b.first < a.first) {
242 bool less(
const StorePair& a,
const StorePair&
b) {
246 bool equal(
const StorePair& a,
const StorePair&
b) {
251 template <
typename SparseDomain>
255 template <
typename TupleType>
313 inline bool sameSet(SparseDomain x, SparseDomain y) {
317 inline SparseDomain
findNode(SparseDomain x) {
321 inline void unionNodes(SparseDomain x, SparseDomain y) {
325 inline std::size_t
size() {
339 inline void makeNode(SparseDomain val) {
349 inline bool contains(SparseDomain v1, SparseDomain v2) {
T & get(size_t index) const
Retrieve a reference to the stored value at index.
bool sameSet(SparseDomain x, SparseDomain y)
size_t size() const
Well, returns the number of nodes exist within the list + number of nodes queued to be inserted The r...
void clear()
Clears this tree.
void clear()
Clears the DisjointSet of all nodes Invalidates all iterators.
void insertAt(size_t index, T value)
std::pair< SparseDomain, parent_t > PairStore
T & get(size_t index) const
constexpr block_t rank_mask
parent_t findNode(parent_t x)
Equivalent to the find() function in union/find Find the highest ancestor of the provided node - flat...
parent_t toDense(const SparseDomain in)
Retrieve dense encoding, adding it in if non-existent.
bool sameSet(parent_t x, parent_t y)
Check whether the two indices are in the same set.
void unionNodes(SparseDomain x, SparseDomain y)
DenseMap denseToSparseMap
bool less(const StorePair &a, const StorePair &b)
block_t makeNode()
Create a node with its parent as itself, rank 0.
Functor::result_type insert(Key &k, const Functor &f)
Inserts the given key into this tree.
bool contains(SparseDomain v1, SparseDomain v2)
static block_t pr2b(const parent_t parent, const rank_t rank)
Yield a block given parent and rank.
SparseDomain findNode(SparseDomain x)
int operator()(const StorePair &a, const StorePair &b)
void clear()
Clear all elements from the PiggyList.
void makeNode(SparseDomain val)
const SparseDomain toSparse(const parent_t in) const
For the given dense value, return the associated sparse value Undefined behaviour if dense value not ...
void clear()
Remove all elements from this disjoint set.
SparseDisjointSet()=default
void unionNodes(parent_t x, parent_t y)
Union the two specified index nodes.
bool updateRoot(const parent_t x, const rank_t oldrank, const parent_t y, const rank_t newrank)
Update the root of the tree of which x is, to have y as the base instead.
SparseMap sparseToDenseMap
std::atomic< block_t > & get(parent_t node) const
Yield reference to the node by its node index.
DisjointSet & operator=(DisjointSet &ds)=delete
l j a showGridBackground &&c b raw series this eventEmitter b
SparseDisjointSet & operator=(SparseDisjointSet &other)=delete
bool contains(const Key &k) const
Determines whether the given element is a member of this tree.
static parent_t b2p(const block_t inblock)
Extract parent from block.
static rank_t b2r(const block_t inblock)
Extract rank from block.
Structure that emulates a Disjoint Set, i.e.
constexpr uint8_t split_size
btree_operation_hints< 1 > operation_hints
bool nodeExists(const SparseDomain val) const
SparseMap::operation_hints last_ins
size_t size()
Return the number of elements in this disjoint set (not the number of pairs)
PiggyList< std::atomic< block_t > > a_blocks
bool equal(const StorePair &a, const StorePair &b)
a horizontalBars(j=m=void 0===a.axisX.type?new c.AutoScaleAxis(c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX,{highLow:d, referenceValue:0})):a.axisX.type.call(c, c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX,{highLow:d, referenceValue:0})), l=n=void 0===a.axisY.type?new c.StepAxis(c.Axis.units.y, b.normalized.series, o,{ticks:k}):a.axisY.type.call(c, c.Axis.units.y, b.normalized.series, o, a.axisY)) var p