org.mymedialite.datatype
Class SparseMatrixExtensions

java.lang.Object
  extended by org.mymedialite.datatype.SparseMatrixExtensions

public class SparseMatrixExtensions
extends java.lang.Object

Utilities to work with matrices.


Method Summary
static double frobeniusNorm(SparseMatrix<java.lang.Double> matrix)
          Compute the Frobenius norm (square root of the sum of squared entries) of a matrix.
static double maxDouble(SparseMatrix<java.lang.Double> m)
          Return the maximum value contained in a matrix.
static float maxFloat(SparseMatrix<java.lang.Float> m)
          Return the maximum value contained in a matrix.
static int maxInteger(SparseMatrix<java.lang.Integer> m)
          Return the maximum value contained in a matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

maxInteger

public static int maxInteger(SparseMatrix<java.lang.Integer> m)
Return the maximum value contained in a matrix.

Parameters:
m - the matrix

maxDouble

public static double maxDouble(SparseMatrix<java.lang.Double> m)
Return the maximum value contained in a matrix.

Parameters:
m - the matrix

maxFloat

public static float maxFloat(SparseMatrix<java.lang.Float> m)
Return the maximum value contained in a matrix.

Parameters:
m - the matrix

frobeniusNorm

public static double frobeniusNorm(SparseMatrix<java.lang.Double> matrix)
Compute the Frobenius norm (square root of the sum of squared entries) of a matrix. See http://en.wikipedia.org/wiki/Matrix_norm

Parameters:
matrix - the matrix
Returns:
the Frobenius norm of the matrix