sugr.test
Class Point_2DTest

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

public class Point_2DTest
extends junit.framework.TestCase

This class tests the Point_2D class. The most important test is the test of the constructor Point_2D(Line_2D,Line_2D); Errorpropagation is tested with the help of the TestStatistics class, which calculates sigma in many iterations from gaussian random numbers.

Author:
Achim Königs

Field Summary
static int MAXITER
          int MAXITER determines how many iterations there are for calculation of the statstic parts.
 
Constructor Summary
Point_2DTest(java.lang.String arg0)
          Constructor for Point_2DTest.
 
Method Summary
 boolean helpPoint_2DLine_2DLine_2DStatistics(Line_2D line1, Line_2D line2, double sigma)
          Method to test the statistic reasoning of a point out of two uncertain lines.
 void testCopy()
          Test for copy()
 void testGetDegreesOfFreedom()
          Test for getDegreesOfFreedom(); Test's Degrees of Freedom, should be 2, and tries another Point, which should return the same value.
 void testGetDimension()
          Test for getDimension(); Test dimension of one point, which should be three then it takes another one, and test if they have the same dimensions, as proposed.
 void testGetDistance()
          Test of getDistance() calculates the distance for some points at infinity then calculates the distance between two points for one million times.
 void testGetDistanceToOrigin()
          Test for getDistanceToOrigin()
 void testGetDofOfRelation()
          int getDofOfRelation(Class, Class) Tests the dimmensions of freedom for the Relations.
 void testGetEuclideanPart()
          Test for getEuclideanPart(); Generates two Points.
 void testGetHomogeneousPart()
          Test for getHomogenousePart() Takes two Points and tests the returned homogenous Parts.
 void testGetJacobianOfRelationClassClass()
          Test for Matrix getJacobianOfRelation(Class, Class) First tests the returned matrices if they fullfill the constraint f(x)*y = 0.
 void testNormalizeEuclidean()
          Test of normalizeEuclidean(), homogenous Part should be 1 here after tests over one million points without covariances.
 void testPoint_2D()
          Test for void Point_2D()
 void testPoint_2Ddoubledouble()
          Test for void Point_2D(double, double)
 void testPoint_2Ddoubledoubledouble()
          Test for void Point_2D(double, double, double)
 void testPoint_2Ddoubledoubledoubledouble()
          Test for void Point_2D(x,y,sigma_x,sigma_y);
 void testPoint_2DdoubledoubledoubleMatrix()
          Test for void Point_2D(double, double, double, Matrix)
 void testPoint_2DdoubledoubleMatrix()
          Test for void Point_2D(double, double, Matrix)
 void testPoint_2DLine_2DLine_2D()
          Test for void Point_2D(Line_2D, Line_2D) Includes test for the cov-matrices
 void testPoint_2DVectorMatrix()
          Test for void Point_2D(Vector, Matrix)
 void testSkewSym()
          Test for Matrix SkewSym()
 void testSkewSymVector()
          Test for Matrix SkewSym(Vector)
 
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
 

Field Detail

MAXITER

public static int MAXITER
int MAXITER determines how many iterations there are for calculation of the statstic parts. It should be around 100 000 for good results, but this may mean much work for your maschine and some coffee for you, if you are waiting for the results.

Constructor Detail

Point_2DTest

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

Parameters:
arg0 -
Method Detail

helpPoint_2DLine_2DLine_2DStatistics

public boolean helpPoint_2DLine_2DLine_2DStatistics(Line_2D line1,
                                                    Line_2D line2,
                                                    double sigma)
Method to test the statistic reasoning of a point out of two uncertain lines.

Parameters:
line1 - - first line to be crossed with second line
line2 - - second line
Returns:
- true if test is successful

testGetDegreesOfFreedom

public void testGetDegreesOfFreedom()
Test for getDegreesOfFreedom(); Test's Degrees of Freedom, should be 2, and tries another Point, which should return the same value.


testGetDimension

public void testGetDimension()
Test for getDimension(); Test dimension of one point, which should be three then it takes another one, and test if they have the same dimensions, as proposed.


testGetEuclideanPart

public void testGetEuclideanPart()
Test for getEuclideanPart(); Generates two Points. Get's the eucledean Part from each and compares them two the values the should have.


testGetHomogeneousPart

public void testGetHomogeneousPart()
Test for getHomogenousePart() Takes two Points and tests the returned homogenous Parts.


testGetJacobianOfRelationClassClass

public void testGetJacobianOfRelationClassClass()
Test for Matrix getJacobianOfRelation(Class, Class) First tests the returned matrices if they fullfill the constraint f(x)*y = 0. Then it tests if the matrices have the right values. At last it tests if getJacobianOfRelation throws an exception for every forbidden combination of classes.


testGetDofOfRelation

public void testGetDofOfRelation()
int getDofOfRelation(Class, Class) Tests the dimmensions of freedom for the Relations. Tests also if function throws exception for every forbidden combination.


testNormalizeEuclidean

public void testNormalizeEuclidean()
Test of normalizeEuclidean(), homogenous Part should be 1 here after tests over one million points without covariances. then tests some points with covariances to test error propagation.


testGetDistance

public void testGetDistance()
Test of getDistance() calculates the distance for some points at infinity then calculates the distance between two points for one million times. Tests distance to a line.


testPoint_2DVectorMatrix

public void testPoint_2DVectorMatrix()
Test for void Point_2D(Vector, Matrix)


testPoint_2Ddoubledouble

public void testPoint_2Ddoubledouble()
Test for void Point_2D(double, double)


testPoint_2DdoubledoubleMatrix

public void testPoint_2DdoubledoubleMatrix()
Test for void Point_2D(double, double, Matrix)


testPoint_2Ddoubledoubledouble

public void testPoint_2Ddoubledoubledouble()
Test for void Point_2D(double, double, double)


testPoint_2DdoubledoubledoubleMatrix

public void testPoint_2DdoubledoubledoubleMatrix()
Test for void Point_2D(double, double, double, Matrix)


testPoint_2Ddoubledoubledoubledouble

public void testPoint_2Ddoubledoubledoubledouble()
Test for void Point_2D(x,y,sigma_x,sigma_y);


testPoint_2DLine_2DLine_2D

public void testPoint_2DLine_2DLine_2D()
Test for void Point_2D(Line_2D, Line_2D) Includes test for the cov-matrices


testPoint_2D

public void testPoint_2D()
Test for void Point_2D()


testCopy

public void testCopy()
Test for copy()


testSkewSymVector

public void testSkewSymVector()
Test for Matrix SkewSym(Vector)


testSkewSym

public void testSkewSym()
Test for Matrix SkewSym()


testGetDistanceToOrigin

public void testGetDistanceToOrigin()
Test for getDistanceToOrigin()