public class IntArrays extends Object
| Modifier and Type | Field and Description |
|---|---|
static int[] |
EMPTY_INT_ARRAY |
| Constructor and Description |
|---|
IntArrays() |
| Modifier and Type | Method and Description |
|---|---|
static void |
add(int[] as,
int v) |
static long |
arrayProduct(int[] vs) |
static long |
arrayProduct(int[] vs,
int from,
int to) |
static int[] |
calcStrides(int[] shape)
Computes the standard packed array strides for a given shape.
|
static int[] |
concat(int[] as,
int[] bs)
Concatenates two integer arrays.
|
static int[] |
consArray(int a,
int[] as) |
static double[] |
copyIntsToDoubles(int[] src,
int srcOffset,
double[] dst,
int dstOffset,
int length) |
static long[] |
copyIntsToLongs(int[] src) |
static long[] |
copyIntsToLongs(int[] src,
long[] dst) |
static int[] |
copyOf(int[] data) |
static int[] |
copyOf(long[] xs) |
static int[] |
create(double[] ls) |
static int[] |
create(List<?> ls) |
static int[] |
create(Object o) |
static int[] |
decrementAll(int[] xs) |
static int |
dotProduct(int[] xs,
int[] ys) |
static boolean |
equals(int[] as,
int[] bs)
Tests if two int array scontain equal values.
|
static int[] |
incrementAll(int[] xs) |
static int |
indexLookup(int[] data,
int i)
Finds the position of a value in a sorted index, or -1 if before the array.
|
static int |
indexPosition(int[] data,
int x) |
static int |
indexPosition(int[] data,
int x,
int min,
int max) |
static int[] |
insert(int[] data,
int position,
int value) |
static int[] |
intersectSorted(int[] xs,
int[] ys)
Intersects two distinct sorted integer arrays, returning the intersection of all values
WARNINGS:
1.
|
static boolean |
isRange(int[] as) |
static boolean |
isZero(int[] as) |
static int[] |
mergeSorted(int[] xs,
int[] ys)
Merges two distinct sorted integer arrays, returning the union of all values
WARNINGS:
1.
|
static int[] |
of(int... ints) |
static int[] |
rand(int[] shape)
Creates a randomised int[] array, each element in the range [0..max)
where max is the corresponding element in the shape array
|
static int[] |
rand(int[] shape,
Random r) |
static int[] |
removeIndex(int[] data,
int index)
Removes an element from a specified position in an int[] array.
|
static int[] |
reverse(int[] data) |
static int |
seekPosition(int[] data,
int i) |
static int |
seekPosition(int[] data,
int i,
int min,
int max) |
static int[] |
select(int[] source,
int... inds) |
static void |
swap(int[] inds,
int a,
int b) |
static int[] |
tailArray(int[] as) |
static boolean |
validIndex(int[] as,
int[] shape) |
public static int[] of(int... ints)
public static int[] create(Object o)
public static int[] create(double[] ls)
public static int[] create(List<?> ls)
public static int[] removeIndex(int[] data,
int index)
data - index - public static int[] reverse(int[] data)
public static int[] consArray(int a,
int[] as)
public static int[] tailArray(int[] as)
public static long[] copyIntsToLongs(int[] src,
long[] dst)
public static double[] copyIntsToDoubles(int[] src,
int srcOffset,
double[] dst,
int dstOffset,
int length)
public static long[] copyIntsToLongs(int[] src)
public static long arrayProduct(int[] vs)
public static long arrayProduct(int[] vs,
int from,
int to)
public static final int[] calcStrides(int[] shape)
shape - public static boolean equals(int[] as,
int[] bs)
as - bs - public static int[] rand(int[] shape)
shape - public static int[] rand(int[] shape,
Random r)
public static int dotProduct(int[] xs,
int[] ys)
public static final int indexLookup(int[] data,
int i)
public static int seekPosition(int[] data,
int i)
public static int seekPosition(int[] data,
int i,
int min,
int max)
public static int indexPosition(int[] data,
int x)
public static int indexPosition(int[] data,
int x,
int min,
int max)
public static int[] decrementAll(int[] xs)
public static int[] incrementAll(int[] xs)
public static void swap(int[] inds,
int a,
int b)
public static final int[] copyOf(int[] data)
public static boolean isZero(int[] as)
public static boolean isRange(int[] as)
public static int[] insert(int[] data,
int position,
int value)
public static int[] mergeSorted(int[] xs,
int[] ys)
xs - ys - public static int[] intersectSorted(int[] xs,
int[] ys)
xs - ys - public static boolean validIndex(int[] as,
int[] shape)
public static int[] select(int[] source,
int... inds)
public static void add(int[] as,
int v)
public static int[] copyOf(long[] xs)
public static int[] concat(int[] as,
int[] bs)
as - bs - Copyright © 2016. All rights reserved.