Class SmoothStepFactory.FieldSmoothStepFunction<T extends CalculusFieldElement<T>>
java.lang.Object
org.hipparchus.analysis.polynomials.FieldPolynomialFunction<T>
org.hipparchus.analysis.polynomials.SmoothStepFactory.FieldSmoothStepFunction<T>
- Type Parameters:
T
- type of the field element
- All Implemented Interfaces:
CalculusFieldUnivariateFunction<T>
- Enclosing class:
- SmoothStepFactory
public static class SmoothStepFactory.FieldSmoothStepFunction<T extends CalculusFieldElement<T>>
extends FieldPolynomialFunction<T>
Smoothstep function as defined here.
It is used to do a smooth transition between the "left edge" and the "right edge" with left edge assumed to be smaller than right edge.
By definition, for order n greater than 1 and input x, a smoothstep function respects at least the following properties :
- f(x <= leftEdge) = 0 and f(x >= rightEdge) = 1
- f'(leftEdge) = f'(rightEdge) = 0
- f(x <= 0) = 0 and f(x >= 1) = 1
- f'(0) = f'(1) = 0
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkInputEdges
(double leftEdge, double rightEdge) Check that left edge is lower than right edge.protected T
clampInput
(double leftEdge, double rightEdge, T x) Clamp input between edges.protected T
normalizeInput
(double leftEdge, double rightEdge, T x) Normalize input between left and right edges.value
(double xNormalized) Compute the value of the smoothstep for the given argument normalized between edges.Compute the value of the smoothstep function for the given edges and argument.Compute the value of the smoothstep for the given argument normalized between edges.Methods inherited from class org.hipparchus.analysis.polynomials.FieldPolynomialFunction
add, antiDerivative, degree, differentiate, evaluate, getCoefficients, getField, integrate, integrate, multiply, negate, polynomialDerivative, subtract
-
Method Details
-
value
Compute the value of the smoothstep for the given argument normalized between edges.- Overrides:
value
in classFieldPolynomialFunction<T extends CalculusFieldElement<T>>
- Parameters:
xNormalized
- Normalized argument for which the function value should be computed. It is expected to be between [0:1] and will throw an exception otherwise.- Returns:
- the value of the polynomial at the given point.
- See Also:
-
value
Compute the value of the smoothstep for the given argument normalized between edges.- Specified by:
value
in interfaceCalculusFieldUnivariateFunction<T extends CalculusFieldElement<T>>
- Overrides:
value
in classFieldPolynomialFunction<T extends CalculusFieldElement<T>>
- Parameters:
xNormalized
- Normalized argument for which the function value should be computed. It is expected to be between [0:1] and will throw an exception otherwise.- Returns:
- the value of the polynomial at the given point.
- See Also:
-
value
Compute the value of the smoothstep function for the given edges and argument.Note that right edge is expected to be greater than left edge. It will throw an exception otherwise.
- Parameters:
leftEdge
- left edgerightEdge
- right edgex
- Argument for which the function value should be computed- Returns:
- the value of the polynomial at the given point
- Throws:
MathIllegalArgumentException
- if right edge is greater than left edge- See Also:
-
checkInputEdges
protected void checkInputEdges(double leftEdge, double rightEdge) Check that left edge is lower than right edge. Otherwise, throw an exception.- Parameters:
leftEdge
- left edgerightEdge
- right edge
-
clampInput
Clamp input between edges.- Parameters:
leftEdge
- left edgerightEdge
- right edgex
- input to clamp- Returns:
- clamped input
-
normalizeInput
Normalize input between left and right edges.- Parameters:
leftEdge
- left edgerightEdge
- right edgex
- input to normalize- Returns:
- normalized input
-