AlgorithmHelper.IsValueWithinTolerance Method

Definition

Namespace: Numerics.NET.Algorithms
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4

Overload List

IsValueWithinTolerance(IterativeAlgorithm<Double>, Double, Double) Determines whether a value is within an algorithm's requested tolerance.
IsValueWithinTolerance<T>(IterativeAlgorithm<T>, T, T) Returns whether an error is within the required tolerance.

IsValueWithinTolerance(IterativeAlgorithm<Double>, Double, Double)

Determines whether a value is within an algorithm's requested tolerance.
C#
public static bool IsValueWithinTolerance(
	IterativeAlgorithm<double> algorithm,
	double estimatedError,
	double x
)

Parameters

algorithm  IterativeAlgorithm<Double>
A class that implements the IterativeAlgorithm<T> interface.
estimatedError  Double
The error to verify.
x  Double
A value that is representative of the size of the result.

Return Value

Boolean
true if the estimatedError is within the requested tolerance; otherwise false.

Remarks

This method uses the properties of the provided IterativeAlgorithm<T> object. In particular, the ConvergenceCriterion, and either or both of AbsoluteTolerance and RelativeTolerance.

Exceptions

ArgumentNullException

algorithm is null.

IsValueWithinTolerance<T>(IterativeAlgorithm<T>, T, T)

Returns whether an error is within the required tolerance.
C#
public static bool IsValueWithinTolerance<T>(
	IterativeAlgorithm<T> algorithm,
	T estimatedError,
	T x
)
where T : Object, INumberBase<T>

Parameters

algorithm  IterativeAlgorithm<T>
estimatedError  T
x  T

Type Parameters

T

Return Value

Boolean

See Also