public class ArrayMath
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
ArrayMath()
Creates a new instance of ArrayMath
|
Modifier and Type | Method and Description |
---|---|
static double[] |
elementProduct(double[] vec1,
double[] vec2)
Multiply two vectors element by element:
m(i) = v1(i) * v2(i)
|
static java.lang.Object |
elementProduct(java.lang.Object vec1,
java.lang.Object vec2,
int[] dimensions)
Return the square root of each element:
m(i1,i2,...) = v1(i1,i2,...) * v2(i1,i2,...)
|
static double[] |
elementSquareRoot(double[] vector)
Return the square root of each element:
s(i) = squar_root( vec(i) )
|
static java.lang.Object |
elementSquareRoot(java.lang.Object vector,
int[] dimensions)
Return the square root of each element:
s(i1,i2,...) = squar_root( vec(i1,i2,...) )
|
static java.lang.Object |
elementSquareRootAbs(java.lang.Object vector,
int[] dimensions)
Return the square root of each element:
s(i1,i2,...) = squar_root( abs( vec(i1,i2,...) ) )
|
static boolean |
invertMatrix(double[][] a)
Invert the matrix in place - copied from reverseMatrix() in the the plot framework's GraphDataOperations
|
static double[][] |
matrixProduct(double[] columnVector,
double[] rowVector)
Multiply a column vector by a row vector where the product is a matrix defined by:
M(i,j) = columnVector(i) * rowVector(j)
Note: This is not a scalar product, nor a vector product, but rather
it is a product of a column vector with a row vector which results
in a matrix.
|
static double[] |
multiply(double[][] matrix,
double[] vector)
Multiply a vector by a matrix defined by:
v(i) = Sumj( mat(i,j) * vec(j) )
|
static double[] |
multiply(double[] vector,
double scalar)
Multiply a vector by a scalar:
v(i) = vector(i) * scalar
|
static java.lang.Object |
multiply(java.lang.Object vector,
double scalar,
int[] dimensions)
Return the square root of each element:
m(i1,i2,...) = v(i1,i2,...) * scalar
|
static double |
scalarProduct(double[] vec1,
double[] vec2)
Calculate the scalar product of two vectors.
|
static double[][] |
subtract(double[][] mat1,
double[][] mat2)
Subtract two matrices
M(i,j) = m1(i,j) - m2(i,j)
|
static double[] |
subtract(double[] vec1,
double[] vec2)
Subtract two vectors
v(i) = v1(i) - v2(i)
|
static java.lang.Object |
subtract(java.lang.Object vec1,
java.lang.Object vec2,
int[] dimensions)
Return the square root of each element:
s(i1,i2,...) = v1(i1,i2,...) - v2(i1,i2,...)
|
static double[] |
transform(double[] array,
double scale,
double offset)
Transform an array by mutlitplying by a scale and adding an offset
v(i) = scale * array(i) + offset
|
static double[] |
translate(double[] array,
double offset)
Add a scalar to each element of an array
v(i) = array(i) + offset
|
public static double[] translate(double[] array, double offset)
public static double[] transform(double[] array, double scale, double offset)
public static double[] subtract(double[] vec1, double[] vec2)
public static double[][] subtract(double[][] mat1, double[][] mat2)
public static java.lang.Object subtract(java.lang.Object vec1, java.lang.Object vec2, int[] dimensions)
public static double[] multiply(double[] vector, double scalar)
public static java.lang.Object multiply(java.lang.Object vector, double scalar, int[] dimensions)
public static double[] multiply(double[][] matrix, double[] vector)
public static double scalarProduct(double[] vec1, double[] vec2)
public static double[][] matrixProduct(double[] columnVector, double[] rowVector)
public static java.lang.Object elementProduct(java.lang.Object vec1, java.lang.Object vec2, int[] dimensions)
public static double[] elementProduct(double[] vec1, double[] vec2)
public static double[] elementSquareRoot(double[] vector)
public static java.lang.Object elementSquareRoot(java.lang.Object vector, int[] dimensions)
public static java.lang.Object elementSquareRootAbs(java.lang.Object vector, int[] dimensions)
public static boolean invertMatrix(double[][] a)