sugr.test
Class MatrixTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bysugr.test.MatrixTest
All Implemented Interfaces:
junit.framework.Test

public class MatrixTest
extends junit.framework.TestCase

Author:
Bastian Oehler

Constructor Summary
MatrixTest(java.lang.String arg0)
          Constructor for MatrixTest.
 
Method Summary
 double[][] getDoubleArray(int row, int col, int c)
          Get a double array with values from 0 to (rowDim*colDim)-1
 double[][] getDoubleArrayEven(int row, int col, double val)
          Get a double array with value val at every position
 double[][] getDoubleArrayRand(int row, int col, double val)
          Get a double array with random value from 0 to val
 void testDelColumn()
          Test for Matrix delColumn(int col)
 void testDelRow()
          Test for Matrix delRow(int)
 void testDet()
          Test for Matrix det()
 void testEig()
          Test for Matrix eig()
 void testEqualsObject()
          Test for boolean equals(Object)
 void testGet()
          Test for double get(int, int)
 void testGetColumn()
          Test for Vector getColumn(int)
 void testGetColumnDimension()
          Test for int getColumnDimension()
 void testGetMatrix()
          Test for Matrix getMatrix(int,int,int,int)
 void testGetRow()
          Test for Vector getRow(int)
 void testGetRowDimension()
          Test for int getRowDimension()
 void testInvert()
          Test for Matrix invert()
 void testIsSemiDefinite()
          Test for boolean isSemiDefinite()
 void testKronecker()
          Test for Matrix Kronecker(Matrix)
 void testMinus()
          Test for Matrix minus(Matrix)
 void testMultdouble()
          Test for Matrix mult(double)
 void testMultMatrix()
          Test for Matrix mult(Matrix)
 void testMultVector()
          Test for Vector mult(Vector)
 void testPlus()
          Test for Matrix plus(Matrix)
 void testPseudoInverse()
          Test for Matrix pseudoInverse(int)
 void testQr()
          Test for Matrix[] qr()
 void testSetColumn()
          Test for Matrix setColumn(int,Vector)
 void testSetdouble()
          Test for void set(double)
 void testSetintintdouble()
          Test for void set(int, int, double)
 void testSetRow()
          Test for Matrix setRow(int,Vector)
 void testSliceintArrayintArray()
          Test for Matrix slice(int[], int[])
 void testSliceintArrayintArrayMatrix()
          Test for void slice(int[], int[], Matrix)
 void testSliceintintintint()
          Test for Matrix slice(int, int, int, int) No need for a test, because it is the same method as getMatrix
 void testSliceintintintintMatrix()
          Test for void slice(int, int, int, int, Matrix)
 void testSolve()
          Test for Vector solve(Vector)
 void testSvd()
          Test for Matrix[] svd()
 void testTrans()
          Test for Matrix trans()
 void testVec()
          Test for Vector Vec()
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MatrixTest

public MatrixTest(java.lang.String arg0)
Constructor for MatrixTest.

Parameters:
arg0 -
Method Detail

getDoubleArray

public double[][] getDoubleArray(int row,
                                 int col,
                                 int c)
Get a double array with values from 0 to (rowDim*colDim)-1

Parameters:
row - number of rows
col - number of columns
c - c-1 Column/Row to delete 0 delets nothing
Returns:
double array with selected values

getDoubleArrayEven

public double[][] getDoubleArrayEven(int row,
                                     int col,
                                     double val)
Get a double array with value val at every position

Parameters:
row - number of rows
col - number of columns
val -
Returns:
(a x b) Matrix with entry val at every position

getDoubleArrayRand

public double[][] getDoubleArrayRand(int row,
                                     int col,
                                     double val)
Get a double array with random value from 0 to val

Parameters:
row - number of rows
col - number of columns
val -
Returns:
(a x b) Matrix with random value (0..val) at every position

testPlus

public void testPlus()
Test for Matrix plus(Matrix)


testMinus

public void testMinus()
Test for Matrix minus(Matrix)


testMultMatrix

public void testMultMatrix()
Test for Matrix mult(Matrix)


testTrans

public void testTrans()
Test for Matrix trans()


testGet

public void testGet()
Test for double get(int, int)


testSetintintdouble

public void testSetintintdouble()
Test for void set(int, int, double)


testGetRowDimension

public void testGetRowDimension()
Test for int getRowDimension()


testGetColumnDimension

public void testGetColumnDimension()
Test for int getColumnDimension()


testInvert

public void testInvert()
Test for Matrix invert()


testMultdouble

public void testMultdouble()
Test for Matrix mult(double)


testMultVector

public void testMultVector()
Test for Vector mult(Vector)


testSvd

public void testSvd()
Test for Matrix[] svd()


testSliceintArrayintArray

public void testSliceintArrayintArray()
Test for Matrix slice(int[], int[])


testSliceintArrayintArrayMatrix

public void testSliceintArrayintArrayMatrix()
Test for void slice(int[], int[], Matrix)


testSliceintintintintMatrix

public void testSliceintintintintMatrix()
Test for void slice(int, int, int, int, Matrix)


testVec

public void testVec()
Test for Vector Vec()


testSetdouble

public void testSetdouble()
Test for void set(double)


testEqualsObject

public void testEqualsObject()
Test for boolean equals(Object)


testGetMatrix

public void testGetMatrix()
Test for Matrix getMatrix(int,int,int,int)


testEig

public void testEig()
Test for Matrix eig()


testIsSemiDefinite

public void testIsSemiDefinite()
Test for boolean isSemiDefinite()


testPseudoInverse

public void testPseudoInverse()
Test for Matrix pseudoInverse(int)


testKronecker

public void testKronecker()
Test for Matrix Kronecker(Matrix)


testDet

public void testDet()
Test for Matrix det()


testGetColumn

public void testGetColumn()
Test for Vector getColumn(int)


testGetRow

public void testGetRow()
Test for Vector getRow(int)


testSetRow

public void testSetRow()
Test for Matrix setRow(int,Vector)


testSetColumn

public void testSetColumn()
Test for Matrix setColumn(int,Vector)


testSolve

public void testSolve()
Test for Vector solve(Vector)


testDelColumn

public void testDelColumn()
Test for Matrix delColumn(int col)


testDelRow

public void testDelRow()
Test for Matrix delRow(int)


testSliceintintintint

public void testSliceintintintint()
Test for Matrix slice(int, int, int, int) No need for a test, because it is the same method as getMatrix


testQr

public void testQr()
Test for Matrix[] qr()