sugr
Class Entity

java.lang.Object
  extended bysugr.Element
      extended bysugr.Entity
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
Object_2D, Object_3D

public abstract class Entity
extends Element

Entity is the super-class of Point_xD, Line_xD and Plane_3D. So it is a container for methods which are needed in all subclasses

Version:
2.0 This version holds a methods neccessary for an estimation of elements. (T. Laebe, 25.06.2003)
Author:
Norbert Fischer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class sugr.Element
cov, MAXITER, v
 
Constructor Summary
Entity()
           
 
Method Summary
 void doCondition(double f)
          Condition this element with a condition factor f.
 void doCondition(double[] f)
          Condition that element with a set of conditioning factors.
static double doCondition(Entity[] elist)
          Do the conditioning of a set of entities.
 void ensureConstraintsWithoutIteration()
          Change the entity (covariance not changed) in that way, that all constraints (given by getConstraintValue) are fulfilled.
static double getConditionFactorF(Entity[] elist)
           calculates the condition factor which depends on a set of elements.
static double getConditionFactorF(Entity x, Entity y)
           calculates the condition factor which depends on two elements.
protected abstract  Matrix getConditionMatrix(double f)
          Get a matrix W(f) for conditioning.
abstract  Matrix getCovarianceOfJacobianRowOfRelation(java.lang.Class relationType, java.lang.Class partnerType, int row)
          Return Covariance of a Row of the Jacobian Matrix of that entity in combination with a relation.
abstract  int getDegreesOfFreedom()
          returns the degrees of freedem.
abstract  double getDistance(Entity entity)
          Compute the (euclidean) distance to another entity.
 double getDistanceToOrigin()
          Return the distance to the origin.
abstract  int getDofOfRelation(java.lang.Class relationType, java.lang.Class secondType)
           Compute degrees of freedom of a relation.
abstract  Vector getEuclideanPart()
          returns the euclidean part of an element
abstract  Vector getHomogeneousPart()
          returns the homogoneous part of an element
abstract  Matrix getJacobianOfRelation(java.lang.Class relationType, java.lang.Class partnerType)
          Return Jacobian Matrix of that entity in combination with a relation.
 Matrix getJacobianOfRelation(RelationalProperty r)
          Return Jacobian Matrix of that entity in combination with a relation.
 double getNormOfEuclideanPart()
          Return the (euclidean) norm of the euclidean part.
 double getNormOfHomogeneousPart()
          Return the (euclidean) norm of the homogenous part.
 boolean isEqual(Entity e)
          Checks, if this element and e are the same
 boolean isIncident(Entity e)
          checks, if this element and e are incident
 boolean isOrthogonal(Entity e)
          checks, if this element and e are orthogonal
 boolean isParallel(Entity e)
          checks, if this element and e are parallel
abstract  void normalizeEuclidean()
          Normalize this element so, that homogeneous part has length 1
 void normalizeEuclideanComparable()
          Euclidean normalization with comparable result: To avoid a sign ambiguity the largest element |xi| of v is positive after this normalization.
 void transform(Transformation transformation)
          Transforms this Entity with a given Transformation
 
Methods inherited from class sugr.Element
approximate, calcCov, changeNullspace, changeNullspace, checkCovDim, checkElement, clone, ensureConstraints, estimate, estimate, gaussHelmertIterations, gaussHelmertIterationsOld, getConstraintValue, getCov, getDimension, getJacobianOfConstraint, getReducedAB, getV, normalizeSphere, normalizeSphereComparable, print, print, reduceFirstMatrix, reduceMatrix, reduceMatrix, setCov, setV, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Entity

public Entity()
Method Detail

getEuclideanPart

public abstract Vector getEuclideanPart()
returns the euclidean part of an element

Returns:
a Vector with euclidean part in it. Recall that an entity is parted in homogeneous and euclidean

getNormOfEuclideanPart

public double getNormOfEuclideanPart()
Return the (euclidean) norm of the euclidean part.

Returns:
the norm

getHomogeneousPart

public abstract Vector getHomogeneousPart()
returns the homogoneous part of an element

Returns:
a Vector with homogeneous part in it. Recall that an entity is parted in homogeneous and euclidean

getNormOfHomogeneousPart

public double getNormOfHomogeneousPart()
Return the (euclidean) norm of the homogenous part.

Returns:
the norm

getDegreesOfFreedom

public abstract int getDegreesOfFreedom()
returns the degrees of freedem. It is the minimum number of parameters to construct one entity
e.g.: If we have a Point_3D, the degree of freedom is 3

Specified by:
getDegreesOfFreedom in class Element
Returns:
a int

getJacobianOfRelation

public abstract Matrix getJacobianOfRelation(java.lang.Class relationType,
                                             java.lang.Class partnerType)
Return Jacobian Matrix of that entity in combination with a relation. If that entity is part of a relation then this relation has a constraint f(firstEntity)*secondEntity=g(secondEntity)*firstEntity=0. f and g are the Jacobians of these linear formulas. So return f or g (the choice f or g is given by the type of the entity !)

Parameters:
relationType - the type of the relation
partnerType - the type of the other partner in the relation
Returns:
Jacobian matrix (or part of the constraint formula)

getJacobianOfRelation

