public final class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static <E> Set<E>[] |
ensure(HashSet<E>[] array,
int size) |
static Integer[] |
ensure(Integer[] array,
int size) |
static int |
not(int i)
given a positive var, returns the literal that represents the negation
of the variable
variable -> literal
|
static int[][] |
resize(int[][] array,
int newSize)
resize for int[][]
|
static int[][] |
resize(int[][] array,
int newSize,
int size)
the same, but with the number of elements to copy from old list
|
static int[] |
resize(int[] array,
int newSize,
int size,
MemoryPool pool)
Resize the array to newSize, using the given memory pool
|
static int[] |
resize(int[] array,
int newSize,
MemoryPool pool) |
static String |
showClause(int[] clause)
facility to print a clause to a string
|
static int |
var(int i)
get the "absolute value" of the int (the variable that corresponds to
the literal)
literal -> variable
|
public static final int[] resize(int[] array, int newSize, int size, MemoryPool pool)
array
- the array to resizenewSize
- the size of the new arraysize
- the number of elements to copy from @param arraypool
- the MemoryPool from which to find an int[]public static final int[] resize(int[] array, int newSize, MemoryPool pool)
public static final int[][] resize(int[][] array, int newSize)
array
- the array to resizenewSize
- the size of the array we wantpublic static final int[][] resize(int[][] array, int newSize, int size)
array
- array to be extendednewSize
- new size for the arraysize
- the number of elements to copy from the oldpublic static String showClause(int[] clause)
clause
- the clause to printpublic static int var(int i)
i
- the literalpublic static int not(int i)
i
- the variableCopyright © 2022. All rights reserved.