public final class Array extends Object
we used to have all the loops unrolled here, but it turns out that the latest JVMs (1.4.2_02 and above) do a much better job.
| Constructor and Description |
|---|
Array() |
| Modifier and Type | Method and Description |
|---|---|
static boolean[] |
clone(boolean[] old) |
static int[] |
clone(int[] old)
cone an array of integers and its members
|
static void |
copy(int[] from,
int[] to,
int len,
int from_offset,
int to_offset)
a fast (?) function for copying chunks of an array to another (possibly same) array.
|
static int |
count(boolean[] x,
boolean val)
count the number of times val is seen in the array x
|
static int |
count(int[] x,
int val)
count the number of times val is seen in the array x
|
static void |
disturb(int[] x,
int len)
disturb the current order, but not a full shuffle (to save time)
|
static boolean |
equals(boolean[] v1,
boolean[] v2,
int len)
compare to vectors
|
static boolean |
equals(byte[] v1,
byte[] v2,
int len)
compare to vectors
|
static boolean |
equals(int[] v1,
int[] v2,
int len)
compare to vectors
|
static boolean |
equals(short[] v1,
short[] v2,
int len)
compare to vectors
|
static void |
internal_test()
testbench.
|
static int[] |
permutation(int size)
create a permutation from {0, ...
|
static int[] |
resize(int[] old,
int old_size,
int new_size)
this is an implementation of realloc() for integers.
|
static short[] |
resize(short[] old,
int old_size,
int new_size)
this is an implementation of realloc() for short integers.
|
static void |
reverse(double[] variables,
int size)
reverse an array of doubles
|
static void |
reverse(int[] variables,
int size)
reverse an array of ints
|
static void |
reverse(Object[] variables,
int size)
reverse some list
|
static void |
set(boolean[] x,
boolean val)
set the members of the array x to val
|
static void |
set(int[] x,
int val)
set the elements of "x" to "val" (faster than for(...) x[i] = val; )
|
static void |
set(int[] x,
int val,
int length)
set the first "length" elements of "x" to "val" (faster than for(...) x[i] = val; )
|
static void |
shuffle(int[] x)
shuffle the members of an array
|
static void |
shuffle(int[] x,
int len)
shuffle the first len members of an array
|
public static final int[] resize(int[] old,
int old_size,
int new_size)
public static final short[] resize(short[] old,
int old_size,
int new_size)
public static final void copy(int[] from,
int[] to,
int len,
int from_offset,
int to_offset)
BEWRAE: stupid System.arraycopy() cant hande overlapping arrays correctly
public static final int[] clone(int[] old)
public static final boolean[] clone(boolean[] old)
public static final void set(int[] x,
int val)
public static final void set(int[] x,
int val,
int length)
public static final void set(boolean[] x,
boolean val)
public static final int count(int[] x,
int val)
public static final int count(boolean[] x,
boolean val)
public static void reverse(Object[] variables, int size)
public static void reverse(int[] variables,
int size)
public static void reverse(double[] variables,
int size)
public static final void shuffle(int[] x)
public static final void shuffle(int[] x,
int len)
public static final void disturb(int[] x,
int len)
shuffle(int[], int)public static final int[] permutation(int size)
public static final boolean equals(boolean[] v1,
boolean[] v2,
int len)
public static final boolean equals(short[] v1,
short[] v2,
int len)
public static final boolean equals(byte[] v1,
byte[] v2,
int len)
public static final boolean equals(int[] v1,
int[] v2,
int len)
public static void internal_test()
This file is a part of the JDD package, a native Java Binary Decision Diagram Library.