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, universe
CARDINALITY_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, updateSimilarityType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parent, resetConAndSub
cardinality, constantOperations, getDescription, getMonitor, getName, getOperation, getOperationsMap, inputSize, isIdempotent, isSimilarTo, isTotal, isUnary, iterator, monitoring, operations, setDescription, setMonitor, setName, similarityType, universe, updateSimilarityType
protected 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()
Algebra
makeOperationTables
in interface Algebra
makeOperationTables
in class GeneralAlgebra
Operation.makeTable
public java.util.List<SmallAlgebra> factors()
public java.util.List<SmallAlgebra> parents()
SmallAlgebra
parents
in interface SmallAlgebra
parents
in class GeneralAlgebra
parent
public SmallAlgebra projection(int k)
public BasicPartition projectionKernel(int k)
public CongruenceLattice con()
SmallAlgebra
con
in interface SmallAlgebra
con
in class GeneralAlgebra
public SubalgebraLattice sub()
SmallAlgebra
sub
in interface SmallAlgebra
sub
in class GeneralAlgebra
public int elementIndex(java.lang.Object obj)
SmallAlgebra
elementIndex
in interface SmallAlgebra
public java.lang.Object getElement(int index)
SmallAlgebra
getElement
in interface SmallAlgebra
public java.util.List getUniverseList()
SmallAlgebra
getUniverseList
in interface SmallAlgebra
public java.util.Map getUniverseOrder()
SmallAlgebra
getUniverseOrder
in interface SmallAlgebra
protected 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 ArrayList
s 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 Algebra
s being factors of the product.Set
of all tuples (ArrayList
s) 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()
SmallAlgebra
convertToDefaultValueOps
in interface SmallAlgebra
public SmallAlgebra.AlgebraType algebraType()
SmallAlgebra
algebraType
in interface SmallAlgebra
public static void main(java.lang.String[] args) throws java.io.IOException, BadAlgebraFileException
java.io.IOException
BadAlgebraFileException
Copyright 2003 Ralph Freese. All Rights Reserved.