public class BasicPartition extends IntArray implements Partition, java.lang.Comparable
It is based on my unpublished note: Partition Algorithms which can be obtained at http://www.math.hawaii.edu/~ralph/Notes/.
Partition.PrintType| Constructor and Description | 
|---|
BasicPartition(int[] part)  | 
BasicPartition(java.lang.String str)  | 
BasicPartition(java.lang.String str,
              int length)
If length is nonnegative, this converts str into a 
 partition on 0 to length - 1, ignoring any any interger
 in str greater than length - 1. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
static java.util.NavigableSet<IntArray> | 
binaryPolymorphisms(java.util.List<Partition> pars)  | 
static java.util.NavigableSet<IntArray> | 
binaryPolymorphisms(java.util.List<Partition> pars,
                   java.util.NavigableSet<IntArray> unaryClone,
                   ProgressReport report)  | 
static SmallAlgebra | 
binaryPolymorphismsAlgebra(java.util.List<Partition> pars,
                          ProgressReport report)  | 
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. 
 | 
BinaryRelation | 
compose(BinaryRelation beta)
The relational composition. 
 | 
static Partition | 
directProduct(Partition alpha,
             Partition beta)  | 
static Partition | 
firstProjection(int n)  | 
static java.util.Map<IntArray,java.util.List<Partition>> | 
funcToJIs(int n)  | 
static java.util.List<Partition> | 
generalizedWeakClosure(java.util.List<BasicPartition> pars,
                      int pow,
                      java.util.Map<IntArray,Partition> rels)  | 
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 | 
isInitialLexRepresentative()
This will be true if, when the separators of the blocks are
 removed, it is just 0 to n-1 in order; also the sizes of
 the blocks are getting smaller, left to right. 
 | 
boolean | 
isRelated(int i,
         int j)  | 
boolean | 
isRepresentative(int i)  | 
boolean | 
isZero()  | 
java.util.Iterator<IntArray> | 
iterator()  | 
static BasicPartition | 
jbToPartition(int[] a)
Takes a partition in JB form and return
 the corresponding Partition. 
 | 
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 java.util.List<Partition> | 
joinClosure(java.util.List<Partition> pars,
           java.util.Map<Partition,Term> termMap)  | 
static java.util.List<Partition> | 
joinClosure(java.util.List<Partition> pars,
           java.util.Map<Partition,Term> termMap,
           Partition projkernel)
This is the join closure except that it will stop if
 it finds a new element above projkernel. 
 | 
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)  | 
static java.util.List<Partition> | 
meetClosure(java.util.List<Partition> pars,
           java.util.Map<Partition,Term> termMap)  | 
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 Partition | 
secondProjection(int n)  | 
static int[] | 
stringToPartition(java.lang.String str,
                 int length)  | 
static java.util.List<Partition> | 
subUniverseGenerated(java.util.List<Partition> gens)  | 
static java.util.List<Partition> | 
subUniverseGenerated(java.util.List<Partition> gens,
                    java.util.Map<Partition,Term> termMap)  | 
static java.util.List<Partition> | 
subUniverseGenerated(java.util.List<Partition> gens,
                    java.util.Map<Partition,Term> termMap,
                    Partition projkernel)  | 
static void | 
testGeneralizedWeakClosure()  | 
java.lang.String | 
toString()  | 
java.lang.String | 
toString(int maxLen)  | 
java.lang.String | 
toString(Partition.PrintType kind)  | 
java.lang.String | 
toString(Partition.PrintType kind,
        int maxLen)  | 
static java.util.NavigableSet<IntArray> | 
unaryPolymorphisms(java.util.List<? extends Partition> pars,
                  ProgressReport report)
The uses a depth first search to find the set of all unary function
 which respect all partition in pars. 
 | 
static SmallAlgebra | 
unaryPolymorphismsAlgebra(java.util.List<? extends Partition> pars)  | 
static SmallAlgebra | 
unaryPolymorphismsAlgebra(java.util.List<? extends Partition> pars,
                         ProgressReport report)  | 
static BasicPartition | 
zero(int asize)  | 
clone, equalIntArrays, equals, get, getArray, hashCode, intArrayToString, isConstant, isIdempotent, lexicographicComparitor, satisfiesBlocksConstraint, satisfiesCongruenceConstraint, satisfiesSetConstraint, satisfiesValuesConstraint, set, setIntArray, stringToArray, toArray, universeSizefinalize, getClass, notify, notifyAll, wait, wait, waittoArray, universeSizepublic BasicPartition(int[] part)
public BasicPartition(java.lang.String str)
public BasicPartition(java.lang.String str,
                      int length)
str - length - public static int[] stringToPartition(java.lang.String str,
                                      int length)
public BinaryRelation compose(BinaryRelation beta)
compose in interface BinaryRelationpublic 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 static BasicPartition jbToPartition(int[] a)
a - public int rank()
public void joinBlocks(int r,
                       int s)
joinBlocks in interface Partitionpublic 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 static boolean leq(int[] u,
                          int[] v)
public void normalize()
public static void normalize(int[] part)
part so that it is in normal form.public java.lang.String toString(Partition.PrintType kind)
public java.lang.String toString(Partition.PrintType kind, int maxLen)
public static java.lang.String partToKissString(int[] part)
public int[][] getBlocks()
public 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 Partitionpublic static boolean isHereditary(java.util.List<Partition> pars)
pars - public static SmallAlgebra unaryPolymorphismsAlgebra(java.util.List<? extends Partition> pars)
public static SmallAlgebra unaryPolymorphismsAlgebra(java.util.List<? extends Partition> pars, ProgressReport report)
public static SmallAlgebra binaryPolymorphismsAlgebra(java.util.List<Partition> pars, ProgressReport report)
public static java.util.NavigableSet<IntArray> unaryPolymorphisms(java.util.List<? extends Partition> pars, ProgressReport report)
pars - public static java.util.NavigableSet<IntArray> binaryPolymorphisms(java.util.List<Partition> pars)
public static java.util.NavigableSet<IntArray> binaryPolymorphisms(java.util.List<Partition> pars, java.util.NavigableSet<IntArray> unaryClone, ProgressReport report)
public static java.util.List<Partition> generalizedWeakClosure(java.util.List<BasicPartition> pars, int pow, java.util.Map<IntArray,Partition> rels)
public static void testGeneralizedWeakClosure()
public static java.util.List<Partition> closureAt(java.util.List<BasicPartition> pars)
pars - public static java.util.List<Partition> joinClosure(java.util.List<Partition> pars, java.util.Map<Partition,Term> termMap)
public static java.util.List<Partition> joinClosure(java.util.List<Partition> pars, java.util.Map<Partition,Term> termMap, Partition projkernel)
pars - termMap - projkernel - public static java.util.List<Partition> meetClosure(java.util.List<Partition> pars, java.util.Map<Partition,Term> termMap)
public static java.util.List<Partition> subUniverseGenerated(java.util.List<Partition> gens)
public static java.util.List<Partition> subUniverseGenerated(java.util.List<Partition> gens, java.util.Map<Partition,Term> termMap)
public static java.util.List<Partition> subUniverseGenerated(java.util.List<Partition> gens, java.util.Map<Partition,Term> termMap, Partition projkernel)
public static Partition partitionFromMatrix(int[][] matrix)
matrix - public static Partition firstProjection(int n)
public static Partition secondProjection(int n)
public boolean isInitialLexRepresentative()
isInitialLexRepresentative in interface Partitionpublic static void main(java.lang.String[] args)
Copyright 2003 Ralph Freese. All Rights Reserved.