|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object comirva.util.MathUtils
public class MathUtils
Field Summary | |
---|---|
static float |
ZERO_TOLERANCE
|
Constructor Summary | |
---|---|
MathUtils()
|
Method Summary | |
---|---|
static float[] |
divide(float[] a,
float f)
Create a new array containing each value in a divided by f. |
static float |
euclideanLength(float[] f)
Determine the euclidean length of f, i.e., the root of the sum of the squared elements of f. |
static float |
log2(double a)
|
static float |
max(float[] a)
Returns the maximum of all values in a, as determined by Math.max(float, float). |
static float[] |
max(float f,
float[] a)
Creates a copy of a and replaces each element of a which is smaller than f (as determined by Math.max) with f. |
static int |
max(int[] a)
|
static void |
maxInPlace(float f,
float[] a)
Same function as max(float f, float[] a) but without creating a new array. |
static float |
mean(ArrayList<Integer> al)
Calculate the mean value of all integers in the ArrayList. |
static float |
mean(float[] a)
Returns the mean of all values in a. |
static float |
min(float[] f)
Determine the minimum value in the array f, as indicated by Math.min(float, float) |
static float[] |
minus(float[] a,
float b)
Return a new array containing at position i the value a[i] - b The values in the original array a are left unchanged. |
static float[] |
mult(float[] a,
float[] b)
|
static float |
multSafe(float a,
float b)
Multiplies a and b and returns the result, unless the result is NaN or +/-infinity, in which case the function returns 0.0f. |
static int |
numelNonzero(float[] a)
Return the number of elements in a that are not zero. |
static float |
sum_abs(float[] a)
Sums up the elements after taking their absolute value. |
static float |
sum(float[] a)
Returns the sum of all elements in a. |
static long |
sum(int[] a)
Returns the sum of all elements in a. |
static void |
zeros(float[] a)
Set all values in a to zero. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float ZERO_TOLERANCE
Constructor Detail |
---|
public MathUtils()
Method Detail |
---|
public static float log2(double a)
public static float multSafe(float a, float b)
a
- b
-
public static int max(int[] a)
public static float mean(ArrayList<Integer> al)
al
-
public static float sum_abs(float[] a)
a
- public static int numelNonzero(float[] a)
a
-
public static float max(float[] a)
a
-
public static float sum(float[] a)
a
-
public static long sum(int[] a)
a
-
public static void zeros(float[] a)
a
- public static float mean(float[] a)
a
-
public static float[] mult(float[] a, float[] b)
a
- b
-
public static float[] max(float f, float[] a)
f
- a
-
public static void maxInPlace(float f, float[] a)
f
- a
- public static float euclideanLength(float[] f)
f
-
public static float min(float[] f)
f
-
public static float[] minus(float[] a, float b)
a
- b
-
public static float[] divide(float[] a, float f)
a
- f
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |