at.tuwien.ifs.feature.extraction.audio.data
Class RealMatrixExt

java.lang.Object
  extended by org.apache.commons.math.linear.RealMatrixImpl
      extended by at.tuwien.ifs.feature.extraction.audio.data.RealMatrixExt
All Implemented Interfaces:
java.io.Serializable, org.apache.commons.math.linear.RealMatrix

public class RealMatrixExt
extends org.apache.commons.math.linear.RealMatrixImpl

Copyright Vienna University of Technology

Version:
$Id: RealMatrixExt.java 173 2010-06-17 16:28:05Z mayer $
Author:
Thomas Lidy
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
private  int type
           
static int TYPE_RH
           
static int TYPE_RP
           
static int TYPE_SSD
           
static int TYPE_UNKNOWN
           
 
Fields inherited from class org.apache.commons.math.linear.RealMatrixImpl
TOO_SMALL
 
Constructor Summary
RealMatrixExt(double[] vector)
          Create a new (column) RealMatrix using vector as the data for the unique column of the vector.length x 1 matrix created.
RealMatrixExt(double[][] matrix)
          Create a new RealMatrix using the input 2D double array as matrix.
RealMatrixExt(int rowDimension, int columnDimension)
          Create a new RealMatrix with the supplied row and column dimensions.
 
Method Summary
 int getType()
          returns type (ID) of matrix
 double[] meanColumns()
           
 double[] meanRows()
           
static RealMatrixExt median(RealMatrixExt[] matrices)
          Computes a median matrix from an array of matrices (taking the median of every single element)
 void setType(int type)
          sets type (ID) of matrix
 double[] sumColumns()
           
 double[] sumRows()
           
 double[] vectorize()
          vectorize the matrix (i.e.
 
Methods inherited from class org.apache.commons.math.linear.RealMatrixImpl
add, copy, equals, getColumn, getColumnDimension, getColumnMatrix, getData, getDataRef, getDeterminant, getEntry, getIdentity, getLUMatrix, getNorm, getPermutation, getRow, getRowDimension, getRowMatrix, getSubMatrix, getSubMatrix, getTrace, hashCode, inverse, isSingular, isSquare, luDecompose, multiply, operate, preMultiply, preMultiply, scalarAdd, scalarMultiply, setSubMatrix, solve, solve, subtract, toString, transpose
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
See Also:
Constant Field Values

TYPE_RP

public static final int TYPE_RP
See Also:
Constant Field Values

TYPE_SSD

public static final int TYPE_SSD
See Also:
Constant Field Values

TYPE_RH

public static final int TYPE_RH
See Also:
Constant Field Values

type

private int type
Constructor Detail

RealMatrixExt

public RealMatrixExt(double[] vector)
Create a new (column) RealMatrix using vector as the data for the unique column of the vector.length x 1 matrix created.


RealMatrixExt

public RealMatrixExt(double[][] matrix)
Create a new RealMatrix using the input 2D double array as matrix.

Parameters:
matrix -

RealMatrixExt

public RealMatrixExt(int rowDimension,
                     int columnDimension)
Create a new RealMatrix with the supplied row and column dimensions.

Parameters:
rowDimension -
columnDimension -
Method Detail

setType

public void setType(int type)
sets type (ID) of matrix

Parameters:
type - integer type ID (may be one of the static type IDs of this class)

getType

public int getType()
returns type (ID) of matrix

Returns:
integer type ID (probably one of the static type IDs of this class)

vectorize

public double[] vectorize()
vectorize the matrix (i.e. concatenate column for column to a vector )


sumRows

public double[] sumRows()
Returns:
the sum of all rows per row (i.e. the length of the resulting double array will equal the number of rows)

meanRows

public double[] meanRows()
Returns:
the mean per row (i.e. the length of the resulting double array will equal the number of rows)

sumColumns

public double[] sumColumns()
Returns:
the sum of all columns (i.e. the length of the resulting double array will equal the number of columns)

meanColumns

public double[] meanColumns()
Returns:
the mean per column (i.e. the length of the resulting double array will equal the number of columns)

median

public static RealMatrixExt median(RealMatrixExt[] matrices)
Computes a median matrix from an array of matrices (taking the median of every single element)

Parameters:
matrices - an array of matrices
Returns:
a matrix which contains the median of every element of the given matrices