public class ArrayUtils
extends java.lang.Object
Constructor and Description |
---|
ArrayUtils() |
Modifier and Type | Method and Description |
---|---|
static int[] |
append(int[] a,
int... b) |
static java.lang.String[][] |
append(java.lang.String[][] a,
java.lang.String[]... b) |
static java.lang.String[] |
append(java.lang.String[] a,
java.lang.String... b) |
static int[] |
arrayInitRange(int arrayLen,
int startIndex) |
static double[] |
difference(double[] array) |
static double[] |
eleDiff(double[] from) |
static double[] |
flat(double[][] arr) |
static boolean |
isBoolColumn(java.lang.String[] domains)
Check to see if a column is a boolean column.
|
static double |
l2norm(double[] x) |
static double |
l2norm2(double[] x) |
static double |
l2norm2(double[] x,
boolean skipLast) |
static int |
maxIndex(double[] from) |
static int |
maxIndex(double[] from,
java.util.Random rand) |
static double[] |
mult(double[] nums,
double n) |
static void |
multArray(double[] a,
double[][] bT,
double[] result)
Carry out multiplication of row array a and matrix b and store the result in result array.
|
static double[] |
nanArray(int len) |
static int[] |
range(int start,
int end)
Provide array from start to end in steps of 1
|
static double[] |
signum(double[] array) |
static void |
sort(int[] idxs,
double[] values)
Sort an integer array of indices based on values
Updates indices in place, keeps values the same
|
static void |
sort(int[] idxs,
double[] values,
int cutoff) |
static void |
sort(int[] idxs,
float[] values,
int fromIndex,
int toIndex,
boolean abs,
int increasing)
Sort an integer array of indices based on values
Updates indices in place, keeps values the same
|
static void |
sort(int[] idxs,
float[] values,
int fromIndex,
int toIndex,
boolean abs,
int increasing,
int cutoff) |
static double |
subAndMul(double[] data,
double[] p,
double[] n) |
static int[] |
subtract(int[] from,
int val) |
static int[] |
subtract(int[] from,
int[] val) |
public static double[] nanArray(int len)
public static double l2norm(double[] x)
public static double l2norm2(double[] x)
public static double l2norm2(double[] x, boolean skipLast)
public static double[] flat(double[][] arr)
public static double[] eleDiff(double[] from)
public static int[] subtract(int[] from, int val)
public static int[] subtract(int[] from, int[] val)
public static double[] mult(double[] nums, double n)
public static int[] arrayInitRange(int arrayLen, int startIndex)
public static boolean isBoolColumn(java.lang.String[] domains)
domains
- public static int maxIndex(double[] from, java.util.Random rand)
public static int maxIndex(double[] from)
public static void sort(int[] idxs, double[] values)
idxs
- indicesvalues
- valuespublic static void sort(int[] idxs, double[] values, int cutoff)
public static void sort(int[] idxs, float[] values, int fromIndex, int toIndex, boolean abs, int increasing)
idxs
- indicesvalues
- valuespublic static void sort(int[] idxs, float[] values, int fromIndex, int toIndex, boolean abs, int increasing, int cutoff)
public static java.lang.String[] append(java.lang.String[] a, java.lang.String... b)
public static java.lang.String[][] append(java.lang.String[][] a, java.lang.String[]... b)
public static int[] append(int[] a, int... b)
public static double[] signum(double[] array)
public static double[] difference(double[] array)
public static void multArray(double[] a, double[][] bT, double[] result)
a
- bT
- result
- public static int[] range(int start, int end)
start
- beginning value (inclusive)end
- ending value (inclusive)public static double subAndMul(double[] data, double[] p, double[] n)
data
- vector (1 x n)p
- vector (1 x n)n
- vector (1 x n)