trace: TraceProc := NIL; If "trace" is not NIL, the minimizer calls "trace(s, x, f, g, d)" at every "valid" point along the descent path; where | | "x" is the current argument vector, | "f" is the corresponding function value "F(x)", | "g" is the magnitude of the gradient at "x", | "d" is the direction of steepest descent, and | "s" is the length of the path from the starting point | to the current "x". | The "valid" points are PROCEDURE PerpDev(READONLY e, a, b: Point): Length = (* The length of the component of "e" that is orthogonal to "b - a". *) VAR ee, ed, dd: LONGREAL := 0.0d0; BEGIN FOR i := 0 TO LAST(e) DO WITH ei = e[i], di = b[i] - a[i] DO ee := ee + ei*ei; ed := ed + ei*di; dd := dd + di*di; END END; RETURN Math.sqrt(ABS(ee - ed*ed/dd)) END PerpDev;