EquivalenceClasses¶
Usage
use EquivalenceClasses;
Provides an abstraction used to efficiently compute equivalence classes. An equivalence class is a set where all elements of that set are equivalent to each other. The cmpType is used to determine the equivalence class associated with a keyType. For example, if the keyType is a hyperedge, the cmpType is the set of vertices that are incident in it. Each equivalence class has what is known as a candidate, which is an arbitrarily chosen leader for an equivalence class, making it easy to select which keyType to keep based on duplicate cmpType.
-
class
Equivalence¶ -
type
keyType¶
-
type
cmpType¶
-
var
eqclassesDom: domain(cmpType)¶
-
var
eqclasses: [eqclassesDom] keyType¶
-
var
candidatesDom: domain(keyType)¶
-
var
candidates: [candidatesDom] domain(keyType)¶
-
proc
init(type keyType)¶
-
proc
init(type keyType, type cmpType)
-
iter
getEquivalenceClasses(): keyType¶
-
iter
getEquivalenceClasses(param tag: iterKind): keyType
-
iter
getCandidates(key: keyType): keyType¶
-
iter
getCandidates(key: keyType, param tag: iterKind): keyType
-
proc
add(key: keyType)¶
-
proc
add(key: keyType, cmp: cmpType) Adds ‘key’ to an equivalence class, or making it the candidate if no current equivalence class exists.
-
proc
add(other: this.type) Adds another equivalence class to this one.
-
proc
reduction()¶
-
proc
readWriteThis(f)¶
-
type
-
class
ReduceEQClass: ReduceScanOp¶ -
type
keyType¶
-
type
cmpType¶
-
var
value: unmanaged keyTypeEquivalencecmpType¶
-
proc
init(eq: unmanaged ?keyTypeEquivalence?cmpType)¶
-
proc
init(type keyType, type cmpType)
-
proc
identity¶
-
proc
accumulate(x)¶
-
proc
accumulateOntoState(ref state, x)¶
-
proc
combine(x)¶
-
proc
generate()¶
-
proc
clone()¶
-
type
-
proc
main()¶