public class ArrayMath
extends java.lang.Object
Constructor and Description |
---|
ArrayMath()
Creates a new instance of ArrayMath
|
Modifier and Type | Method and Description |
---|---|
static double[] |
addArray(double[] a,
double[] b)
Adds two arrays together, index to index.
|
static double[] |
addConstant(double[] a,
double num)
This method adds a constant to every value within the array.
|
static double[] |
clipArray(double[] inputArray,
double minimumValue,
double maximumValue) |
static double[] |
divideArray(double[] a,
double[] b)
Divides two arrays into eachother, index to index.
|
static double[] |
divideConstant(double[] a,
double num)
This method divides a constant into every value within the array.
|
static double[] |
log10Array(double[] a)
This value takes the log base10 of every value within the array.
|
static double[] |
multiplyArray(double[] a,
double[] b)
Multiplies two arrays together, index to index.
|
static double[] |
multiplyConstant(double[] a,
double num)
This method multiplies a constant by every value within the array.
|
static double[] |
subtractArray(double[] a,
double[] b)
Subtracts two arrays from eachother, index to index.
|
static double[] |
subtractConstant(double[] a,
double num)
This method subtracts a constant to every value within the array.
|
public static double[] clipArray(double[] inputArray, double minimumValue, double maximumValue)
inputArray
- - spectrum intensity arrayminimumValue
- - inclusive; If Double.NaN, minimum clipping will not be applied.maximumValue
- - inclusive; If Double.NaN, maximum clipping will not be applied.public static double[] multiplyArray(double[] a, double[] b)
IllegalArgumentException
is thrown.
a * b
a
- the first array.b
- the second array.public static double[] addArray(double[] a, double[] b)
IllegalArgumentException
is thrown.
a + b
a
- the first array.b
- the second array.public static double[] subtractArray(double[] a, double[] b)
IllegalArgumentException
is thrown.
a - b
a
- the first array to subtract from.b
- the second array to be subtracted.public static double[] divideArray(double[] a, double[] b)
IllegalArgumentException
is thrown.
a / b
a
- the numerator array.b
- the denominator array.public static double[] multiplyConstant(double[] a, double num)
a * num
a
- the array to be multiplied.num
- the number to multiply by each value of the array.public static double[] addConstant(double[] a, double num)
a + num
a
- the array to be added.num
- the number to add to each value in the array,.public static double[] subtractConstant(double[] a, double num)
a - num
a
- the array to be subtracted from.num
- the number to subtract from each value in the array.public static double[] divideConstant(double[] a, double num)
a/num
a
- the array to be divided into (numerator).num
- the number to divide into each value within the array
(denominator).public static double[] log10Array(double[] a)
log(a)
a
- the array to log base10.Copyright 2004-2006 Ocean Optics, Inc. All Rights Reserved.