public class ProductAlgebra extends GeneralAlgebra implements SmallAlgebra
SmallAlgebra.AlgebraType| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<SmallAlgebra> |
algebras |
protected int |
numberOfProducts |
protected int[] |
sizes |
con, description, monitor, name, operationsMap, similarityType, size, sub, universeCARDINALITY_COUNTABLE, CARDINALITY_COUNTABLY_INFINITE, CARDINALITY_FINITE, CARDINALITY_INFINITE, CARDINALITY_UNKNOWN| Modifier | Constructor and Description |
|---|---|
protected |
ProductAlgebra() |
|
ProductAlgebra(java.util.List<SmallAlgebra> algs) |
protected |
ProductAlgebra(java.lang.String name) |
|
ProductAlgebra(java.lang.String name,
java.util.List<SmallAlgebra> algs)
Construct the direct product of a List of SmallAlgebra's.
|
| Modifier and Type | Method and Description |
|---|---|
SmallAlgebra.AlgebraType |
algebraType()
The type of algebra this is, like a quotient algebra.
|
static int |
calcCard(int[] sizes)
Returns the product cardinality if it is an int; otherwise
it returns -1.
|
CongruenceLattice |
con()
The congurence lattice.
|
void |
convertToDefaultValueOps()
This is used in the UI.
|
int |
elementIndex(java.lang.Object obj)
This method will return k if elem
is the kth element; otherwise -1.
|
java.util.List<SmallAlgebra> |
factors() |
java.lang.Object |
getElement(int index)
returns the kth element.
|
java.util.List |
getUniverseList()
The universe as a List such getElement(k) will equal the kth
element of the List.
|
java.util.Map |
getUniverseOrder()
A map that can be used for elementIndex(a).
|
static void |
main(java.lang.String[] args) |
protected java.util.Set |
makeCartesianProduct(java.util.List algs)
Returns the carrier set of the product of the specified
List algs of Objects as a Set. |
protected void |
makeOperations() |
void |
makeOperationTables()
Make operation tables to speed up the evaluation of operations at
the cost using more space.
|
java.util.List<SmallAlgebra> |
parents()
For a ProductAlgebra this will be the factors.
|
SmallAlgebra |
projection(int k) |
BasicPartition |
projectionKernel(int k) |
Subalgebra |
Sg(java.util.List<IntArray> elems)
The subalgebra generated by elems given as arrays of int's.
|
java.util.List |
sgClose(java.util.List elems) |
SubalgebraLattice |
sub()
The subalgebra lattice.
|
cardinality, constantOperations, getDescription, getMonitor, getName, getOperation, getOperationsMap, inputSize, isIdempotent, isSimilarTo, isTotal, isUnary, iterator, monitoring, operations, parent, resetConAndSub, setDescription, setMonitor, setName, setOperations, setUniverse, similarityType, universe, updateSimilarityTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitparent, resetConAndSubcardinality, constantOperations, getDescription, getMonitor, getName, getOperation, getOperationsMap, inputSize, isIdempotent, isSimilarTo, isTotal, isUnary, iterator, monitoring, operations, setDescription, setMonitor, setName, similarityType, universe, updateSimilarityTypeprotected java.util.List<SmallAlgebra> algebras
protected int[] sizes
protected int numberOfProducts
protected ProductAlgebra()
protected ProductAlgebra(java.lang.String name)
public ProductAlgebra(java.util.List<SmallAlgebra> algs)
public ProductAlgebra(java.lang.String name,
java.util.List<SmallAlgebra> algs)
protected void makeOperations()
public void makeOperationTables()
AlgebramakeOperationTables in interface AlgebramakeOperationTables in class GeneralAlgebraOperation.makeTablepublic java.util.List<SmallAlgebra> factors()
public java.util.List<SmallAlgebra> parents()
SmallAlgebraparents in interface SmallAlgebraparents in class GeneralAlgebraparentpublic SmallAlgebra projection(int k)
public BasicPartition projectionKernel(int k)
public CongruenceLattice con()
SmallAlgebracon in interface SmallAlgebracon in class GeneralAlgebrapublic SubalgebraLattice sub()
SmallAlgebrasub in interface SmallAlgebrasub in class GeneralAlgebrapublic int elementIndex(java.lang.Object obj)
SmallAlgebraelementIndex in interface SmallAlgebrapublic java.lang.Object getElement(int index)
SmallAlgebragetElement in interface SmallAlgebrapublic java.util.List getUniverseList()
SmallAlgebragetUniverseList in interface SmallAlgebrapublic java.util.Map getUniverseOrder()
SmallAlgebragetUniverseOrder in interface SmallAlgebraprotected java.util.Set makeCartesianProduct(java.util.List algs)
List algs of Objects as a Set.
This set does not support to be modified in any way (by adding or deleting or otherwise modifying its members).
This applies in particular to the elements returned by the iterator().
Modifying them does not have any effect on the elements in the set, as they are not stored explicitly.
For the size of the set, see the calcCard(int[]) method.
The contains method returns true iff applied to a List of objects that are successively
contained in the algebras in algs.
The iterator() returns the tuples in the product as ArrayLists in lexicographic order (reading words from left to right).
This means the right-most (last, largest) index is incremented fastest.
The order of the algebras in the given List algs determines the order of the entries in the tuples.
This iterator supports only forward iteration and has got no remove method.
Furthermore, there is no possibility to change the elements in the Set by modifying the tuples returned by the iterator.
Putting this differently, the iterator only provides the "enumeration functionality", but not the complete "element access functionality".
It is possible to iterate past the end of the set, i.e., after hasNext has returned false.
In this case the iterator starts again with the first tuple.
algs - List of Algebras being factors of the product.Set of all tuples (ArrayLists) in the product.java.lang.UnsupportedOperationException - if the iterator() is used and one of the objects in the List algs is not an Algebra.java.lang.UnsupportedOperationException - if the Set is modified by one of the methods add, addAll, clear, remove, removeAll, retainAll.public Subalgebra Sg(java.util.List<IntArray> elems)
public java.util.List sgClose(java.util.List elems)
public static int calcCard(int[] sizes)
sizes - public void convertToDefaultValueOps()
SmallAlgebraconvertToDefaultValueOps in interface SmallAlgebrapublic SmallAlgebra.AlgebraType algebraType()
SmallAlgebraalgebraType in interface SmallAlgebrapublic static void main(java.lang.String[] args)
throws java.io.IOException,
BadAlgebraFileException
java.io.IOExceptionBadAlgebraFileExceptionCopyright 2003 Ralph Freese. All Rights Reserved.