|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.uacalc.util.IntArray
org.uacalc.alg.conlat.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.uacalc.util.IntArray |
|---|
array, size |
| Fields inherited from interface org.uacalc.alg.conlat.Partition |
|---|
BLOCK, EWK, HUMAN, INTERNAL |
| Constructor Summary | |
|---|---|
BasicPartition(int[] part)
|
|
| Method Summary | |
|---|---|
static java.util.NavigableSet<IntArray> |
binaryClone(java.util.List<Partition> pars)
|
static java.util.NavigableSet<IntArray> |
binaryClone(java.util.List<Partition> pars,
java.util.NavigableSet<IntArray> unaryClone)
|
static SmallAlgebra |
binaryCloneAlgebra(java.util.List<Partition> pars)
|
int |
blockIndex(int i)
The index of the block containing i. |
static java.util.List<Partition> |
closureAt(java.util.List<BasicPartition> pars)
|
int |
compareTo(java.lang.Object o)
The order of a linear extension respecting rank. |
static Partition |
directProduct(Partition alpha,
Partition beta)
|
int[][] |
getBlocks()
Get the block form of this partition as an array of arrays. |
java.util.NavigableSet<IntArray> |
getPairs()
|
static boolean |
isHereditary(java.util.List<Partition> pars)
True if all 0-1 sublattices of the closure of the sublattice generated by pars are themselves closed. |
boolean |
isRelated(int i,
int j)
|
boolean |
isRepresentative(int i)
|
boolean |
isZero()
|
java.util.Iterator<IntArray> |
iterator()
|
Partition |
join(Partition part2)
|
void |
joinBlocks(int r,
int s)
Note r and s must be roots and distinct. |
static java.util.List<Partition> |
joinClosure(java.util.List<Partition> pars)
|
static boolean |
leq(int[] u,
int[] v)
|
boolean |
leq(Partition part2)
|
static void |
main(java.lang.String[] args)
|
Partition |
meet(Partition part2)
|
static java.util.List<Partition> |
meetClosure(java.util.List<Partition> pars)
|
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 Partition |
partitionFromMatrix(int[][] matrix)
If matrix has r rows and s columns whose entries lie in the set 0, ..., rs - 1, this returns a partition essentially on the product of {0,...,r-1} and {0,...,s-1} such that (x,y) is related to (u,v) if the (x,y) entry of the matrix equals to (u,v) entry. |
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. |
Partition |
projection(java.util.List<IntArray> universe,
int size,
int coord)
|
int |
rank()
|
int |
representative(int i)
This is the public way of finding the root. |
int[] |
representatives()
|
static java.util.List<Partition> |
subUniverseGenerated(java.util.List<Partition> gens)
|
java.lang.String |
toString()
|
java.lang.String |
toString(int kind)
|
static java.util.NavigableSet<IntArray> |
unaryClone(java.util.List<Partition> pars)
The uses a depth first search to find the set of all unary function which respect all partition in pars. |
static SmallAlgebra |
unaryCloneAlgebra(java.util.List<Partition> pars)
|
static BasicPartition |
zero(int asize)
|
| Methods inherited from class org.uacalc.util.IntArray |
|---|
clone, equalIntArrays, equals, get, getArray, hashCode, intArrayToString, isIdempotent, lexicographicComparitor, satisfiesConstraint, satisfiesConstraint, set, setIntArray, toArray, universeSize |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.uacalc.alg.conlat.Partition |
|---|
toArray, universeSize |
| Constructor Detail |
|---|
public BasicPartition(int[] part)
| Method Detail |
|---|
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic static BasicPartition zero(int asize)
public static BasicPartition one(int asize)
public boolean isRelated(int i,
int j)
isRelated in interface BinaryRelationisRelated in interface Partitionpublic java.util.Iterator<IntArray> iterator()
iterator in interface java.lang.Iterable<IntArray>public java.util.NavigableSet<IntArray> getPairs()
getPairs in interface BinaryRelationpublic int numberOfBlocks()
numberOfBlocks in interface Partitionpublic int rank()
public void joinBlocks(int r,
int s)
joinBlocks in interface Partitionpublic Partition join(Partition part2)
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 int blockIndex(int i)
blockIndex in interface Partition
public static Partition directProduct(Partition alpha,
Partition beta)
public static boolean isHereditary(java.util.List<Partition> pars)
pars -
public static SmallAlgebra unaryCloneAlgebra(java.util.List<Partition> pars)
public static SmallAlgebra binaryCloneAlgebra(java.util.List<Partition> pars)
public static java.util.NavigableSet<IntArray> unaryClone(java.util.List<Partition> pars)
pars -
public static java.util.NavigableSet<IntArray> binaryClone(java.util.List<Partition> pars)
public static java.util.NavigableSet<IntArray> binaryClone(java.util.List<Partition> pars,
java.util.NavigableSet<IntArray> unaryClone)
public static java.util.List<Partition> closureAt(java.util.List<BasicPartition> pars)
pars -
public Partition projection(java.util.List<IntArray> universe,
int size,
int coord)
public static java.util.List<Partition> joinClosure(java.util.List<Partition> pars)
public static java.util.List<Partition> meetClosure(java.util.List<Partition> pars)
public static java.util.List<Partition> subUniverseGenerated(java.util.List<Partition> gens)
public static Partition partitionFromMatrix(int[][] matrix)
matrix -
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||