public class ArrayMath
extends java.lang.Object
Constructor and Description |
---|
ArrayMath() |
Modifier and Type | Method and Description |
---|---|
static double |
innerProduct(double[] vecA,
double[] vecB) |
static double |
invL2norm(double[] v)
Inverse L2-norm
|
static double |
l1norm(double[] v)
L1-norm
|
static double |
l2norm(double[] v)
L2-norm
|
static double |
logSumOfExps(double[] x)
Computes \log(\sum_{i=1}^n e^{x_i}) using a maximum-element trick
to avoid arithmetic overflow.
|
static double |
max(double[] x) |
static int |
maxIdx(double[] x)
Find index of maximum element in the vector x
|
static double[] |
toDoubleArray(java.util.List<java.lang.Double> list)
Convert a list of Double objects into an array of primitive doubles
|
static int[] |
toIntArray(java.util.List<java.lang.Integer> list)
Convert a list of Integer objects into an array of primitive integers
|
public static double innerProduct(double[] vecA, double[] vecB)
public static double l1norm(double[] v)
public static double l2norm(double[] v)
public static double invL2norm(double[] v)
public static double logSumOfExps(double[] x)
x
- input vectorpublic static double max(double[] x)
public static int maxIdx(double[] x)
x
- input vectorpublic static double[] toDoubleArray(java.util.List<java.lang.Double> list)
public static int[] toIntArray(java.util.List<java.lang.Integer> list)
Copyright © 2010 - 2020 Adobe. All Rights Reserved