pub enum PolyCalError<E> {
OutOfRangeCertain {
value: E,
evaluated: E,
range: Range<E>,
kind: Kind,
},
OutOfRangeUncertain {
value: E,
evaluated: AbsUncertainty<E>,
range: Range<E>,
kind: Kind,
},
InverseSolver(Error),
LeastSquares(SolverError),
NoMinimum {
scores: Vec<E>,
},
InvalidData(String),
Chebyshev(ChebyshevError),
FittingFailure {
dependent: Vec<E>,
independent: Vec<E>,
},
}Variants§
OutOfRangeCertain
The input value was outside of the calibration range, so a prediction cannot be reliably made.
In this scenario we return the value anyway because the caller needs to decide what to do. In some scenarios using the value might be acceptable, particularly when the input value was very close to the calibration range. Alternatively if the caller is running an unconstrained optimisation the solver could leave the finite function domain. In that case, as long as the value solved for lies in the function domain at the end of the optimisation there is no harm in leaving it during the solve.
Note though that guarantees around monotonicity are only made within the domain of the polynomial. It is possible a root outside the domain may be found, and it is the responsibility of the caller to check.
OutOfRangeUncertain
The input value was outside of the calibration range, so a prediction cannot be reliably made.
In this scenario we return the value anyway because the caller needs to decide what to do. In some scenarios using the value might be acceptable, particularly when the input value was very close to the calibration range. Alternatively if the caller is running an unconstrained optimisation the solver could leave the finite function domain. In that case, as long as the value solved for lies in the function domain at the end of the optimisation there is no harm in leaving it during the solve.
Note though that guarantees around monotonicity are only made within the domain of the polynomial. It is possible a root outside the domain may be found, and it is the responsibility of the caller to check.
InverseSolver(Error)
Failure in the underlying inverse solver.
LeastSquares(SolverError)
Failure in the underlying least-squares routine
NoMinimum
There was no minimum found using the requested scoring strategy.
InvalidData(String)
Input data contained invalid values, leaving the calculation unable to proceed
Chebyshev(ChebyshevError)
Error in low-level Chebyshev calculation