public final class Index extends AIndex
| Modifier and Type | Field and Description |
|---|---|
int[] |
data |
| Constructor and Description |
|---|
Index(int length) |
| Modifier and Type | Method and Description |
|---|---|
Index |
clone() |
Index |
compose(AIndex a) |
Index |
compose(Index a) |
boolean |
equals(Index o) |
boolean |
equals(Object o) |
int |
find(int value)
Finds a value in this Index and return's it's position, or -1 if not found
|
int |
get(int i)
Gets the index value at position i
|
int[] |
getData() |
int |
indexPosition(int i)
Looks up an index value in the index, returning its position or -1 if not found
Index must be both sorted and distinct.
|
Index |
invert()
Inverts the permutation represented by this Index
|
boolean |
isDistinctSorted()
Returns true if this index is distinct and sorted (in strictly increasing order)
|
boolean |
isEvenPermutation() |
boolean |
isFullyMutable() |
boolean |
isOddPermutation() |
boolean |
isPermutation()
Returns true if this index represents a permutation of positions 0..length-1
|
int |
length()
Returns the length of this index list
|
void |
lookupWith(Index source) |
static Index |
of(int... indexes)
Creates a new Index, using the specified index values
|
void |
permute(Index permutationIndex)
Permutes this vector according to a given permutation index
|
void |
reverse()
Reverses an index
|
int |
seekPosition(int i)
Finds the position a value would take assuming a sorted index.
|
void |
set(int i,
int value) |
void |
sort()
Sorts the Index (in-place)
|
void |
swap(int i,
int j)
Swaps (in-place) the indexes at two positions
|
int |
swapCount()
Counts the number of swaps required to create this permutation
|
int[] |
toArray() |
static Index |
wrap(int[] indexes)
Creates a new Index, wrapping the provided index array
|
public void swap(int i,
int j)
public boolean isDistinctSorted()
AIndexisDistinctSorted in class AIndexpublic boolean isPermutation()
AIndexisPermutation in class AIndexpublic int swapCount()
public boolean isOddPermutation()
public boolean isEvenPermutation()
public static Index wrap(int[] indexes)
public static Index of(int... indexes)
public int get(int i)
AIndexpublic int length()
AIndexpublic void permute(Index permutationIndex)
permutationIndex - public boolean equals(Index o)
public int[] getData()
public boolean isFullyMutable()
isFullyMutable in class AIndexpublic void lookupWith(Index source)
public int indexPosition(int i)
i - public int seekPosition(int i)
i - The position of the value - will point to either the value or the next higher value presentpublic int find(int value)
value - public Index invert()
Copyright © 2013. All Rights Reserved.