|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.rsl.konrad.utils.DoubleArrayUtil
public abstract class DoubleArrayUtil
Constructor Summary | |
---|---|
DoubleArrayUtil()
|
Method Summary | |
---|---|
static double[] |
add(double[] sum,
double toAdd)
Adds a constant to the first array |
static void |
add(double[] sum,
double[] toAdd)
Adds one array to the first array |
static double |
computeAverageIncrement(double[] array)
Computes the average increment of the array |
static double |
computeMean(double[] array)
Computes the mean value of a given array |
static double |
computeMean(double[] values,
int start,
int end)
computes the mean of the array "values" on the interval [start, end]. |
static double |
computeMeanSquareError(double[] x,
double[] y)
computes the mean square error of array x to array y |
static double |
computeRootMeanSquareError(double[] x,
double[] y)
computes the root mean square error of array x to array y |
static double |
computeStddev(double[] array,
double mean)
Computes the standard deviation given an array and its mean value |
static double |
concordanceCorrelateDoubleArrays(double[] x,
double[] y)
computes the concordance correlation coefficient between two arrays |
static double[] |
convolve(double[] input,
double[] kernel)
Performs a 1-D convolution of the input array with the kernel array. New array will be only of size |
static double |
correlateDoubleArrays(double[] x,
double[] y)
computes the correlation coefficient between two arrays after Pearson |
static double[] |
divide(double[] array,
double divident)
Divides all entries of array by divident. |
static double[] |
divide(double[] array,
double[] divident)
Divides all entries of the two arrays element by element. Works in place and overwrites array. |
static void |
exp(double[] array)
Uses Math.exp() on all elements of the array Works in place and overwrites array. |
static int |
findClosestIndex(double x,
double[] array)
returns the closest index in the array to the given value |
static void |
forceSymmetryComplexDoubleArray(double[] array)
Forces an complex double array to be symmetric. |
static void |
forceSymmetryRealDoubleArray(double[] array)
Forces a real double array to be symmetric. |
static double[] |
gaussianFilter(double[] weights,
double sigma)
Gaussian smoothing of the elements of the array "weights" |
static boolean |
isNaN(double[] array)
tests if any of the values in the given array is NaN |
static void |
log(double[] array)
Uses Math.log() on all elements of the array Works in place and overwrites array. |
static double[] |
meanFilter(double[] weights,
int context)
Performs mean filtering of the array. |
static double[] |
min(double[] array,
double min)
|
static double[] |
minAndMaxOfArray(double[] array)
Returns the minimal and the maximal value in a given array |
static double |
minOfArray(double[] array)
Returns the minimal value in a given array |
static double[] |
multiply(double[] array,
double factor)
Multiplies all entries of array by factor. |
static void |
multiply(double[] array,
double[] array2)
Multiplies all entries of the two arrays element by element. Works in place and overwrites array. |
static double[] |
pow(double[] array,
double exp)
calls Math.pow for each element of the array |
static void |
print(double[] array)
Prints the array on standard out. |
static void |
print(double[] array,
java.text.NumberFormat nf)
Prints the contents of the double array on standard out. |
static void |
print(java.lang.String name,
double[] array)
Prints the array on standard out. |
static void |
print(java.lang.String name,
double[] array,
java.text.NumberFormat nf)
Prints the array on standard out and denotes the arrays name. |
static void |
removeOutliers(double[] weights,
double threshold)
Removes outliers from the array which differ more than threshold from the last value. |
static void |
saveForVisualization(int imageNumber,
double[] array)
Stores an array for later visualization at index imageNumber |
static void |
suppressCenter(double[] weights,
int threshold)
|
static java.lang.String |
toString(double[] array)
Converts the array to a String representation. |
static java.lang.String |
toString(double[] array,
java.lang.String delimiter)
Converts the array to a String representation. |
static ij.ImagePlus |
visualizeBufferedArrays(java.lang.String title)
Displays the arrays stored with "saveForVisualization" as ImagePlus. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DoubleArrayUtil()
Method Detail |
---|
public static void saveForVisualization(int imageNumber, double[] array)
imageNumber
- the numberarray
- the arraypublic static double[] convolve(double[] input, double[] kernel)
output.lenght = input.length - (2 * (kernel.length/2));(Note that integer arithmetic is used here)
input
- the array to be convolvedkernel
- the kernel
public static ij.ImagePlus visualizeBufferedArrays(java.lang.String title)
title
- the title of the ImagePlus
saveForVisualization(int imageNumber, double [] array)
public static void forceSymmetryComplexDoubleArray(double[] array)
array
- the complex arraypublic static boolean isNaN(double[] array)
array
-
public static void forceSymmetryRealDoubleArray(double[] array)
array
- the real arraypublic static int findClosestIndex(double x, double[] array)
x
- the valuearray
- the array
public static double correlateDoubleArrays(double[] x, double[] y)
x
- the one arrayy
- the other array
public static double concordanceCorrelateDoubleArrays(double[] x, double[] y)
x
- the one arrayy
- the other array
public static double computeMeanSquareError(double[] x, double[] y)
x
- the one arrayy
- the other array
public static double computeRootMeanSquareError(double[] x, double[] y)
x
- the one arrayy
- the other array
public static void suppressCenter(double[] weights, int threshold)
public static void removeOutliers(double[] weights, double threshold)
weights
- the weightthreshold
- the thresholdpublic static double computeMean(double[] values, int start, int end)
values
- the arraystart
- the start indexend
- the end index
public static double computeAverageIncrement(double[] array)
array
- the array
public static double[] meanFilter(double[] weights, int context)
weights
- the arraycontext
- the context to be used for smoothing (from -context/2 to context/2)
public static double[] gaussianFilter(double[] weights, double sigma)
weights
- the arraysigma
- the standard deviation
public static double computeStddev(double[] array, double mean)
array
- the arraymean
- the mean value of the array
public static double computeMean(double[] array)
array
- the array
public static double[] minAndMaxOfArray(double[] array)
array
- the array
public static double minOfArray(double[] array)
array
- the array
public static void add(double[] sum, double[] toAdd)
sum
- the first arraytoAdd
- the array to addpublic static double[] add(double[] sum, double toAdd)
sum
- the first arraytoAdd
- the constant to addpublic static double[] divide(double[] array, double divident)
array
- the arraydivident
- the number used for division.public static double[] multiply(double[] array, double factor)
array
- the arrayfactor
- the number used for multiplication.public static void multiply(double[] array, double[] array2)
array
- the arrayarray2
- the other array.public static void exp(double[] array)
array
- the arraypublic static double[] divide(double[] array, double[] divident)
array
- the arraydivident
- the other array.public static void log(double[] array)
array
- the arraypublic static void print(double[] array, java.text.NumberFormat nf)
array
- nf
- the NumberFormatpublic static void print(java.lang.String name, double[] array, java.text.NumberFormat nf)
name
- the namearray
- the arraynf
- the number formatpublic static void print(java.lang.String name, double[] array)
name
- the namearray
- the arraypublic static void print(double[] array)
array
- the arraypublic static double[] pow(double[] array, double exp)
array
- exp
- the exponent.
public static double[] min(double[] array, double min)
public static java.lang.String toString(double[] array)
array
- the array
toString(double[],String)
public static java.lang.String toString(double[] array, java.lang.String delimiter)
array
- the arraydelimiter
- the delimiter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |