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

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

public class RowTransformer
extends java.lang.Object

RowTransformer performs operations that can be carried out on rows of a matrix.

Given a matrix of dimension mxn M -yields- C, where C is a column vector of dimension mx1.


Constructor Summary
protected RowTransformer()
          Don't allow instantiation but do allow overrides.
 
Method Summary
static Matrix max(Matrix matrix)
          Gets maximum element in each row and returns them as a column vector.
static Matrix mean(Matrix matrix, boolean adjustment)
          Get means of all the elements in a row.
static Matrix min(Matrix matrix)
          Gets minimum element in each column and returns them in a row vector.
static Matrix product(Matrix matrix)
          Multiplies all elements in a row and returns them as a column vector.
static Matrix sum(Matrix matrix)
          Sums all rows and returns sums as a column vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowTransformer

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

Method Detail

sum

public static Matrix sum(Matrix matrix)
Sums all rows and returns sums as a column vector.

Parameters:
matrix - The matrix.
Returns:
c(mx1) column vector with row sums.

product

public static Matrix product(Matrix matrix)
Multiplies all elements in a row and returns them as a column vector.

Parameters:
matrix - The matrix.
Returns:
c(mx1) column vector with row products.

mean

public static Matrix mean(Matrix matrix,
                          boolean adjustment)
Get means of all the elements in a row.

Parameters:
matrix - The matrix.
adjustment - True to divide sums by (#rows - 1) instead of #rows.
Returns:
c(mx1) column vector with row means.

max

public static Matrix max(Matrix matrix)
Gets maximum element in each row and returns them as a column vector.

Parameters:
matrix - The matrix.
Returns:
c(mx1) column vector with each row's maximum value.

min

public static Matrix min(Matrix matrix)
Gets minimum element in each column and returns them in a row vector.

Parameters:
matrix - The matrix.
Returns:
c(mx1) column vector with each row's minimum value.