G3dFunction.mesa
Copyright Ó 1988, 1992 by Xerox Corporation. All rights reserved.
Bloomenthal, July 14, 1992 1:51 pm PDT
DIRECTORY IO;
G3dFunction: CEDAR DEFINITIONS
~ BEGIN
Definitions
STREAM:   TYPE ~ IO.STREAM;
FunctionProc: TYPE ~ PROC [t: REAL] RETURNS [REAL];
LineProc:   TYPE ~ PROC [x0, y0, x1, y1: REAL];
A General Univariate Function Minimizer
MinimizeFunction: PROC [
function: FunctionProc,
t0: REAL ¬ 0.0,     -- minimum abscissa
t1: REAL ¬ 360.0,    -- maximum abscissa
logSlope: REAL ¬ -1.758121, -- ~ RealFns.Log[10.0, 3.1416/180.0]
alpha: REAL ¬ 0.35,
slopeFac: REAL ¬ 0.5,
certainFac: REAL ¬ 1.0,
logEps: REAL ¬ -4.0,
lineProc: LineProc ¬ NIL,
report: STREAM ¬ NIL]
RETURNS [REAL];
Find the value of t within the interval [t0..t1] that minimizes function[t].
logslope is the log of the maximum slope of the function between t0 and t1;
this must be correct or the minimizing algorithm may fail.
If lineProc # NIL, then graph the tree of converging intervals.
If report # NIL, then make a status report to it at the end of the minimization.
See also: the chapter on minimization and unconstrained optimization in Numerical Recipes.
MinimizeMonotonic: PROC [
function: FunctionProc,
t0: REAL ¬ 0.0,     -- minimum abscissa
t1: REAL ¬ 360.0,    -- maximum abscissa
eps: REAL]      -- return if dt < eps
RETURNS [REAL];
Find the value of t within the interval [t0..t1] that minimizes function[t] presuming:
f has a single minimum within [t0..t1], and
f is monotonic on either side of the minimum.
Miscellaneous Functions
Gauss: FunctionProc;
The normal distribution curve:
[Artwork node; type 'Artwork on' to command tool]
Spike: FunctionProc;
A second order curve:
[Artwork node; type 'Artwork on' to command tool]
Wyvill: FunctionProc;
Wyvill's soft function (1 if x < 0, 0 if x > 0):
[Artwork node; type 'Artwork on' to command tool]
Poisson: PROC [x, a: REAL] RETURNS [REAL];
The poisson curve: axe-ax:
[Artwork node; type 'Artwork on' to command tool]
Perlin: PROC [x, a: REAL] RETURNS [REAL];
Ken's curve, a < 0.5 produces concavity, a > 0.5 produces convexity:
[Artwork node; type 'Artwork on' to command tool]
END.