public class ParikhVector
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ParikhVector.Comparison
This enum represents the result of comparing two Parikh vectors.
|
| Constructor and Description |
|---|
ParikhVector(java.util.List<java.lang.String> sequence)
Creates a Parikh vector from a given sequence.
|
ParikhVector(java.util.Map<java.lang.String,java.lang.Integer> pv)
Creates a Parikh vector from a given mapping.
|
ParikhVector(java.lang.String... sequence)
Creates a Parikh vector from a given sequence.
|
| Modifier and Type | Method and Description |
|---|---|
ParikhVector |
add(java.util.List<java.lang.String> sequence)
Combines two Parikh vectors to one new.
|
ParikhVector |
add(ParikhVector p2)
Combines two Parikh vectors to one new.
|
ParikhVector |
add(java.lang.String... sequence)
Combines two Parikh vectors to one new.
|
ParikhVector.Comparison |
compare(ParikhVector pv2)
Compare this Parikh vector with the given Parikh vector.
|
boolean |
equals(java.lang.Object obj) |
int |
get(java.lang.String c)
Returns the occurrences of the given label in this Parikh vector.
|
java.util.Set<java.lang.String> |
getLabels()
Return the labels for which this Parikh vector contains a non-zero entry.
|
int |
hashCode() |
boolean |
isUncomparableTo(ParikhVector pv2)
Test if this Parikh vector is incomparable with the given Parikh vector.
|
boolean |
mutuallyDisjoint(ParikhVector pv2)
Check if two Parikh vectors are mutually disjoint.
|
ParikhVector |
residual(ParikhVector other)
Compute the residual of this Parikh vector with another Parikh vector.
|
boolean |
sameOrMutuallyDisjoint(ParikhVector pv2)
Checks two Parikh vectors if they are equal or mutually disjoint.
|
java.lang.String |
toString() |
ParikhVector |
tryRemove(java.lang.String event,
int n)
Create a new ParikhVector where the given event occurs n times less often.
|
public ParikhVector(java.lang.String... sequence)
sequence - the sequence of labels.public ParikhVector(java.util.List<java.lang.String> sequence)
sequence - the sequence of labels.public ParikhVector(java.util.Map<java.lang.String,java.lang.Integer> pv)
pv - the mapping from labels to occurrences.public ParikhVector add(ParikhVector p2)
p2 - - the second Parikh vector to add.public ParikhVector add(java.lang.String... sequence)
sequence - the sequence of labels that should be addedpublic ParikhVector add(java.util.List<java.lang.String> sequence)
sequence - the sequence of labels that should be addedpublic ParikhVector tryRemove(java.lang.String event, int n)
event - Which event should occur less often?n - How many times should it occur less?public ParikhVector residual(ParikhVector other)
t, the resulting Parikh vector will contain
texactly
max{ 0, this.get(t)-other.get(t) }
times. In other words, this computes the difference between the two Parikh vector, but subtraction saturates
at zero.other - The Parikh vector to subtract.public ParikhVector.Comparison compare(ParikhVector pv2)
pv2 - The Parikh vector to compare to.public boolean isUncomparableTo(ParikhVector pv2)
pv2 - The Parikh vector to compare to.public boolean sameOrMutuallyDisjoint(ParikhVector pv2)
pv2 - the Parikh vector to compare with.public boolean mutuallyDisjoint(ParikhVector pv2)
pv2 - the Parikh vector to compare with.public int get(java.lang.String c)
c - the label to get the occurrences from.public java.util.Set<java.lang.String> getLabels()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object