INTERFACE JSUniMin; (* An ad-hoc algorithm for minimizing a univariate function without derivatives. Created by J.Stolfi on May-Jul 1994. *) IMPORT UniMin; TYPE T <: Public; Public = UniMin.T OBJECT METHODS setAlpha(alpha: LONGREAL): T; (* Sets the minimum splitting ratio to be used. *) END; (* The "minimize" method does not use the derivative provided by "eval", and works only with the function values. It looks for three points "u", "z", "v" in the given interval "[a__b]" such that 1. The points are ordered and not too close: "u + tol <= z <= v - tol" 2. The gaps aren't too unequal: "MIN(z-u, v-z) >= Alpha * (v-u)" 3. They bracket at lest one local minimum: "f(z) <= MIN(f(u), f(v))" 4. The gaps can't be split any further: "MAX(z-u, v-z) < 2*tol" When such a triple is found, or when "good" returns "TRUE", "minimize" returns in "fx" the smallest of "f(u)" "f(z)", and "f(w)", and in "x" the corresponding argument. *) END JSUniMin.