|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfig.utils.Array
utility functions for double[] arrays, Matlab-style:
Constructor Summary | |
Array()
dummy constructor; you can use this to create an Array instance that allows you to access the static methods of this class from Matlab 5.3 (which requires a very ugly syntax to use static methods). |
Method Summary | |
static double[] |
abs(double[] arg)
|
static double[] |
add(double[] arg,
double value)
|
static double[] |
add(double[] arg,
double[] arg2)
|
static double[] |
add(double[] x1,
double[] x2,
double[] x3)
|
static double[] |
add(double[] x1,
double[] x2,
double[] x3,
double[] x4)
|
static int |
any(double[] x)
return 0 if all elements of x[] are zero, otherwise return 1 |
static double[] |
array(double x0)
create an array [x0] |
static double[] |
array(double x0,
double x1)
create an array [x0,x1] |
static double[] |
array(double x0,
double x1,
double x2)
|
static double[] |
array(double x0,
double x1,
double x2,
double x3)
|
static double[] |
array(double x0,
double x1,
double x2,
double x3,
double x4)
|
static double[] |
array(java.lang.String s)
read a whitespace, comma, semicolon separated string and create a double array with values corresponding to the tokens in that string. |
static double[] |
autoRangeClipped(double[] arg)
return a range of 'clipped'/'rounded' values suitable that bound the minimum and maximum values of the input array. |
static double[] |
ceil(double[] x)
|
static double[] |
clone(double[] arg)
|
static double[] |
concat(double[] u,
double[] v)
|
static double[] |
concat(double[] u,
double[] v,
double[] w)
|
static double[] |
concat(double[] u,
double[] v,
double[] w,
double[] x)
|
static double[] |
constant(double value,
int N)
|
static double[] |
constant(int N,
double value)
|
static double[] |
convolve(double[] target,
double[] kernel)
|
static double[] |
cos(double[] arg)
|
static double[] |
div(double[] arg,
double value)
|
static double[] |
div(double[] arg,
double[] arg2)
|
static double[] |
equals(double[] x,
double[] y)
create a new array where result[i] = 1.0 if x[i] == y[i], but result[i] = 0.0 otherwise. |
static double[] |
exp(double[] arg)
|
static double[][] |
eye(int M,
int N)
create an identity matrix (M rows, N columns), i.e. |
static void |
fft_core(int sign,
int n,
double[] ar,
double[] ai,
double scale)
calculate in-place FFT for input arrays ar and ai of length 2**n. |
static double[][] |
fft(double[] ar,
double[] ai)
calculate the FFT of arrays ar and ai (real and imaginary parts of the input values). |
static double[] |
filter(double[] B,
double[] A,
double[] X)
one-dimensional digital filter. |
static double[] |
floor(double[] x)
|
static int |
getIndexOfMaxValue(double[] arg)
|
static int |
getIndexOfMinValue(double[] arg)
|
static double |
getMax(double[] arg)
|
static double |
getMin(double[] arg)
|
static double[] |
getMinMax(double[] arg)
|
static double[] |
greaterEquals(double[] x,
double[] y)
create a new array where result[i] = 1.0 if x[i] >= y[i], but result[i] = 0.0 otherwise. |
static double[] |
greaterThan(double[] x,
double[] y)
create a new array where result[i] = 1.0 if x[i] > y[i], but result[i] = 0.0 otherwise. |
static double[] |
hamming(int N)
|
static double[] |
hanning(int N)
|
static boolean |
hasNaN(double[] x)
|
static void |
help()
|
static double[][] |
ifft(double[] ar,
double[] ai)
|
static int[] |
indexArray(double[] x)
create a new array containing the indices of all non-zero elements of x[]. |
static double[] |
insert(double[] x,
double[] y,
int start)
insert the elements of y into x, starting at index 'start' For example, for x=[0 1 2 3 4 5 6 7 8 9] and y=[4 3 2], the call insert( x, y, 2 ) yields x = [ 0 1 4 3 2 5 6 7 8 9 ] |
static double[] |
lessEquals(double[] x,
double[] y)
create a new array where result[i] = 1.0 if x[i] <= y[i], but result[i] = 0.0 otherwise. |
static double[] |
lessThan(double[] x,
double[] y)
create a new array where result[i] = 1.0 if x[i] < y[i], but result[i] = 0.0 otherwise. |
static double[] |
linspace(double min,
double max,
int N)
|
static double[] |
log(double[] arg)
|
static double |
log10(double arg)
|
static double[] |
log10(double[] arg)
|
static double |
log2(double arg)
|
static double[] |
log2(double[] arg)
|
static double[] |
logspace(double exp1,
double exp2,
int N)
|
static void |
main(java.lang.String[] argv)
|
static double[] |
max(double[] arg,
double[] arg2)
|
static double[] |
min(double[] arg,
double[] arg2)
|
static double[] |
mult(double[] arg,
double value)
|
static double[] |
mult(double[] arg,
double[] arg2)
|
static double[] |
neq(double[] x,
double[] y)
create a new array where result[i] = 1.0 if x[i] != y[i], but result[i] = 0.0 if x[i] == y[i] |
static double[] |
normalize(double[] s)
|
static double[] |
ones(int N)
create an array of N ones |
static double[][] |
ones(int M,
int N)
create a matrix (M rows, N columns) initialized with all ones |
static double[] |
parse(java.lang.String s)
parse the given string and construct an array from it. |
static java.lang.String |
print(double[] arg)
|
static double[] |
random(int N)
generate an array of N random values, each in the range [0.0 .. |
static double[][] |
random(int M,
int N)
create a matrix (M rows, N columns) initialized with uniformly distributed random values in the range [0..1) |
static double[] |
range(int start,
int end)
create a double array with all integers in the given range, using Matlab conventions: both start and end values are included. |
static double[] |
reciprocal(double[] arg)
|
static double[] |
resample(double[] arg,
int new_length)
resample (i.e. |
static double[] |
reverse(double[] arg)
|
static double[] |
round(double[] x)
|
static double |
scalarproduct(double[] arg1,
double[] arg2)
|
static double[] |
sin(double[] arg)
|
static double[] |
sqrt(double[] arg)
|
static double[] |
sub(double[] arg,
double value)
|
static double[] |
sub(double[] arg,
double[] arg2)
|
static double[] |
subset(double[] arg,
int start)
|
static double[] |
subset(double[] arg,
int start,
int end)
return the specified subset of the argument array. |
static double[] |
subset(double[] arg,
int start,
int end,
int step)
return the specified subset of the argument array, starting at the given 'start' index and stepping by 'step' to 'end'. |
static double |
sum(double[] x)
|
static double[] |
tan(double[] arg)
|
static double[] |
toDouble(float[] x)
|
static double[] |
toDouble(int[] x)
|
static double[][] |
toDouble(int[][] x)
|
static float[] |
toFloat(double[] x)
|
static int[] |
toInteger(double[] x)
round the values in array x to the nearest integer; too-large values are clipped to Integer.MAX_VALUE and MIN_VALUE respectively. |
static int[][] |
toInteger(double[][] x)
|
static double[] |
toMask(double[] x)
create a new array where each non-zero value in x is replaced by a value of 1.0, while zeroes are kept. |
static java.lang.String |
toString(double[] arg)
|
static java.lang.String |
toString(double[] arg,
Format format)
|
static double[] |
zeros(int N)
create an array of N zeroes |
static double[][] |
zeros(int M,
int N)
create a matrix (M rows, N columns) initialized with all zeros |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Array()
Method Detail |
public static void help()
public static double[] constant(int N, double value)
public static double[] constant(double value, int N)
public static double[] zeros(int N)
public static double[][] zeros(int M, int N)
public static double[] ones(int N)
public static double[][] ones(int M, int N)
public static double[][] eye(int M, int N)
public static double[] array(double x0)
public static double[] array(double x0, double x1)
public static double[] array(double x0, double x1, double x2)
public static double[] array(double x0, double x1, double x2, double x3)
public static double[] array(double x0, double x1, double x2, double x3, double x4)
public static double[] array(java.lang.String s)
public static double[] parse(java.lang.String s)
public static double[] reverse(double[] arg)
public static double[] random(int N)
public static double[][] random(int M, int N)
public static double[] toDouble(int[] x)
public static double[][] toDouble(int[][] x)
public static double[] toDouble(float[] x)
public static float[] toFloat(double[] x)
public static int[] toInteger(double[] x)
public static int[][] toInteger(double[][] x)
public static double[] ceil(double[] x)
public static double[] floor(double[] x)
public static double[] round(double[] x)
public static double[] linspace(double min, double max, int N)
public static double[] logspace(double exp1, double exp2, int N)
public static double[] range(int start, int end)
public static double[] resample(double[] arg, int new_length)
public static double[] clone(double[] arg)
public static double getMin(double[] arg)
public static double getMax(double[] arg)
public static double[] getMinMax(double[] arg)
public static int getIndexOfMinValue(double[] arg)
public static int getIndexOfMaxValue(double[] arg)
public static double[] autoRangeClipped(double[] arg)
public static double[] add(double[] arg, double[] arg2)
public static double[] add(double[] arg, double value)
public static double[] add(double[] x1, double[] x2, double[] x3)
public static double[] add(double[] x1, double[] x2, double[] x3, double[] x4)
public static double[] mult(double[] arg, double[] arg2)
public static double[] mult(double[] arg, double value)
public static double[] div(double[] arg, double[] arg2)
public static double[] div(double[] arg, double value)
public static double[] reciprocal(double[] arg)
public static double[] sub(double[] arg, double[] arg2)
public static double[] sub(double[] arg, double value)
public static double[] min(double[] arg, double[] arg2)
public static double[] max(double[] arg, double[] arg2)
public static double[] sin(double[] arg)
public static double[] cos(double[] arg)
public static double[] exp(double[] arg)
public static double[] log(double[] arg)
public static double log2(double arg)
public static double[] log2(double[] arg)
public static double log10(double arg)
public static double[] log10(double[] arg)
public static double[] abs(double[] arg)
public static double[] sqrt(double[] arg)
public static double[] tan(double[] arg)
public static double[] concat(double[] u, double[] v)
public static double[] concat(double[] u, double[] v, double[] w)
public static double[] concat(double[] u, double[] v, double[] w, double[] x)
public static double[] insert(double[] x, double[] y, int start)
public static double[] subset(double[] arg, int start, int end)
public static double[] subset(double[] arg, int start)
public static double[] subset(double[] arg, int start, int end, int step)
public static int[] indexArray(double[] x)
public static double scalarproduct(double[] arg1, double[] arg2)
public static java.lang.String toString(double[] arg)
public static java.lang.String toString(double[] arg, Format format)
public static java.lang.String print(double[] arg)
public static double[] normalize(double[] s)
public static double[] hamming(int N)
public static double[] hanning(int N)
public static double sum(double[] x)
public static double[] toMask(double[] x)
public static double[] equals(double[] x, double[] y)
public static double[] neq(double[] x, double[] y)
public static double[] greaterThan(double[] x, double[] y)
public static double[] greaterEquals(double[] x, double[] y)
public static double[] lessThan(double[] x, double[] y)
public static double[] lessEquals(double[] x, double[] y)
public static int any(double[] x)
public static boolean hasNaN(double[] x)
public static double[] convolve(double[] target, double[] kernel)
public static double[] filter(double[] B, double[] A, double[] X)
public static double[][] fft(double[] ar, double[] ai)
public static double[][] ifft(double[] ar, double[] ai)
public static void fft_core(int sign, int n, double[] ar, double[] ai, double scale)
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |