public class TernaryPermutationFunction extends Object implements PermutationFunction<TernaryVector>, Serializable
TernaryVector
instances.
This class precomputes the permutations as necessary and only requires O(k)
time to compute a single permutation, where k
is the number of
non-zero elements in the TernaryVector
.Constructor and Description |
---|
TernaryPermutationFunction()
Creates an empty
DefaultPermutationFunction . |
Modifier and Type | Method and Description |
---|---|
TernaryVector |
permute(TernaryVector v,
int numPermutations)
An optimized instance of permute for TernaryVectors.
|
String |
toString()
Returns the name of this class
|
public TernaryPermutationFunction()
DefaultPermutationFunction
.public TernaryVector permute(TernaryVector v, int numPermutations)
TernaryVector
is returned.permute
in interface PermutationFunction<TernaryVector>
v
- an index vector to permutenumPermutations
- the number of times the permutation function
should be applied to the provided index vector.Copyright © 2012. All Rights Reserved.