|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.latdraw.partition.IntArray
org.latdraw.partition.BasicPartition
public class BasicPartition
This class implement the basic operations for partition on the set {0, 1, ..., n-1}. A class that wants to implement partitions on an arbibtrary set can use this class internally. It can also be used as a wrapper for an array of int's in order to use the equals and hashCode methods.
It is based on my unpublished note: Partition Algorithms which can be obtained at http://www.math.hawaii.edu/~ralph/Notes/.
| Field Summary |
|---|
| Fields inherited from class org.latdraw.partition.IntArray |
|---|
array, size |
| Fields inherited from interface org.latdraw.partition.Partition |
|---|
BLOCK, EWK, HUMAN, INTERNAL, ONE_INDEXED |
| Constructor Summary | |
|---|---|
BasicPartition(int[] part)
|
|
BasicPartition(int[] part,
boolean oneIndexed)
|
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object o)
The order of a linear extension respecting rank. |
int[][] |
getBlocks()
Get the block form of this partition as an array of arrays. |
boolean |
isRelated(int i,
int j)
|
boolean |
isRepresentative(int i)
|
boolean |
isZero()
|
Partition |
join(Partition part2)
* Note r and s must be roots and distinct. |
void |
joinBlocks(int r,
int s)
Note r and s must be roots and distinct. |
static boolean |
leq(int[] u,
int[] v)
|
boolean |
leq(Partition part2)
|
static void |
main(java.lang.String[] args)
|
Partition |
meet(Partition part2)
|
void |
normalize()
This modifies this.array. |
static void |
normalize(int[] part)
Modify part so that it is in normal form. |
int |
numberOfBlocks()
Does not need normalized form. |
static BasicPartition |
one(int asize)
|
static BasicPartition |
one(int asize,
boolean oneIndexed)
|
static java.lang.String |
partToKissString(int[] part)
Make String representation of the partition for the .con and related files. |
static int |
permutabilityLevel(int a,
int b,
Partition par0,
Partition par1)
This returns the least k such that (a,b)
is in the k-fold relational product of par0
and par1, with par0 coming first and
k counting the total occurances of par0
or par1. |
static int |
permutabilityLevel(Partition par0,
Partition par1)
This is the max of permutabilityLevel(a, b, par0, par1)
over all (a, b) in the join. |
int |
rank()
|
int |
representative(int i)
This is the public way of finding the root. |
int[] |
representatives()
|
java.lang.String |
toString()
|
java.lang.String |
toString(int kind)
|
static BasicPartition |
zero(int asize)
|
static BasicPartition |
zero(int asize,
boolean oneIndexed)
|
| Methods inherited from class org.latdraw.partition.IntArray |
|---|
clone, equalIntArrays, equals, get, getArray, hashCode, intArrayToString, set, setIntArray, size, toArray |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.latdraw.partition.Partition |
|---|
size, toArray |
| Constructor Detail |
|---|
public BasicPartition(int[] part)
public BasicPartition(int[] part,
boolean oneIndexed)
| Method Detail |
|---|
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic static BasicPartition zero(int asize)
public static BasicPartition zero(int asize,
boolean oneIndexed)
public static BasicPartition one(int asize)
public static BasicPartition one(int asize,
boolean oneIndexed)
public boolean isRelated(int i,
int j)
isRelated in interface Partitionpublic int numberOfBlocks()
numberOfBlocks in interface Partitionpublic int rank()
public void joinBlocks(int r,
int s)
public Partition join(Partition part2)
Partition
join in interface Partition
public static int permutabilityLevel(int a,
int b,
Partition par0,
Partition par1)
k such that (a,b)
is in the k-fold relational product of par0
and par1, with par0 coming first and
k counting the total occurances of par0
or par1. It returns -1 if (a,b)
is not in the join.
public static int permutabilityLevel(Partition par0,
Partition par1)
permutabilityLevel(a, b, par0, par1)
over all (a, b) in the join.
public Partition meet(Partition part2)
meet in interface Partitionpublic boolean leq(Partition part2)
leq in interface Partition
public static boolean leq(int[] u,
int[] v)
public void normalize()
normalize in interface Partitionpublic static void normalize(int[] part)
part so that it is in normal form.
public boolean isZero()
isZero in interface Partitionpublic java.lang.String toString()
toString in class IntArraypublic java.lang.String toString(int kind)
toString in interface Partitionpublic static java.lang.String partToKissString(int[] part)
public int[][] getBlocks()
getBlocks in interface Partitionpublic int representative(int i)
root
it does not modify array.
representative in interface Partitionpublic boolean isRepresentative(int i)
isRepresentative in interface Partitionpublic int[] representatives()
representatives in interface Partitionpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||