edu.northwestern.at.utils.math.matrix
Class MatrixMeasure

java.lang.Object
  extended by edu.northwestern.at.utils.math.matrix.MatrixMeasure

public class MatrixMeasure
extends java.lang.Object

MatrixMeasure computes important measures associated with a matrix.


Constructor Summary
protected MatrixMeasure()
          Don't allow instantiation but do allow overrides.
 
Method Summary
static int breadth(Matrix matrix)
          Breadth of matrix, e.g., the minimum dimension.
static double condition(Matrix matrix)
          Condition number of matrix.
static double determinant(Matrix matrix)
          Determinant of matrix.
static int length(Matrix matrix)
          Length of the matrix, e.g., the maximum dimension.
static double max(Matrix matrix)
          Maximum value in matrix.
static double mean(Matrix matrix, boolean adjustment)
          Mean of all matrix values.
static double min(Matrix matrix)
          Minimum value in matrix.
static double norm1(Matrix matrix)
          1-norm -- maximum column sum.
static double norm2(Matrix matrix)
          2-norm -- maximum singular value.
static double normFrobenius(Matrix matrix)
          Frobenius norm -- square root of sum of squares of all entries.
static double normInfinity(Matrix matrix)
          Infinity norm -- maximum row sum.
static double product(Matrix matrix)
          Product of all matrix values.
static int rank(Matrix matrix)
          Rank of matrix.
static double sum(Matrix matrix)
          Sum of all matrix values.
static double trace(Matrix matrix)
          Trace of matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatrixMeasure

protected MatrixMeasure()
Don't allow instantiation but do allow overrides.

Method Detail

breadth

public static int breadth(Matrix matrix)
Breadth of matrix, e.g., the minimum dimension.

Parameters:
matrix - The matrix.
Returns:
Smaller of rows and columns in the matrix.

condition

public static double condition(Matrix matrix)
Condition number of matrix.

Parameters:
matrix - Matrix.
Returns:
Ratio of largest to smallest singular value.

determinant

public static double determinant(Matrix matrix)
Determinant of matrix.

Parameters:
matrix - Matrix.
Returns:
Determinant.

We compute the determinant from the LU decomposition of the matrix.


length

public static int length(Matrix matrix)
Length of the matrix, e.g., the maximum dimension.

Parameters:
matrix - Matrix.
Returns:
Larger of rows and columns of matrix.

max

public static double max(Matrix matrix)
Maximum value in matrix.

Parameters:
matrix - Matrix.
Returns:
Maximum value in matrix.

mean

public static double mean(Matrix matrix,
                          boolean adjustment)
Mean of all matrix values.

Parameters:
matrix - Matrix.
adjustment - True to divide by (n-1) instead of n, where n is the number of values in the matrix.
Returns:
Mean of all matrix entries.

min

public static double min(Matrix matrix)
Minimum value in matrix.

Parameters:
matrix - Matrix.
Returns:
Minimum value in matrix.

norm1

public static double norm1(Matrix matrix)
1-norm -- maximum column sum.

Parameters:
matrix - Matrix.
Returns:
Manhanttan norm.

norm2

public static double norm2(Matrix matrix)
2-norm -- maximum singular value.

Parameters:
matrix - Matrix.
Returns:
Maximum singular value.

normInfinity

public static double normInfinity(Matrix matrix)
Infinity norm -- maximum row sum.

Parameters:
matrix - Matrix.
Returns:
Maximum row sum.

normFrobenius

public static double normFrobenius(Matrix matrix)
Frobenius norm -- square root of sum of squares of all entries.

Parameters:
matrix - Matrix.
Returns:
Frobenius norm.

product

public static double product(Matrix matrix)
Product of all matrix values.

Parameters:
matrix - Matrix.
Returns:
Product of all matrix values.

rank

public static int rank(Matrix matrix)
Rank of matrix.

Parameters:
matrix - Matrix.
Returns:
Rank.

The rank is computed from the Singular Value Decomposition.


sum

public static double sum(Matrix matrix)
Sum of all matrix values.

Parameters:
matrix - Matrix.
Returns:
Sum of all matrix values.

trace

public static double trace(Matrix matrix)
Trace of matrix.

Parameters:
matrix - Matrix.
Returns:
Trace of matrix.