org.apache.commons.math.linear
Class EigenDecompositionImplTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.math.linear.EigenDecompositionImplTest
All Implemented Interfaces:
junit.framework.Test

public class EigenDecompositionImplTest
extends junit.framework.TestCase


Constructor Summary
EigenDecompositionImplTest(String name)
           
 
Method Summary
protected  void checkEigenValues(double[] targetValues, org.apache.commons.math.linear.EigenDecomposition ed, double tolerance)
          Verifies that the given EigenDecomposition has eigenvalues equivalent to the targetValues, ignoring the order of the values and allowing values to differ by tolerance.
protected  void checkEigenVector(double[] eigenVector, org.apache.commons.math.linear.EigenDecomposition ed, double tolerance)
          Returns true iff eigenVector is a scalar multiple of one of the columns of ed.getV().
static org.apache.commons.math.linear.RealMatrix createDiagonalMatrix(double[] diagonal, int rows, int columns)
           
static org.apache.commons.math.linear.RealMatrix createOrthogonalMatrix(Random r, int size)
           
 void setUp()
           
static junit.framework.Test suite()
           
 void tearDown()
           
 void testAEqualVDVt()
          test A = VDVt
 void testBigMatrix()
          test eigenvalues for a big matrix.
 void testDiagonal()
          test diagonal matrix
 void testDimension1()
           
 void testDimension2()
           
 void testDimension3()
           
 void testDimension4WithoutSplit()
           
 void testDimension4WithSplit()
           
 void testDimensions()
          test dimensions
 void testDistinctEigenvalues()
          Matrix with eigenvalues {2, 0, 12}
 void testEigenvalues()
          test eigenvalues
 void testEigenvectors()
          test eigenvectors
 void testRepeatedEigenvalue()
          Matrix with eigenvalues {8, -1, -1}
 void testTridiagonal()
          test a matrix already in tridiagonal form.
 void testVOrthogonal()
          test that V is orthogonal
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EigenDecompositionImplTest

public EigenDecompositionImplTest(String name)
Method Detail

suite

public static junit.framework.Test suite()

testDimension1

public void testDimension1()

testDimension2

public void testDimension2()

testDimension3

public void testDimension3()

testDimension4WithSplit

public void testDimension4WithSplit()

testDimension4WithoutSplit

public void testDimension4WithoutSplit()

testTridiagonal

public void testTridiagonal()
test a matrix already in tridiagonal form.


testDimensions

public void testDimensions()
test dimensions


testEigenvalues

public void testEigenvalues()
test eigenvalues


testBigMatrix

public void testBigMatrix()
test eigenvalues for a big matrix.


testEigenvectors

public void testEigenvectors()
test eigenvectors


testAEqualVDVt

public void testAEqualVDVt()
test A = VDVt


testVOrthogonal

public void testVOrthogonal()
test that V is orthogonal


testDiagonal

public void testDiagonal()
test diagonal matrix


testRepeatedEigenvalue

public void testRepeatedEigenvalue()
Matrix with eigenvalues {8, -1, -1}


testDistinctEigenvalues

public void testDistinctEigenvalues()
Matrix with eigenvalues {2, 0, 12}


checkEigenValues

protected void checkEigenValues(double[] targetValues,
                                org.apache.commons.math.linear.EigenDecomposition ed,
                                double tolerance)
Verifies that the given EigenDecomposition has eigenvalues equivalent to the targetValues, ignoring the order of the values and allowing values to differ by tolerance.


checkEigenVector

protected void checkEigenVector(double[] eigenVector,
                                org.apache.commons.math.linear.EigenDecomposition ed,
                                double tolerance)
Returns true iff eigenVector is a scalar multiple of one of the columns of ed.getV(). Does not try linear combinations - i.e., should only be used to find vectors in one-dimensional eigenspaces.


setUp

public void setUp()
Overrides:
setUp in class junit.framework.TestCase

tearDown

public void tearDown()
Overrides:
tearDown in class junit.framework.TestCase

createOrthogonalMatrix

public static org.apache.commons.math.linear.RealMatrix createOrthogonalMatrix(Random r,
                                                                               int size)

createDiagonalMatrix

public static org.apache.commons.math.linear.RealMatrix createDiagonalMatrix(double[] diagonal,
                                                                             int rows,
                                                                             int columns)


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.