Class PolynomialEstimator
java.lang.Object
com.irurueta.numerical.polynomials.estimators.PolynomialEstimator
- Direct Known Subclasses:
LMSEPolynomialEstimator,WeightedPolynomialEstimator
This class defines the interface for an estimator of a polynomial of a given
degree using points where polynomials are evaluated.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PolynomialEstimatorTypeDefault estimator type.protected intDegree of polynomial to be estimated.protected List<PolynomialEvaluation>Collection of polynomial evaluations and their corresponding point of evaluation used to determine a polynomial of required degree.protected PolynomialEstimatorListenerListener to be notified of events such as when estimation starts, ends or estimation progress changes.protected booleanTrue when estimator is estimating radial distortion.static final intMinimum allowed degree to be estimated -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedPolynomialEstimator(int degree) Constructor.protectedPolynomialEstimator(int degree, PolynomialEstimatorListener listener) Constructor.protectedPolynomialEstimator(int degree, List<PolynomialEvaluation> evaluations) Constructor.protectedPolynomialEstimator(int degree, List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener) Constructor.protectedConstructor.protectedPolynomialEstimator(List<PolynomialEvaluation> evaluations) Constructor.protectedPolynomialEstimator(List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic PolynomialEstimatorcreate()Creates an instance of a polynomial estimator using default type.static PolynomialEstimatorcreate(int degree) Creates an instance of a polynomial estimator using provided degree and default type.static PolynomialEstimatorcreate(int degree, PolynomialEstimatorListener listener) Creates an instance of a polynomial estimator using provided degree, listener and default type.static PolynomialEstimatorcreate(int degree, PolynomialEstimatorListener listener, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided degree, listener and type.static PolynomialEstimatorcreate(int degree, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided degree and type.static PolynomialEstimatorcreate(int degree, List<PolynomialEvaluation> evaluations) Creates an instance of a polynomial estimator using provided degree, polynomial evaluations and default type.static PolynomialEstimatorcreate(int degree, List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener) Creates an instance of a polynomial estimator using provided degree, evaluations, listener and default type.static PolynomialEstimatorcreate(int degree, List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided degree, evaluations, listener and type.static PolynomialEstimatorcreate(int degree, List<PolynomialEvaluation> evaluations, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided degree, evaluations and type.static PolynomialEstimatorcreate(PolynomialEstimatorListener listener) Creates an instance of a polynomial estimator using provided listener and default type and degree.static PolynomialEstimatorcreate(PolynomialEstimatorListener listener, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided listener and type.static PolynomialEstimatorCreates an instance of a polynomial estimator using provided type and default degree.static PolynomialEstimatorcreate(List<PolynomialEvaluation> evaluations) Creates an instance of a polynomial estimator using provided evaluations, and default type and degree.static PolynomialEstimatorcreate(List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener) Creates an instance of a polynomial estimator using provided evaluations, listener and default type.static PolynomialEstimatorcreate(List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided evaluations, listener and type.static PolynomialEstimatorcreate(List<PolynomialEvaluation> evaluations, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided evaluations and type.abstract Polynomialestimate()Estimates a polynomial based on provided evaluations.protected voidfillDerivativeEvaluation(DerivativePolynomialEvaluation evaluation, com.irurueta.algebra.Matrix a, com.irurueta.algebra.Matrix b, int row) Fills row of system of equations for a derivative polynomial evaluation.protected voidfillDirectEvaluation(DirectPolynomialEvaluation evaluation, com.irurueta.algebra.Matrix a, com.irurueta.algebra.Matrix b, int row) Fills row of system of equations for a direct polynomial evaluation.protected voidfillIntegralEvaluation(IntegralPolynomialEvaluation evaluation, com.irurueta.algebra.Matrix a, com.irurueta.algebra.Matrix b, int row) Fills row of system of equations for an integral polynomial evaluation.protected voidfillIntegralIntervalEvaluation(IntegralIntervalPolynomialEvaluation evaluation, com.irurueta.algebra.Matrix a, com.irurueta.algebra.Matrix b, int row) Fills row of system of equations for a polynomial evaluation of an interval integration.intGets degree of polynomial to be estimated.Gets collection of polynomial evaluations and their corresponding point of evaluation used to determine a polynomial of required degree.Gets listener to be notified of events such as when estimation starts, ends or estimation progress changes.intGets minimum number of evaluations required to estimate a polynomial of the specified degree.static intgetMinNumberOfEvaluations(int degree) Gets minimum number of evaluations required to estimate a polynomial of the specified degree.abstract PolynomialEstimatorTypegetType()Returns type of polynomial estimator.private voidinternalSetDegree(int degree) Internal method to set degree of polynomial to be estimated.booleanisLocked()Indicates whether this instance is locked.booleanisReady()Determines whether estimation is ready to start with the given data and required degree of polynomial to be estimatedprotected voidnormalize(com.irurueta.algebra.Matrix a, com.irurueta.algebra.Matrix b, int row) Normalizes rows of system matrix and values matrix to increase accuracy of linear system of equations to be solved.voidsetDegree(int degree) Sets degree of polynomial to be estimated.voidsetDegreeAndEvaluations(int degree, List<PolynomialEvaluation> evaluations) Sets degree of polynomial to be estimated and collection of polynomial evaluations and their corresponding point of evaluation used to determine a polynomial of specified degree.voidsetEvaluations(List<PolynomialEvaluation> evaluations) Sets collection of polynomial evaluations and their corresponding point of evaluation used to determine a polynomial of required degree.voidsetListener(PolynomialEstimatorListener listener) Sets listener to be notified of events such as when estimation starts, ends or estimation progress changes.
-
Field Details
-
MIN_DEGREE
public static final int MIN_DEGREEMinimum allowed degree to be estimated- See Also:
-
DEFAULT_ESTIMATOR_TYPE
Default estimator type. -
degree
protected int degreeDegree of polynomial to be estimated. -
evaluations
Collection of polynomial evaluations and their corresponding point of evaluation used to determine a polynomial of required degree. -
locked
protected boolean lockedTrue when estimator is estimating radial distortion. -
listener
Listener to be notified of events such as when estimation starts, ends or estimation progress changes.
-
-
Constructor Details
-
PolynomialEstimator
protected PolynomialEstimator()Constructor. -
PolynomialEstimator
protected PolynomialEstimator(int degree) Constructor.- Parameters:
degree- degree of polynomial to be estimated.- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
PolynomialEstimator
Constructor.- Parameters:
evaluations- collection of polynomial evaluations.
-
PolynomialEstimator
Constructor.- Parameters:
listener- listener to be notified of events.
-
PolynomialEstimator
Constructor.- Parameters:
degree- degree of polynomial to be estimated.evaluations- collection of polynomial evaluations.- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
PolynomialEstimator
Constructor.- Parameters:
degree- degree of polynomial to be estimated.listener- listener to be notified of events.- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
PolynomialEstimator
protected PolynomialEstimator(List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener) Constructor.- Parameters:
evaluations- collection of polynomial evaluations.listener- listener to be notified of events.
-
PolynomialEstimator
protected PolynomialEstimator(int degree, List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener) Constructor.- Parameters:
degree- degree of polynomial to be estimated.evaluations- collection of polynomial evaluations.listener- listener to be notified of events.- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
-
Method Details
-
getDegree
public int getDegree()Gets degree of polynomial to be estimated.- Returns:
- degree of polynomial to be estimated.
-
setDegree
Sets degree of polynomial to be estimated.- Parameters:
degree- degree of polynomial to be estimated.- Throws:
IllegalArgumentException- if provided degree is less than 1.LockedException- if this instance is locked.
-
getEvaluations
Gets collection of polynomial evaluations and their corresponding point of evaluation used to determine a polynomial of required degree.- Returns:
- collection of polynomial evaluations.
-
setEvaluations
Sets collection of polynomial evaluations and their corresponding point of evaluation used to determine a polynomial of required degree.- Parameters:
evaluations- collection of polynomial evaluations.- Throws:
LockedException- if this instance is locked.
-
setDegreeAndEvaluations
public void setDegreeAndEvaluations(int degree, List<PolynomialEvaluation> evaluations) throws LockedException Sets degree of polynomial to be estimated and collection of polynomial evaluations and their corresponding point of evaluation used to determine a polynomial of specified degree.- Parameters:
degree- degree of polynomial to be estimated.evaluations- collection of polynomial evaluations.- Throws:
IllegalArgumentException- if provided degree is less than 1.LockedException- if this instance is locked.
-
isReady
public boolean isReady()Determines whether estimation is ready to start with the given data and required degree of polynomial to be estimated- Returns:
- true if estimator is ready, false otherwise.
-
getMinNumberOfEvaluations
public static int getMinNumberOfEvaluations(int degree) Gets minimum number of evaluations required to estimate a polynomial of the specified degree.- Parameters:
degree- degree of polynomial to be estimated.- Returns:
- number of required evaluations.
- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
getMinNumberOfEvaluations
public int getMinNumberOfEvaluations()Gets minimum number of evaluations required to estimate a polynomial of the specified degree.- Returns:
- number of required evaluations.
-
isLocked
public boolean isLocked()Indicates whether this instance is locked.- Returns:
- true if this estimator is busy estimating a polynomial, false otherwise.
-
getListener
Gets listener to be notified of events such as when estimation starts, ends or estimation progress changes.- Returns:
- listener to be notified of events.
-
setListener
Sets listener to be notified of events such as when estimation starts, ends or estimation progress changes.- Parameters:
listener- listener to be notified of events.- Throws:
LockedException- if estimator is locked.
-
estimate
public abstract Polynomial estimate() throws LockedException, NotReadyException, PolynomialEstimationExceptionEstimates a polynomial based on provided evaluations.- Returns:
- estimated polynomial.
- Throws:
LockedException- if estimator is locked.NotReadyException- if estimator is not ready.PolynomialEstimationException- if polynomial estimation fails.
-
getType
Returns type of polynomial estimator.- Returns:
- type of polynomial estimator.
-
create
Creates an instance of a polynomial estimator using default type.- Returns:
- an instance of a polynomial estimator.
-
create
Creates an instance of a polynomial estimator using provided degree and default type.- Parameters:
degree- degree of polynomial to be estimated.- Returns:
- an instance of a polynomial estimator.
- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
create
Creates an instance of a polynomial estimator using provided evaluations, and default type and degree.- Parameters:
evaluations- collection of polynomial evaluations.- Returns:
- an instance of a polynomial estimator.
-
create
Creates an instance of a polynomial estimator using provided listener and default type and degree.- Parameters:
listener- listener to be notified of events.- Returns:
- an instance of a polynomial estimator.
-
create
Creates an instance of a polynomial estimator using provided degree, polynomial evaluations and default type.- Parameters:
degree- degree of polynomial to be estimated.evaluations- collection of polynomial evaluations.- Returns:
- an instance of a polynomial estimator.
- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
create
Creates an instance of a polynomial estimator using provided degree, listener and default type.- Parameters:
degree- degree of polynomial to be estimated.listener- listener to be notified of events.- Returns:
- an instance of a polynomial estimator.
- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
create
public static PolynomialEstimator create(List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener) Creates an instance of a polynomial estimator using provided evaluations, listener and default type.- Parameters:
evaluations- collection of polynomial evaluations.listener- listener to be notified of events.- Returns:
- an instance of a polynomial estimator.
-
create
public static PolynomialEstimator create(int degree, List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener) Creates an instance of a polynomial estimator using provided degree, evaluations, listener and default type.- Parameters:
degree- degree of polynomial to be estimated.evaluations- collection of polynomial evaluations.listener- listener to be notified of events.- Returns:
- an instance of a polynomial estimator.
- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
create
Creates an instance of a polynomial estimator using provided type and default degree.- Parameters:
type- type of polynomial estimator- Returns:
- an instance of a polynomial estimator.
-
create
Creates an instance of a polynomial estimator using provided degree and type.- Parameters:
degree- degree of polynomial to be estimated.type- type of polynomial estimator.- Returns:
- an instance of a polynomial estimator.
- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
create
public static PolynomialEstimator create(List<PolynomialEvaluation> evaluations, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided evaluations and type.- Parameters:
evaluations- collection of polynomial evaluations.type- type of polynomial estimator.- Returns:
- an instance of a polynomial estimator.
-
create
public static PolynomialEstimator create(PolynomialEstimatorListener listener, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided listener and type.- Parameters:
listener- listener to be notified of events.type- type of polynomial estimator.- Returns:
- an instance of a polynomial estimator.
-
create
public static PolynomialEstimator create(int degree, List<PolynomialEvaluation> evaluations, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided degree, evaluations and type.- Parameters:
degree- degree of polynomial to be estimated.evaluations- collection of polynomial evaluations.type- type of polynomial estimator.- Returns:
- an instance of a polynomial estimator.
- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
create
public static PolynomialEstimator create(int degree, PolynomialEstimatorListener listener, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided degree, listener and type.- Parameters:
degree- degree of polynomial to be estimated.listener- listener to be notified of events.type- type of polynomial estimator.- Returns:
- an instance of a polynomial estimator.
- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
create
public static PolynomialEstimator create(List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided evaluations, listener and type.- Parameters:
evaluations- collection of polynomial evaluations.listener- listener to be notified of events.type- type of polynomial estimator.- Returns:
- an instance of a polynomial estimator.
-
create
public static PolynomialEstimator create(int degree, List<PolynomialEvaluation> evaluations, PolynomialEstimatorListener listener, PolynomialEstimatorType type) Creates an instance of a polynomial estimator using provided degree, evaluations, listener and type.- Parameters:
degree- degree of polynomial to be estimated.evaluations- collection of polynomial evaluations.listener- listener to be notified of events.type- type of polynomial estimator.- Returns:
- an instance of a polynomial estimator.
- Throws:
IllegalArgumentException- if provided degree is less than 1.
-
fillDirectEvaluation
protected void fillDirectEvaluation(DirectPolynomialEvaluation evaluation, com.irurueta.algebra.Matrix a, com.irurueta.algebra.Matrix b, int row) Fills row of system of equations for a direct polynomial evaluation.- Parameters:
evaluation- a direct polynomial evaluation.a- system matrix.b- values matrix.row- row to be filled.
-
fillDerivativeEvaluation
protected void fillDerivativeEvaluation(DerivativePolynomialEvaluation evaluation, com.irurueta.algebra.Matrix a, com.irurueta.algebra.Matrix b, int row) Fills row of system of equations for a derivative polynomial evaluation.- Parameters:
evaluation- a derivative polynomial evaluation.a- system matrix.b- values matrix.row- row to be filled.
-
fillIntegralEvaluation
protected void fillIntegralEvaluation(IntegralPolynomialEvaluation evaluation, com.irurueta.algebra.Matrix a, com.irurueta.algebra.Matrix b, int row) throws PolynomialEstimationException Fills row of system of equations for an integral polynomial evaluation.- Parameters:
evaluation- an integral polynomial evaluation.a- system matrix.b- values matrix.row- row to be filled.- Throws:
PolynomialEstimationException- if constant terms does not have proper size (it must be null or have order length).
-
fillIntegralIntervalEvaluation
protected void fillIntegralIntervalEvaluation(IntegralIntervalPolynomialEvaluation evaluation, com.irurueta.algebra.Matrix a, com.irurueta.algebra.Matrix b, int row) throws PolynomialEstimationException Fills row of system of equations for a polynomial evaluation of an interval integration.- Parameters:
evaluation- an interval integration of a polynomial evaluation.a- system matrix.b- values matrix.row- row to be filled.- Throws:
PolynomialEstimationException- if constant terms does not have proper size (it must be null or have order length).
-
normalize
protected void normalize(com.irurueta.algebra.Matrix a, com.irurueta.algebra.Matrix b, int row) Normalizes rows of system matrix and values matrix to increase accuracy of linear system of equations to be solved.- Parameters:
a- system matrix.b- values matrix.row- row to normalize.
-
internalSetDegree
private void internalSetDegree(int degree) Internal method to set degree of polynomial to be estimated.- Parameters:
degree- degree of polynomial to be estimated.- Throws:
IllegalArgumentException- if provided degree is less than 1.
-