public class DoubleFunctionExtremumIndicated extends DoubleFunctionFinding
DoubleFunctionExplorer
that a function has a local extremum
indicated by three samples.Constructor and Description |
---|
DoubleFunctionExtremumIndicated(DoubleFunctionExplorer explorer,
DoubleFunctionDetails function,
double leftVariable,
double leftValue,
double middleVariable,
double middleValue,
double rightVariable,
double rightValue)
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
DoubleFunctionExtremumFound |
exploreExtremumForCrossing(DoubleFunctionThresholdDetails closestThreshold,
DoubleFunctionThresholdDetails furthestThreshold,
boolean[] converged)
Searches an extremum until either the precise date at which the function reaches its extremum is found, or it is
determined that this extremum will not result in a crossing.
|
DoubleFunctionExtremumFound |
findPreciseExtremum()
Finds the precise date at which the function reaches its extremum.
|
DoubleFunctionExplorer |
getExplorer()
Gets the
DoubleFunctionExplorer that found this indicated extremum. |
ExtremumType |
getExtremumType()
Gets a value indicating whether the extremum is a minimum or maximum.
|
DoubleFunctionDetails |
getFunction()
Gets the function for which the extremum is indicated.
|
boolean |
getIsEndpointExtremum()
Gets a value indicating whether or not this extremum occurred at one of the endpoints
of an interval explored with
DoubleFunctionExplorer.explore(double,double) . |
FunctionSegmentSlope |
getLeftSegmentSlope()
Gets the slope between the left and middle samples.
|
double |
getLeftValue()
Gets the left function value.
|
double |
getLeftVariable()
Gets the left date.
|
double |
getMiddleValue()
Gets the middle function value.
|
double |
getMiddleVariable()
Gets the middle date.
|
FunctionSegmentSlope |
getRightSegmentSlope()
Gets the slope between the middle and right samples.
|
double |
getRightValue()
Gets the right function value.
|
double |
getRightVariable()
Gets the right date.
|
public DoubleFunctionExtremumIndicated(DoubleFunctionExplorer explorer, DoubleFunctionDetails function, double leftVariable, double leftValue, double middleVariable, double middleValue, double rightVariable, double rightValue)
explorer
- The explorer that found the indicated extremum.function
- The function for which an extremum was identified.leftVariable
- The left Variable.leftValue
- The left function value.middleVariable
- The middle Variable.middleValue
- The middle function value.rightVariable
- The right Variable.rightValue
- The right function value.public final DoubleFunctionExplorer getExplorer()
DoubleFunctionExplorer
that found this indicated extremum.public final DoubleFunctionDetails getFunction()
public final double getLeftVariable()
public final double getLeftValue()
public final double getMiddleVariable()
public final double getMiddleValue()
public final double getRightVariable()
public final double getRightValue()
@Nonnull public final FunctionSegmentSlope getLeftSegmentSlope()
@Nonnull public final FunctionSegmentSlope getRightSegmentSlope()
@Nonnull public final ExtremumType getExtremumType()
public final boolean getIsEndpointExtremum()
DoubleFunctionExplorer.explore(double,double)
.
Endpoint extrema do not necessarily indicate places in the function have a derivative of zero,
but they can still be global minima or maxima over the evaluation interval.@Nonnull public final DoubleFunctionExtremumFound findPreciseExtremum()
@Nonnull public final DoubleFunctionExtremumFound exploreExtremumForCrossing(DoubleFunctionThresholdDetails closestThreshold, DoubleFunctionThresholdDetails furthestThreshold, @Nonnull boolean[] converged)
Note that if the precise location of the extremum is not found due to it not being a candidate for a threshold crossing
then a LocalExtremumFound
(add
/ remove
) event will not be fired.
closestThreshold
- The threshold which is most likely to be crossed by this extremum, such that if this threshold is not crossed
by the extremum no other threshold will be crossed.furthestThreshold
- The threshold which is least likely to be crossed by this extremum, such that if this threshold is crossed
by the extremum all other thresholds will be crossed.converged
- This parameter will be set to true if returned extremum has converged, either because it resulted in a crossing or because
it converged before it could be definitely determined to not be likely to cross the threshold.