public Matrix getJacobianOfRelation(RelationalProperty r)
Return Jacobian Matrix of that entity in combination with a relation. If that entity is part of a relation then this relation has a constraint f(firstEntity)*secondEntity=g(secondEntity)*firstEntity=0. f and g are the Jacobians of these linear formulas. So return f or g (the choice f or g is given by the type of the entity !) This function returns the Jacobian after the first entity in the relation. Therefore *this is the second entity (The unknown in estimation, so this is the Jacobian after the observation)

Specified by:
getJacobianOfRelation in class Element
Parameters:
r - a (Bi)-Relational Property. From this property only the relation type and the type of the first Entity is used.
Returns:
Jacobian matrix (or part of the constraint formula)

getCovarianceOfJacobianRowOfRelation

public abstract Matrix getCovarianceOfJacobianRowOfRelation(java.lang.Class relationType,
                                                            java.lang.Class partnerType,
                                                            int row)
Return Covariance of a Row of the Jacobian Matrix of that entity in combination with a relation.

Parameters:
relationType - the type of the relation
partnerType - the type of the other partner in the relation
Returns:
Covariance of the row of the Jacobian matrix

getDofOfRelation

public abstract int getDofOfRelation(java.lang.Class relationType,
                                     java.lang.Class secondType)

Compute degrees of freedom of a relation.

Parameters:
relationType - the type of the relation
secondType - the type of the other partner in the relation
Returns:
degrees of freedom for the relation


normalizeEuclidean

public abstract void normalizeEuclidean()
Normalize this element so, that homogeneous part has length 1


normalizeEuclideanComparable

public void normalizeEuclideanComparable()
Euclidean normalization with comparable result: To avoid a sign ambiguity the largest element |xi| of v is positive after this normalization. This is slightly more expensive than normalizeEuclidean.


transform

public void transform(Transformation transformation)
Transforms this Entity with a given Transformation

Parameters:
transformation - Any allowed Transformation, like Homography_xD, Affinity_xD,...

getDistanceToOrigin

public double getDistanceToOrigin()
Return the distance to the origin.

Returns:
the distance to the origin.

getDistance

public abstract double getDistance(Entity entity)
Compute the (euclidean) distance to another entity. This is of course not possible for all combinations. In the case of an illegal combination an IllegalArgumentException should be thrown.

Parameters:
entity - the entity to which a distance should be computed.
Returns:
the distance to the given entity

isEqual

public boolean isEqual(Entity e)
Checks, if this element and e are the same

Parameters:
e - the element to be tested
Returns:
true, if they are the same, and false, if not

isParallel

public boolean isParallel(Entity e)
checks, if this element and e are parallel

Parameters:
e - the element to be tested
Returns:
true, if they are parallel, and false, if not

isIncident

public boolean isIncident(Entity e)
checks, if this element and e are incident

Parameters:
e - the element to be tested
Returns:
true, if they are incident, and false, if not

isOrthogonal

public boolean isOrthogonal(Entity e)
checks, if this element and e are orthogonal

Parameters:
e - the element to be tested
Returns:
true, if they are orthogonal, and false, if not

getConditionFactorF

public static double getConditionFactorF(Entity x,
                                         Entity y)

calculates the condition factor which depends on two elements. What is done: Find the element farthest away from the origin. Calculate the condition factor and apply this to all entities. Programmed after Stephan Heuels Dissertation (table 2.5 on page 37)

Parameters:
x - first element

y - second element

Returns:
a double with containing the condition factor


getConditionFactorF

public static double getConditionFactorF(Entity[] elist)

calculates the condition factor which depends on a set of elements. What is done: Find the element farthest away from the origin. Calculate the condition factor and apply this to all entities. Programmed after Stephan Heuels Dissertation (table 2.5 on page 37) with the following corrections (lae, 13.01.2004): The ratio is computed as mentioned in the text: euclidean/homogeneous. The condition is neccessary if this ration is GREATER than fmin. Then f is fmin/max_oh which corresponds to fmin*max_ho in the text.

Parameters:
elist - Array of Entities to be conditioned with the same factor

Returns:
a double with containing the condition factor. 1.0 is returned if no conditioning is neccessary.


doCondition

public static double doCondition(Entity[] elist)
Do the conditioning of a set of entities. This is done for avoiding bias and numerical problems for estimating and testing. If not switched of, the conditioning in done automatically while testing and estimating

Parameters:
elist - a set of Entities to condition
Returns:
the used conditioning factor

doCondition

public void doCondition(double f)
Condition this element with a condition factor f. The entity itself and the covariance matrix is changed. This is done to move the element closer to the euclidian origin.

Parameters:
f - conditioning factor

doCondition

public void doCondition(double[] f)
Condition that element with a set of conditioning factors. For an entity 1 conditioning factor is used. Overwritten from Element.

Specified by:
doCondition in class Element
Parameters:
f - conditioning factors.

getConditionMatrix

protected abstract Matrix getConditionMatrix(double f)
Get a matrix W(f) for conditioning. This matrix can be used to transform an entity to a conditioned one. This matrix multiplies the homogenous part with 1/f.

Parameters:
f - the conditioning factor
Returns:
the condition matrix

ensureConstraintsWithoutIteration

public void ensureConstraintsWithoutIteration()
Change the entity (covariance not changed) in that way, that all constraints (given by getConstraintValue) are fulfilled. This is done by a Gauss-Helmert-Iterations without unknowns.