public abstract class AbstractOperation extends java.lang.Object implements Operation
Operation
.
valueAt
is abstract so must be overwritten.Modifier and Type | Field and Description |
---|---|
protected int |
algSize |
protected OperationSymbol |
symbol |
protected int[] |
valueTable |
Constructor and Description |
---|
AbstractOperation(OperationSymbol symbol,
int algSize) |
AbstractOperation(java.lang.String name,
int arity,
int algSize) |
Modifier and Type | Method and Description |
---|---|
int |
arity()
This gives the arity of this operation.
|
int |
compareTo(Operation op) |
int |
getSetSize()
This gives the size of the set upon which the operation acts.
|
int[] |
getTable()
Get the table for this operation or null if it does not exist.
|
int[] |
getTable(boolean makeTable)
Get the table for this operation.
|
int |
intValueAt(int arg)
This (optional) operation is for fast access to the table,
if it exits.
|
int |
intValueAt(int[] args)
This (optional) operation is the int version.
|
boolean |
isAssociative()
Test if this operation is binary and associative.
|
boolean |
isCommutative()
Test if this operation is binary and commutative.
|
boolean |
isIdempotent()
Is this operation idempotent in the sense f(x,x,..,x) = x.
|
boolean |
isMaltsev()
Check if a ternary operation is a Maltsev operation.
|
boolean |
isTableBased() |
boolean |
isTotal()
Only OperationWithDefaultValue's can fail this.
|
boolean |
isTotallySymmetric()
Test if this operation is totally symmetric; that is, invariant
under all permutation of the variables.
|
void |
makeTable()
This will make a table and so make the operation faster but
requires more space.
|
OperationSymbol |
symbol()
The operation symbol for this operation.
|
int[] |
valueAt(int[][] args)
This operation is for fast product operation.
|
abstract java.lang.Object |
valueAt(java.util.List args)
This operation is the element version.
|
protected OperationSymbol symbol
protected int algSize
protected int[] valueTable
public AbstractOperation(java.lang.String name, int arity, int algSize)
public AbstractOperation(OperationSymbol symbol, int algSize)
public int arity()
public int getSetSize()
getSetSize
in interface Operation
public OperationSymbol symbol()
Operation
public abstract java.lang.Object valueAt(java.util.List args)
Operation
public int[] valueAt(int[][] args)
Operation
public int intValueAt(int[] args)
Operation
intValueAt
in interface Operation
public int intValueAt(int arg)
Operation
intValueAt
in interface Operation
arg
- the Horner encoding of the actual args.public boolean isTableBased()
isTableBased
in interface Operation
public boolean isIdempotent()
isIdempotent
in interface Operation
public boolean isTotal()
Operation
public boolean isTotallySymmetric()
isTotallySymmetric
in interface Operation
public boolean isAssociative()
isAssociative
in interface Operation
public boolean isCommutative()
isCommutative
in interface Operation
public boolean isMaltsev()
public void makeTable()
Operation
public int[] getTable()
Operation
public int[] getTable(boolean makeTable)
Operation
Copyright 2003 Ralph Freese. All Rights Reserved.