Mathematics Source Library
C & ASM


Three Point Equal Interval Search

Three Point Equal Interval Search

The three point equal interval method partitions a closed and bounded interval into four closed subintervals with disjoint interiors and evaluates the function at each endpoint of the subintervals. The interval or union of the two intervals which contain the extreme value are retained and the process is repeated using the retained closed and bounded interval. The process is terminated when the length of final interval is less than or equal to a preassigned tolerance.

Function List

  • void Min_Search_3pt_Equal_Intervals( double (*f)(double), double* lower_limit, double* upper_limit, double* fa, double* fb, double tolerance )

    This routine attempts to shorten the interval [*lower_limit,*upper_limit] which brackets a local minimum of the user-supplied function f(x) by partitioning the interval into 4 subintervals of equal length and evaluating the function at each endpoint. The two subintervals with the common endpoint at which the function is a minimum is retained. The process is repeated until the length of the retained interval is less than or equal to tolerance. Upon return, *lower_limit is set to the left-most endpoint of the final interval, *fa is the value of the function there, *upper_limit is set to the right-most endpoint of the final interval and *fb is the value of the function there.

    On input the parameters *lower_limit and *upper_limit, with *lower_limit < *upper_limit, should bracket a local minimum.

  • void Max_Search_3pt_Equal_Intervals( double (*f)(double), double* lower_limit, double* upper_limit, double* fa, double* fb, double tolerance )

    This routine attempts to shorten the interval [*lower_limit,*upper_limit] which brackets a local maximum of the user-supplied function f(x) by partitioning the interval into 4 subintervals of equal length and evaluating the function at each endpoint. The two subintervals with the common endpoint at which the function is a maximum is retained. The process is repeated until the length of the retained interval is less than or equal to tolerance. Upon return, *lower_limit is set to the left-most endpoint of the final interval, *fa is the value of the function there, *upper_limit is set to the right-most endpoint of the final interval and *fb is the value of the function there.

    On input the parameters *lower_limit and *upper_limit, with *lower_limit < *upper_limit, should bracket a local maximum. C source code is available for this routine:

  • void Min_Line_Search_3pt_Equal_Intervals( double (*f)(double *), double* base, double* direction, double* x, int n, double* a, double* b, double* fa, double* fb, double tolerance )

    Given the user-supplied real-valued function f of an n-dimensional vector and the line segment (base - λ direction) where a ≤ λ ≤ b this routine attempts to shorten the interval of uncertainty [*a,*b] which brackets a local minimum of
    g(λ) = f(base - λ direction) by partitioning the interval [*a,*b] into 4 subintervals of equal length and evaluating the function at each endpoint of the subintervals. The two subintervals with the common endpoint at which the function is a minimum are joined to form the new interval of uncertainty. The process is repeated until the length of the retained interval is less than or equal to tolerance. Upon return, *a is set to the left-most endpoint of the final interval, *fa is the value of the function there, *b is set to the right-most endpoint of the final interval and *fb is the value of the function there.

    On input the parameters *a and *b, with *a < *b, should bracket a local minimum. The parameter x is working storage and should be dimensioned at least n in the calling routine.

  • void Max_Line_Search_3pt_Equal_Intervals( double (*f)(double *), double* base, double* direction, double* x, int n, double* a, double* b, double* fa, double* fb, double tolerance )

    Given the user-supplied real-valued function f of an n-dimensional vector and the line segment (base + λ direction) where a ≤ λ ≤ b this routine attempts to shorten the interval of uncertainty [*a,*b] which brackets a local maximum of
    g(λ) = f(base + λ direction) by partitioning the interval [*a,*b] into 4 subintervals of equal length and evaluating the function at each endpoint of the subintervals. The two subintervals with the common endpoint at which the function is a minimum are joined to form the new interval of uncertainty. The process is repeated until the length of the retained interval is less than or equal to tolerance. Upon return, *a is set to the left-most endpoint of the final interval, *fa is the value of the function there, *b is set to the right-most endpoint of the final interval and *fb is the value of the function there.

    On input the parameters *a and *b, with *a < *b, should bracket a local maximum.

C Source Code