|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.uacalc.alg.op.Operations
public class Operations
This is a factory class with static methods to make Operations.
| Method Summary | |
|---|---|
static void |
binaryOpToCSV(java.lang.String desc,
Operation binop,
java.io.PrintStream out)
|
static boolean |
commutes(int[] map,
Operation op0,
Operation op1)
Test if map defines a homomorphism wrt these operations. |
static boolean |
commutes(Operation unaryOp,
Operation op)
This tests if an operation commutes with a unary operation. |
static boolean |
equalValues(Operation op0,
Operation op1)
Test if these have the same int values on the common sized set. |
static int[] |
findDifference(Operation op0,
Operation op1)
Find an argument where these operations differ. |
static boolean |
isAssociative(Operation op)
Test if an operation is binary and associative. |
static boolean |
isCommutative(Operation op)
Test if an operation is binary and commutative. |
static boolean |
isIdempotent(Operation op)
Test if an operation is idempotent. |
static boolean |
isTotal(Operation op)
|
static boolean |
isTotallySymmetric(Operation op)
Test if an operation is totally symmetric; that is, invariant under all permutation of the variables. |
static void |
main(java.lang.String[] args)
|
static Operation |
makeBinaryIntOperation(OperationSymbol symbol,
int algSize,
int[][] table)
|
static Operation |
makeCompositionOp(int n,
int pow)
|
static Operation |
makeConstantIntOperation(int algSize,
int elt)
|
static Operation |
makeConstantIntOperation(java.lang.String symbolPrefix,
int algSize,
int elt)
|
static Operation |
makeDerivedOperation(Operation op,
int[] reductionArray,
int newArity)
The operation derived by equating variables. |
static Operation |
makeIntOperation(Operation opx)
This makes a new operation that agrees with the original but is table based and so faster. |
static Operation |
makeIntOperation(OperationSymbol symbol,
int algSize,
int[] valueTable)
Construct an Operation from a valueTable. |
static Operation |
makeIntOperation(java.lang.String symbol,
int arity,
int algSize,
int[] valueTable)
Construct an Operation from a valueTable. |
static java.util.List<Operation> |
makeIntOperations(java.util.List<Operation> ops)
|
static java.util.List<Operation> |
makeJonssonOperationsFromNUF(Operation nuf)
Make the Jonsson terms from a near unanimity operation, omitting the two projections. |
static Operation |
makeLeftShift(int vecSize,
int rootSize)
The unary operation that cyclically shifts a vector left. |
static java.util.Map<OperationSymbol,Operation> |
makeMap(java.util.List<Operation> ops)
This makes a hash map from the operation symbols to the operations. |
static Operation |
makeMatrixDiagonalOp(int vecSize,
int rootSize)
|
static Operation |
makeOperationFromScript(OperationSymbol symbol,
int arity,
int algSize,
java.lang.String[] script)
The script should be the body of the definition
of intValueAt(int[] args). |
static Operation |
makeRandomOperation(int n,
OperationSymbol opSym)
Make an operation with the the given opeation symbol and set size. |
static Operation |
makeRandomOperation(int n,
OperationSymbol opSym,
java.util.Random random)
Make an operation with the the given opeation symbol and set size. |
static java.util.List<Operation> |
makeRandomOperations(int n,
SimilarityType simType)
Make a list of operations corresponding to a similarity type and a set size. |
static java.util.List<Operation> |
makeRandomOperations(int n,
SimilarityType simType,
long seed)
Make a list of operations corresponding to a similarity type and a set size. |
static int |
power(int base,
int pow)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean commutes(Operation unaryOp,
Operation op)
public static boolean commutes(int[] map,
Operation op0,
Operation op1)
map - an array defining the mapop0 - the first operationop1 - the second operation
public static boolean isTotal(Operation op)
public static final boolean isIdempotent(Operation op)
public static final boolean isCommutative(Operation op)
public static final boolean isTotallySymmetric(Operation op)
public static final boolean isAssociative(Operation op)
public static final int[] findDifference(Operation op0,
Operation op1)
op0 - op1 -
java.lang.IllegalArgumentException - if the arities or set sizes differ.public static java.util.Map<OperationSymbol,Operation> makeMap(java.util.List<Operation> ops)
public static boolean equalValues(Operation op0,
Operation op1)
public static Operation makeRandomOperation(int n,
OperationSymbol opSym)
n - the set sizeopSym - the operation symbol
public static Operation makeRandomOperation(int n,
OperationSymbol opSym,
java.util.Random random)
n - the set sizeopSym - the operation symbolrandom - a random number generator.
public static java.util.List<Operation> makeRandomOperations(int n,
SimilarityType simType)
n - the set sizesimType - the similarity type
public static java.util.List<Operation> makeRandomOperations(int n,
SimilarityType simType,
long seed)
n - the set sizesimType - the similarity typeseed - a random seed or -1
public static Operation makeDerivedOperation(Operation op,
int[] reductionArray,
int newArity)
reductionArray - an int array that can be viewed as a map
from the int less than the arity of op
into the arity of the derived operation.public static java.util.List<Operation> makeJonssonOperationsFromNUF(Operation nuf)
public static final int power(int base,
int pow)
public static Operation makeLeftShift(int vecSize,
int rootSize)
public static Operation makeMatrixDiagonalOp(int vecSize,
int rootSize)
public static Operation makeCompositionOp(int n,
int pow)
public static Operation makeOperationFromScript(OperationSymbol symbol,
int arity,
int algSize,
java.lang.String[] script)
throws javax.script.ScriptException
script should be the body of the definition
of intValueAt(int[] args).
javax.script.ScriptExceptionpublic static java.util.List<Operation> makeIntOperations(java.util.List<Operation> ops)
public static Operation makeIntOperation(Operation opx)
opx - the original operation
public static Operation makeIntOperation(java.lang.String symbol,
int arity,
int algSize,
int[] valueTable)
valueTable - a Horner encode table of the values of the operation.
public static Operation makeIntOperation(OperationSymbol symbol,
int algSize,
int[] valueTable)
valueTable - a Horner encode table of the values of the operation.
public static Operation makeBinaryIntOperation(OperationSymbol symbol,
int algSize,
int[][] table)
public static Operation makeConstantIntOperation(int algSize,
int elt)
public static Operation makeConstantIntOperation(java.lang.String symbolPrefix,
int algSize,
int elt)
public static void binaryOpToCSV(java.lang.String desc,
Operation binop,
java.io.PrintStream out)
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||