|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object DPJRuntime.DPJUtils
public class DPJUtils
This class provides various utility methods for DPJ.
Constructor Summary | |
---|---|
DPJUtils()
|
Method Summary | ||
---|---|---|
static int |
log2(int x)
Quickly computes the floor of the base 2 log of x . |
|
static
|
permute(T[]<R> A)
Randomly permutes array A |
|
static
|
permuteInt(int[]<R> A)
Randomly permutes integer array A |
|
static
|
swap(T[]<R> A,
int i,
int j)
Swaps the values at indices i and j
of array A . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DPJUtils() [unknown]
Method Detail |
---|
public static int log2(int x) pure
x
.
x
- Input
x
public static <type T,region R> void swap(T[]<R> A, int i, int j) writes R
i
and j
of array A
.
T
- Element type of array A
R
- Region of array A
i
- First index of values to swapj
- Second index of values to swappublic static <type T,region R> void permute(T[]<R> A) writes Root : *
A
T
- Element type of array A
R
- Region of array A
A
- Array to permutepublic static <region R> void permuteInt(int[]<R> A) writes Root : *
A
R
- Region of array A
A
- Integer array to permute
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |