Page 211 - Compact Numerical Methods For Computers
P. 211
200 Compact numerical methods for computers
In other sections, conjugate gradients algorithms specially adapted to particular
problems will be reported. It is unfortunate that the application to such problems
of the general-purpose minimisation algorithm proposed here and detailed in the
next section (problems such as, for instance, minimising the Rayleigh quotient to
find a matrix eigensolution) may show the method to be extremely slow to
converge.
A detail which remains to be dealt with is that the initial step length needs to be
established. The value
k = l (16.16)
is probably as good as any in the absence of other information, though Fletcher
and Reeves (1964) use an estimate e of the minimum value of the function in the
linear approximation
T
k=[e-S(b)]/g t. (16.17)
In any event, it is advisable to check that the step does change the parameters and
to increase k until they are altered. After a conjugate gradients iteration, the
absolute value of k can be used to provide a step length in the next search.
Algorithm 22. Function minimisation by conjugate gradients
procedure cgmin(n: integer; {the number of parameters in the
function to be minimised}
vax Bvec, X: rvector; {the parameter values on
input (Bvec) and output (X) from minmeth}
var Fmin: real; {‘minimum’ function value}
Workdata: probdata; {user defined data area}
var fail: boolean; {true if method has failed}
var intol: real); {user-initialized convergence
tolerance}
{alg22.pas == modified conjugate gradients function
minimisation method
Original method due to R. Fletcher & C M Reeves, Computer Journal,
vol 7, pp. 149-154, 1964
Copyright 1988 J.C.Nash
}
t y p e
methodtype= (Fletcher_Reeves, Polak_Ribiere, Beale_Sorenson);
const
Maxparm = 25; {maximum allowed number of parameters in the
present code. May be changed by the user,
along with dependent constants below.}
stepredn = 0.2; {factor to reduce stepsize in line search}
acctol = 0.0001; {acceptable point tolerance -- see STEP 13}
reltest = 10.0; {to check equality of parameters -- see STEP 8}
var
accpoint : boolean; {to indicate an acceptable point}
c : rvector; {to store last gradient}
count : integer; {to check for parameter equality}
cycle : integer; {cycle count of cg process}
cyclimit : integer; {limit on cycles per major cg sweep}