Package com.irurueta.geometry.refiners
Class Refiner<T>
java.lang.Object
com.irurueta.geometry.refiners.Refiner<T>
- Type Parameters:
T- type of instance to be refined.
- Direct Known Subclasses:
InliersDataRefiner
Refines an instance of type T by taking into account an initial estimation.
This class can be used to find a solution that minimizes error of inliers in
LMSE terms.
Typically, a refiner is used by a robust estimator, however it can also be
useful in some other situations.
This is a base abstract class to be used by any refiner implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.irurueta.algebra.MatrixEstimated covariance after refinement.static final booleanIndicates whether by default covariance of estimation must be kept.protected TInitial estimation.protected booleanIndicates whether covariance of estimation must be kept after refinement.protected RefinerListener<T> Listener in charge of attending events generated by this instance.protected booleanIndicates if this estimator is locked because a refinement is being computed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.irurueta.algebra.MatrixGets estimated covariance after refinement.Gets initial estimation.Gets listener in charge of attending events generated by this instance.booleanIndicates whether covariance of estimation must be kept after refinement or not.booleanisLocked()Indicates if this estimator is locked because a refinement is being computed.abstract booleanisReady()Indicates whether this refiner is ready to start refinement computation.abstract Trefine()Refines provided initial estimation.abstract booleanRefines provided initial estimation.voidsetCovarianceKept(boolean keepCovariance) Specifies whether covariance of estimation must be kept after refinement or not.voidsetInitialEstimation(T initialEstimation) Sets initial estimation.voidsetListener(RefinerListener<T> listener) Sets listener in charge of attending events generated by this instance.
-
Field Details
-
DEFAULT_KEEP_COVARIANCE
public static final boolean DEFAULT_KEEP_COVARIANCEIndicates whether by default covariance of estimation must be kept.- See Also:
-
initialEstimation
Initial estimation. -
keepCovariance
protected boolean keepCovarianceIndicates whether covariance of estimation must be kept after refinement. -
covariance
protected com.irurueta.algebra.Matrix covarianceEstimated covariance after refinement. -
locked
protected boolean lockedIndicates if this estimator is locked because a refinement is being computed. -
listener
Listener in charge of attending events generated by this instance.
-
-
Constructor Details
-
Refiner
protected Refiner()Constructor. -
Refiner
Constructor.- Parameters:
initialEstimation- initial estimation to be set.keepCovariance- true if covariance of estimation must be kept after refinement, false otherwise.
-
-
Method Details
-
getListener
Gets listener in charge of attending events generated by this instance.- Returns:
- listener in charge of attending events generated by this instance.
-
setListener
Sets listener in charge of attending events generated by this instance.- Parameters:
listener- listener in charge of attending events generated by this instance.
-
getInitialEstimation
Gets initial estimation.- Returns:
- initial estimation.
-
setInitialEstimation
Sets initial estimation.- Parameters:
initialEstimation- initial estimation.- Throws:
LockedException- if estimator is locked.
-
isCovarianceKept
public boolean isCovarianceKept()Indicates whether covariance of estimation must be kept after refinement or not.- Returns:
- true if covariance of estimation must be kept after refinement, false otherwise.
-
setCovarianceKept
Specifies whether covariance of estimation must be kept after refinement or not.- Parameters:
keepCovariance- true if covariance of estimation must be kept after refinement, false otherwise.- Throws:
LockedException- if estimator is locked.
-
isLocked
public boolean isLocked()Indicates if this estimator is locked because a refinement is being computed.- Returns:
- true if estimator is locked, false otherwise.
-
getCovariance
public com.irurueta.algebra.Matrix getCovariance()Gets estimated covariance after refinement.- Returns:
- estimated covariance after refinement.
-
isReady
public abstract boolean isReady()Indicates whether this refiner is ready to start refinement computation.- Returns:
- true if refiner is ready, false otherwise.
-
refine
public abstract boolean refine(T result) throws NotReadyException, LockedException, RefinerException Refines provided initial estimation. Notice that implementations of this method might set a value into result even if error is not improved in LMSE terms.- Parameters:
result- instance where refined estimation will be stored.- Returns:
- true if result improves (decreases) in LMSE terms respect to initial estimation, false if no improvement has been achieved.
- Throws:
NotReadyException- if not enough input data has been provided.LockedException- if estimator is locked because refinement is already in progress.RefinerException- if refinement fails for some reason (e.g. unable to converge to a result).
-
refine
Refines provided initial estimation.- Returns:
- refined estimation.
- Throws:
NotReadyException- if not enough input data has been provided.LockedException- if estimator is locked because refinement is already in progress.RefinerException- if refinement fails for some reason (e.g. unable to converge to a result).
-