|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.util.math.MathUtils
public final class MathUtils
Implements basic mathematical functions.
Method Summary | |
---|---|
static double[][] |
add(double[][] matrix1,
double[][] matrix2)
Adds two matrices. |
static void |
addArrays(double[] firstArray,
double[] secondArray)
Adds the second array to the first one. |
static void |
addMatrix(double[][] firstMatrix,
double[][] secondMatrix)
Adds the second matrix to the first one. |
static double[][] |
denormalizeMatrix(double[][] y,
double[] mean)
Denormalizes the matrix relativ to the mean of the input data. |
static double[][] |
denormalizeMatrix(double[][] y,
double[] standardDev,
double[] mean)
Denormalizes the matrix relativ to the mean of the input data and to the standard deviation. |
static double[] |
denormalizeVector(double[] vector,
double mean)
Denormalizes the vector relative to the mean of the input data. |
static double[] |
denormalizeVector(double[] vector,
double standardDev,
double mean)
Denormalizes the vector relative to the mean of the input data and to the standard deviation. |
static double |
hypotenuse(double x,
double y)
Calculates sqrt(x^2 + y^2) reducing the risk of over- or underflow. |
static double[][] |
inverse(double[][] aOrig)
Calculates the inverse matrix of a given matrix. |
static double[] |
multiply(double[][] matrix,
double[] vector)
Multiplies two matrices. |
static double[][] |
multiply(double[][] matrix1,
double[][] matrix2)
Multiplies two matrices. |
static double[][] |
multiplyLeftWithTranspose(double[][] mat)
Multiplies a matrix with its transposed matrix. |
static double[][] |
normalizeMatrix(double[][] matrix)
Normalizes the matrix relative to the mean and standard deviation of the input data. |
static double[][] |
normalizeMatrix(double[][] matrix,
double[] mean)
Normalizes the matrix relative to the mean of the input data. |
static double[][] |
normalizeMatrix(double[][] matrix,
double[] standardDev,
double[] mean)
Normalizes the matrix relative to the mean of the input data and to the standard deviation. |
static double |
spectralNorm(double[][] matrix)
Computes the spectral norm of the given matrix. |
static double[][] |
transpose(double[][] inputMatrix)
Transposes the given matrix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double hypotenuse(double x, double y)
x
- the x valuey
- the y value
public static double[][] multiply(double[][] matrix1, double[][] matrix2) throws IllegalArgumentException
matrix1
- the matrix on the left sidematrix2
- the matrix on the right side
IllegalArgumentException
- if the matrices are not compatiblepublic static double[][] add(double[][] matrix1, double[][] matrix2) throws IllegalArgumentException
matrix1
- the matrix on the left sidematrix2
- the matrix on the right side
IllegalArgumentException
- if the matrices are not compatiblepublic static double[] multiply(double[][] matrix, double[] vector) throws IllegalArgumentException
matrix
- the matrix on the left sidevector
- the vector on the right side
IllegalArgumentException
- if the matrices are not compatiblepublic static double[][] multiplyLeftWithTranspose(double[][] mat)
mat
- the matrix
public static double[][] transpose(double[][] inputMatrix)
inputMatrix
- the matrix to transposed
public static double[][] inverse(double[][] aOrig)
aOrig
- the original matrix
ArithmeticException
- if the matrix is not a square matrix or the
inverse can not be computed (because of linear dependencies)
NullPointerException
- if the argument is null
or
contains null
elementspublic static double[][] normalizeMatrix(double[][] matrix, double[] standardDev, double[] mean)
matrix
- the matrix to normalizestandardDev
- the standard deviation for all columns used to
normalize the matrixmean
- the mean for all columns used to normalize the matrix
public static double[][] normalizeMatrix(double[][] matrix, double[] mean)
matrix
- the matrix to normalizemean
- the mean for all columns used to normalize the matrix
public static double[][] normalizeMatrix(double[][] matrix)
matrix
- the matrix to normalize
public static double[][] denormalizeMatrix(double[][] y, double[] standardDev, double[] mean)
y
- the matrix to denormalizestandardDev
- the standard deviation for all columns used to
denormalize the matrixmean
- the mean for all columns used to denormalize the matrix
public static double[] denormalizeVector(double[] vector, double standardDev, double mean)
vector
- the input array to denormalizestandardDev
- the standard deviation for all columns used to
denormalize the matrixmean
- the mean for all columns used to denormalize the matrix
public static double[] denormalizeVector(double[] vector, double mean)
vector
- the input array to denormalizemean
- the mean for all columns used to denormalize the matrix
public static double[][] denormalizeMatrix(double[][] y, double[] mean)
y
- the matrix to denormalizemean
- the mean for all columns used to denormalize the matrix
public static double spectralNorm(double[][] matrix)
matrix
- the matrix to compute the norm for.
public static void addArrays(double[] firstArray, double[] secondArray)
firstArray
- the first array will be changed by adding the second
one to itsecondArray
- the second array will be added to the first one (stays
unchanged)public static void addMatrix(double[][] firstMatrix, double[][] secondMatrix)
firstMatrix
- the first matrix will be changed by adding the second
one to itsecondMatrix
- the second matrix will be added to the first one
(stays unchanged)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |