INTERFACE MinConvex; (* Last edited on 2000-01-08 08:49:52 by stolfi *) TYPE CostFunction = PROCEDURE (x: INTEGER): INTEGER; PROCEDURE FindMinInteger(lo, hi: INTEGER; cost: CostFunction): INTEGER; (* Finds the minimum of "cost" between "lo" and "hi" (inclusive) by Fibonacci-like search. Assumes "cost" is convex, i.e. cost(a*x + b*y <= a*cost(x) + b*cost(y) for any non-negative "a,b" with "a+b = 1". *) END MinConvex.