spot
1.2.1a
|
this class propose an union find based on a deadstore. The idea is to used a dedicated map for the storage of dead state but this storage is done in a lazy way. A counter maintain the realsize of the union find structure when a make dead is realized : this is possible with the assumption that make dead is performed on the dfs root of the SCC. So the structure maintain the real size of the structure which is the size of Alive states. Adding a new state only checks if this size is the size of the structure to avoid extra memory allocation. If it is not true this means that there are dead states insides the alive structure. Just pick one a insert it inside the dead store. Otherwise it's a classic insert. More...
#include <fasttgbaalgos/ec/union_find.hh>
Public Types | |
enum | color { Alive, Dead, Unknown } |
The color for a new State. More... | |
Public Member Functions | |
setOfDisjointSetsIPC_LRPC_MS_Dead (acc_dict &acc) | |
virtual bool | add (const fasttgba_state *e) |
Add a partition that contains only s Suppose a clone() has been done and the union-find is in charge to perform the destroy() More... | |
virtual unsigned int | size () |
The current size of the union find. More... | |
virtual unsigned int | dead_size () |
virtual void | unite (const fasttgba_state *e1, const fasttgba_state *e2) |
Perform the union of the two partition containing left and right. No assumptions over the resulting parent can be do. More... | |
virtual void | make_dead (const fasttgba_state *e) |
perform a union with dead More... | |
virtual bool | contains (const fasttgba_state *e) |
Return wether a state belong to the Union-Find structure. More... | |
virtual bool | same_partition (const fasttgba_state *e1, const fasttgba_state *e2) |
Return true if the partition of left is the same that the partition of right. More... | |
virtual bool | is_dead (const fasttgba_state *e) |
check wether the root of the set containing this scc is dead. More... | |
int | nbPart () const |
int | maxDepth () const |
int | maxPart () const |
void | clear () |
virtual void | add_acc (const fasttgba_state *, markset) |
Add the acceptance set to the partition that contains the state s. More... | |
virtual markset | get_acc (const fasttgba_state *) |
return the acceptance set of the partition containing s More... | |
virtual color | get_color (const fasttgba_state *) |
virtual int | max_alive () |
virtual int | max_dead () |
Protected Types | |
typedef Sgi::hash_map< const fasttgba_state *, int, fasttgba_state_ptr_hash, fasttgba_state_ptr_equal > | uf_map |
Protected Attributes | |
std::vector< int > | idneg |
For each element store the id of the parent. More... | |
std::vector< markset * > | accp |
Acceptance associated to each element. More... | |
acc_dict & | acc_ |
The acceptance dictionary. More... | |
markset | empty |
Avoid to re-create some elements. More... | |
this class propose an union find based on a deadstore. The idea is to used a dedicated map for the storage of dead state but this storage is done in a lazy way. A counter maintain the realsize of the union find structure when a make dead is realized : this is possible with the assumption that make dead is performed on the dfs root of the SCC. So the structure maintain the real size of the structure which is the size of Alive states. Adding a new state only checks if this size is the size of the structure to avoid extra memory allocation. If it is not true this means that there are dead states insides the alive structure. Just pick one a insert it inside the dead store. Otherwise it's a classic insert.
Note that this class doesn't support contains since get_color is the most efficient way to check wheter a state is available
|
inherited |
The color for a new State.
|
virtual |
Add a partition that contains only s Suppose a clone() has been done and the union-find is in charge to perform the destroy()
Reimplemented from spot::union_find.
|
virtual |
Add the acceptance set to the partition that contains the state s.
Reimplemented from spot::union_find.
|
virtual |
Return wether a state belong to the Union-Find structure.
Reimplemented from spot::union_find.
|
virtual |
return the acceptance set of the partition containing s
Reimplemented from spot::union_find.
|
virtual |
check wether the root of the set containing this scc is dead.
Reimplemented from spot::union_find.
|
virtual |
perform a union with dead
Reimplemented from spot::union_find.
|
virtual |
The size of alive elements i-e elements stored in the union find.
Reimplemented from spot::union_find.
|
virtual |
The size of dead elements i-e elements stored outside the union find
Reimplemented from spot::union_find.
|
virtual |
Return true if the partition of left is the same that the partition of right.
Reimplemented from spot::union_find.
|
virtual |
The current size of the union find.
Reimplemented from spot::union_find.
|
virtual |
Perform the union of the two partition containing left and right. No assumptions over the resulting parent can be do.
Reimplemented from spot::union_find.
|
protectedinherited |
The acceptance dictionary.
|
protectedinherited |
Acceptance associated to each element.
|
protectedinherited |
Avoid to re-create some elements.
|
protectedinherited |
For each element store the id of the parent.