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

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

public class ColumnTransformer
extends java.lang.Object

ColumnTransformer -- operations that can be carried out on columns of a matrix.

Given a matrix of dimension mxn M -yields-> R, where R is a row vector of dimension 1xn.


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

Constructor Detail

ColumnTransformer

protected ColumnTransformer()
Don't allow instantiations but do allow overrides.

Method Detail

applyColumnOperation

public static Matrix applyColumnOperation(Matrix matrix,
                                          ColumnTransformation columnTransformation)
Apply a column operation.

Parameters:
matrix - The matrix.
columnTransformation - The column transformation.
Returns:
The transformed matrix.

sum

public static Matrix sum(Matrix matrix)
Sums all the columns and returns them as a row vector.

Parameters:
matrix - The matrix.
Returns:
r(1xn) row vector with column sums.

product

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

Parameters:
matrix - The matrix.
Returns:
r(1xn) row vector with column products.

mean

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

Parameters:
matrix - The matrix.
adjustment - true to divide sum of values by (rows - 1) instead of rows.
Returns:
r(1xn) row vector with column means.

max

public static Matrix max(Matrix matrix)
Get maximum elements for each column as a row vector.

Parameters:
matrix - The matrix.
Returns:
r(1xn) row vector with each column's maximum value.

min

public static Matrix min(Matrix matrix)
Get minimum elements for each column as a row vector.

Parameters:
matrix - The matrix.
Returns:
r(1xn) row vector with each column's minimum value.