Switch to unified view

a b/OptimLib1.def
1
DEFINITION MODULE OptimLib1;
2
3
  (*------------------------------------------------------------------------*)
4
  (* Routinen fuer die Minimierung von ein- und mehrdimensionalen           *)
5
  (* Funktionen.                                                            *)
6
  (* Module for finding the minimum of a function of one variable and       *)
7
  (* finding the minimum of a function of multible variables without        *)
8
  (* without derivatives.                                                   *)
9
  (*------------------------------------------------------------------------*)
10
  (* Most routines are based on other author work - please see a reference  *)
11
  (* list in the implementation module and the headings of the procedures   *)
12
  (* in this definition module                                              *)
13
  (*------------------------------------------------------------------------*)
14
  (* Implementation : Michael Riedl                                         *)
15
  (* Licence        : GNU Lesser General Public License (LGPL)              *)
16
  (*------------------------------------------------------------------------*)
17
18
  (* $Id: OptimLib1.def,v 1.2 2018/05/03 07:19:19 mriedl Exp mriedl $ *)
19
20
IMPORT LMathLib;
21
22
CONST MaxVar     = 32; (* Maximal number of parameters to be optimized *)
23
24
TYPE  Funktion1  = LMathLib.Funktion1;
25
      FunktionN  = LMathLib.FunktionN;
26
27
TYPE  MinProc    = PROCEDURE(VAR ARRAY OF LONGREAL, (* Parametervektor    *)
28
                                 CARDINAL,          (* Anzahl Parameter   *)
29
                             VAR LONGREAL);         (* Funktionsergebniss *)
30
31
      SuchMatrix = ARRAY [1..MaxVar] OF ARRAY [1..MaxVar] OF LONGREAL;
32
33
PROCEDURE FMin(    A,B  : LONGREAL;
34
                   Func : Funktion1;
35
                   Tol  : LONGREAL;
36
               VAR iter : CARDINAL;
37
               VAR Min  : LONGREAL);
38
39
          (* ---------------------------------------------------------------*)
40
          (* An approximation x to the point where Func=F(x) attains        *)
41
          (* a minimum on the interval  (a,b)  is determined.               *)
42
          (*                                                                *)
43
          (* Parameter                                                      *)
44
          (*                                                                *)
45
          (*   A    : left endpoint of initial interval                     *)
46
          (*   B    : right endpoint of initial interval                    *)
47
          (*   Func : function procedure which evaluates F(x) for           *)
48
          (*          any x in the interval (A,B)                           *)
49
          (*   Tol  : desired length of the interval of uncertainty         *)
50
          (*          of the final result (Tol .ge. 0.0d0)                  *)
51
          (*                                                                *)
52
          (* Return value                                                   *)
53
          (*                                                                *)
54
          (*   Min  : abcissa approximating the point where f(fmin)         *)
55
          (*          attains a minimum                                     *)
56
          (*   iter : number of iterations taken                            *)
57
          (*                                                                *)
58
          (* The method used is a combination of golden section search      *)
59
          (* and successive parabolic interpolation.                        *)
60
          (* Convergence is never much slower than that for a fibonacci     *)
61
          (* search. If F(x) has a continuous second derivative which is    *)
62
          (* positive at the minimum (which is not at A or B), then         *)
63
          (* convergenc is superlinear, and usually of the order of         *)
64
          (* about 1.324....                                                *)
65
          (* The function F(x) is never evaluated at two points closer      *)
66
          (* together than eps*abs(fmin) + (Tol/3), where eps is            *)
67
          (* approximately the square root of the relative machine          *)
68
          (* precision. If F(x) is a unimodal function and the computed     *)
69
          (* values of F(x) are always unimodal when separated by at least  *)
70
          (* eps*abs(x) + (Tol/3), then fmin approximates the abcissa of    *)
71
          (* the global minimum of F(x) on the interval (A,B) with an       *)
72
          (* error less than 3*eps*abs(fmin) + Tol. If F(x) is not          *)
73
          (* unimodal, then fmin may approximate a local, but perhaps non-  *)
74
          (* global, minimum to the same accuracy.                          *)
75
          (*                                                                *)
76
          (* This function is a slightly modified version of the Algol 60   *)
77
          (* procedure localmin given in Richard Brent, "Algorithms for     *)
78
          (* minimization without derivatives", Prentice-Hall (1973).       *)
79
          (*                                                                *)
80
          (* Fortran source is based on a procedures from the book          *)
81
          (* Forsythe, George E.; Malcolm, Michael A.; Moler, Cleve B.;     *)
82
          (* "Computer Methods for Mathematical Computations",              *)
83
          (* Prentice-Hall, 1977.                                           *)
84
          (*----------------------------------------------------------------*)
85
86
PROCEDURE FMinBr(    a,b  : LONGREAL;
87
                     f    : Funktion1;
88
                     tol  : LONGREAL;
89
                 VAR iter : CARDINAL;
90
                 VAR Min  : LONGREAL);
91
92
          (*----------------------------------------------------------------*)
93
          (* Parameters and Algorithm as described for FMin.                *)
94
          (* Translated from "C" source as published in the Internet        *)
95
          (*----------------------------------------------------------------*)
96
97
PROCEDURE GloMin(    a,b,c   : LONGREAL;
98
                     m       : LONGREAL;
99
                     e       : LONGREAL;
100
                     t       : LONGREAL;
101
                     f       : Funktion1;
102
                 VAR x       : LONGREAL) : LONGREAL;
103
104
          (*----------------------------------------------------------------*)
105
          (* glomin returns the global minuimum of the function f(x)        *)
106
          (* defined on [a,b], The procedure assumes that f \in C^2[a,b]    *)
107
          (* and f''(x) <= m \forall x \in [a,b] weaker conditions are      *)
108
          (* sufficient: see Section 7).                                    *)
109
          (* e and t are positive tolerance: we assume that f(x) is         *)
110
          (* computed with an absolute error bounded by e, i.e. then        *)
111
          (* | f1(f(x(1 +- macheps))) - f(x)| <= e, where macheps is the    *)
112
          (* relative machine precision. Then x and glomin are returned     *)
113
          (* so than min(f) <= min(f) + t + 2e and                          *)
114
          (* min(f) - e <= glomin = f1(f(x)) <= min(f) + t + e.             *)
115
          (* c is an initial guess at x (a or b will do). The number of     *)
116
          (* function ealuations required is usually close to the least     *)
117
          (* possible, provided t is not unreasonable small                 *)
118
          (* (see Section 3 to 5)                                           *)
119
          (*                                                                *)
120
          (*  Parameters:                                                   *)
121
          (*                                                                *)
122
          (*    a,b : The endpoints of the interval with a < b              *)
123
          (*    c   : An initial guess for the global minimizer.            *)
124
          (*          If no good guess is known, c = a or b is acceptable.  *)
125
          (*    m   : The bound on the second derivative.                   *)
126
          (*    e   : a positive tolerance, a bound for the absolute error  *)
127
          (*          in the evaluation of f(x) for any x in [A,B].         *)
128
          (*    t   : a positive error tolerance.                           *)
129
          (*    f   : f(x), a user-supplied function whose global minimum   *)
130
          (*          is being sought.                                      *)
131
          (*                                                                *)
132
          (*    x   : the estimated value of the abscissa for which f(x)    *)
133
          (*          attains its global minimum value in [A,B].            *)
134
          (*                                                                *)
135
          (*    Return value is the value of f(x)                           *)
136
          (*                                                                *)
137
          (*  Algol60 version by R.Brent, adopted to Modula-2 by M.Riedl    *)
138
          (*----------------------------------------------------------------*)
139
140
PROCEDURE LocalMin(    A,B : LONGREAL;
141
                       eps : LONGREAL;
142
                       T   : LONGREAL;
143
                       F   : Funktion1;
144
                   VAR x   : LONGREAL) : LONGREAL;
145
146
          (*----------------------------------------------------------------*)
147
          (*  Parameters:                                                   *)
148
          (*                                                                *)
149
          (*    A,B : The endpoints of the interval with A < B              *)
150
          (*    eps : A positive relative error tolerance.                  *)
151
          (*          eps should be no smaller than twice the relative      *)
152
          (*          machine precision and preferably not much less        *)
153
          (*          than the square root of the relative machine          *)
154
          (*          precision.                                            *)
155
          (*    T   : a positive error tolerance.                           *)
156
          (*    F   : F(x), a user-supplied function whose global minimum   *)
157
          (*          is being sought.                                      *)
158
          (*                                                                *)
159
          (*    x   : the estimated value of the abscissa for which F(x)    *)
160
          (*          attains its global minimum value in [A,B].            *)
161
          (*                                                                *)
162
          (* Return value is the value of F(x)                              *)
163
          (*                                                                *)
164
          (* [1] Brent, Richard; "Algorithms for finding zeros and extrema  *)
165
          (*     of functions without calculating derivatives", Computer    *)
166
          (*     Sience Departmet, Stanfort university, Stanford (US)       *)
167
          (*     (STAN-CS-71-198) (1971)                                    *)
168
          (*----------------------------------------------------------------*)
169
170
PROCEDURE Zero(a,b : LONGREAL;
171
               t   : LONGREAL;
172
               f   : Funktion1) : LONGREAL;
173
174
          (*----------------------------------------------------------------*)
175
          (* Zero seeks the root of a function f(x) in an interval [A,B].   *)
176
          (*                                                                *)
177
          (*  Parameters:                                                   *)
178
          (*                                                                *)
179
          (*    a,b : The endpoints of the interval with a < b              *)
180
          (*    t   : a positive error tolerance.                           *)
181
          (*    f   : f(x), a user-supplied function whose zero             *)
182
          (*          is being sought.                                      *)
183
          (*                                                                *)
184
          (*    x   : the estimated value of the abscissa for which f(x)    *)
185
          (*          attains its global minimum value in [A,B].            *)
186
          (*                                                                *)
187
          (* Return value is the value of x such that f(x) = 0              *)
188
          (*                                                                *)
189
          (* If no zero is found in the interval [a,b] the global variable  *)
190
          (* Errors.Fehler ist set to true and Errors.Fehlerflag is set     *)
191
          (* accordingly                                                    *)
192
          (*----------------------------------------------------------------*)
193
194
PROCEDURE NelMin(     n     : INTEGER;
195
                 VAR Start  : ARRAY OF LONGREAL; (* <==> *)
196
                 VAR XMin   : ARRAY OF LONGREAL; (*  ==> *)
197
                 VAR YnewLo : LONGREAL;
198
                     FNProc : MinProc;
199
                     ReqMin : LONGREAL;
200
                 VAR Step   : ARRAY OF LONGREAL; (*  <== *)
201
                     Konvge : INTEGER;
202
                     KCount : INTEGER;
203
                 VAR ICount : INTEGER;
204
                 VAR NumRes : INTEGER;
205
                 VAR IFault : INTEGER);
206
207
          (*----------------------------------------------------------------*)
208
          (* Optimierer nach Nelder-Mead, basierend auf F77 Version von     *)
209
          (* R. V. O'Neill mit Modifikationen von John Burkardt.            *)
210
          (*                                                                *)
211
          (* Simplex function minimisation procedure due to                 *)
212
          (* nelder+mead(1965), as implemented by o'neill                   *)
213
          (* (1971, appl.statist. 20, 338-45), with subsequent comments     *)
214
          (* by chambers+ertel(1974, 23, 250-1), benyon(1976,25, 97)        *)
215
          (* and hill(1978, 27, 380-2)                                      *)
216
          (*                                                                *)
217
          (* This routine seeks the minimum value of a user-specified       *)
218
          (* function                                                       *)
219
          (*                                                                *)
220
          (* The function to be minimized must be defined as a procedure    *)
221
          (* of the form                                                    *)
222
          (*                                                                *)
223
          (*   PROCEDURE fn(VAR X  : ARRAY OF LONGREAL;                     *)
224
          (*                    n  : INTEGER;                               *)
225
          (*                VAR Fx : LONGREAL);                             *)
226
          (*                                                                *)
227
          (* and passed as the argument FNPorc.                             *)
228
          (*                                                                *)
229
          (* This routine does not include a termination test using         *)
230
          (* the fitting of a quadratic surface.                            *)
231
          (*                                                                *)
232
          (* Parameters:                                                    *)
233
          (*                                                                *)
234
          (*   FNProc   : input,external                                    *)
235
          (*              the name of the function which evaluates          *)
236
          (*              the function to be minimized.                     *)
237
          (*   N        : input                                             *)
238
          (*              the number of variables.                          *)
239
          (*   Start(N) : input/output                                      *)
240
          (*              on input, a starting point for the iteration.     *)
241
          (*              on output, this data may have been overwritten.   *)
242
          (*   XMin(N)  : output                                            *)
243
          (*              the coordinates of the point which is estimated   *)
244
          (*              to minimize the function.                         *)
245
          (*   YnewLo   : output                                            *)
246
          (*              the minimum value of the function.                *)
247
          (*   ReqMin   : input                                             *)
248
          (*              the terminating limit for the variance of         *)
249
          (*              function values.                                  *)
250
          (*   Step(n)  : input                                             *)
251
          (*              determines the size and shape of the initial      *)
252
          (*              simplex. The relative magnitudes of its elements  *)
253
          (*              should reflect the units of the variables.        *)
254
          (*   Konvge   : input                                             *)
255
          (*              the convergence check is carried out every        *)
256
          (*              Konvge iterations.                                *)
257
          (*   KCount   : input                                             *)
258
          (*              the maximum number of function evaluations.       *)
259
          (*   ICount   : output                                            *)
260
          (*              the number of function evaluations used.          *)
261
          (*   NumRes   : output                                            *)
262
          (*              the number of restarts.                           *)
263
          (*   IFault   : output                                            *)
264
          (*              error indicator.                                  *)
265
          (*                0: no errors detected.                          *)
266
          (*                1: ReqMin, N, or Konvge has an illegal value.   *)
267
          (*                2: iteration terminated because KCount was      *)
268
          (*                   exceeded without convergence.                *)
269
          (*----------------------------------------------------------------*)
270
271
PROCEDURE Praxis(VAR X     : ARRAY OF LONGREAL;
272
                     N     : INTEGER;
273
                     F     : MinProc;
274
                 VAR fx    : LONGREAL;
275
                     t     : LONGREAL;
276
                     h     : LONGREAL;
277
                     Ktm   : INTEGER;
278
                     Scbd  : LONGREAL;
279
                     IllC  : BOOLEAN;
280
                     Prin  : CARDINAL;
281
                     MaxF  : CARDINAL;
282
                 VAR nf    : CARDINAL;
283
                 VAR iFehl : INTEGER);
284
285
          (* ---------------------------------------------------------------*)
286
          (* Praxis is for the minimization of a function in several        *)
287
          (* variables. The algorithm used is a modification of a conjugate *)
288
          (* gradient method developed by Powell. Changes are due to Brent, *)
289
          (* who gives an ALGOL W program.                                  *)
290
          (* Users who are interested in more of the details should read    *)
291
          (*                                                                *)
292
          (* - Powell, M. J. D., 1962. An efficient method for finding      *)
293
          (*   the minimum of a function of several variables without       *)
294
          (*   calculating derivatives, Computer Journal 7, 155-162.        *)
295
          (* - Brent, R. P., 1973. Algorithms for minimization without      *)
296
          (*   derivatives. Prentice Hall, Englewood Cliffs.                *)
297
          (*                                                                *)
298
          (* Original Pascal version by Karl Gegenfurtner                   *)
299
          (* ---------------------------------------------------------------*)
300
          (* Parameter                                                      *)
301
          (*                                                                *)
302
          (*  X     : on input a vector containing an initial guess of the  *)
303
          (*          solution.                                             *)
304
          (*          on output X holds the final solution of the system    *)
305
          (*  N     : number of unknown parameters                          *)
306
          (*          least calculated value of the function F              *)
307
          (*  F     : F(X,n,fx) is the function to be minimized             *)
308
          (*  fx    : on input the calculaded value of F(X,n,fx) at         *)
309
          (*          the initial guess                                     *)
310
          (*          on output the calculaded value of F(X,n,fx) at        *)
311
          (*          the proposed minimum                                  *)
312
          (*  T     : is the tolerance for the precision of the solution    *)
313
          (*  H     : is a steplength parameter and shoul be set to the     *)
314
          (*          expected distance to the solution. An exceptional     *)
315
          (*          large or small value of H leads to slower convergence *)
316
          (*          on the first few iterations.                          *)
317
          (*  Ktm   : parameter to control the termination condition. Its   *)
318
          (*          default value is 1 and a value of 4 leads to a very   *)
319
          (*          cautious stopping criterion                           *)
320
          (*          Praxis returns if the criterion                       *)
321
          (*           2 * ||x(k)-x(k-1)|| <= sqrt(MachEps) * ||x(k)|| + T  *)
322
          (*           is fulfilled more than KTM times                     *)
323
          (*  Scbd  : is a scaling parameter and should be set to about 10. *)
324
          (*          The default is 1 and with that value no scaling is    *)
325
          (*          done at all. It is only necessary when the parameters *)
326
          (*          are scaled very different                             *)
327
          (*  IllC  : Set to true if problem is known to be ill-conditioned *)
328
          (*  Prin  : controls the printout from PRAXIS                     *)
329
          (*           0 :  no printout at all                              *)
330
          (*           1 :  only initial and final values                   *)
331
          (*           2 :  detailed map of the minimization process        *)
332
          (*           3 :  also prints eigenvalues and eigenvectors of     *)
333
          (*                the direction matices in use                    *)
334
          (*                (for insiders only).                            *)
335
          (*  MaxF  : Input variable - limit the numer of function          *)
336
          (*          evaluations to MaxF                                   *)
337
          (*  nf    : on output, number of function evaluations performed   *)
338
          (*  iFehl : Output variable, indicating errors                    *)
339
          (*           0 :  no error                                        *)
340
          (*           1 :                                                  *)
341
          (*           2 :                                                  *)
342
          (*           3 :                                                  *)
343
          (* ---------------------------------------------------------------*)
344
345
PROCEDURE FletcherPowell(    NVar      : CARDINAL;
346
                         VAR X0        : ARRAY OF LONGREAL;
347
                         VAR DelX0     : ARRAY OF LONGREAL;
348
                             E0        : LONGREAL;
349
                             FunkNX    : MinProc;
350
                         VAR H         : SuchMatrix;
351
                             genau     : LONGREAL;
352
                             Restart   : BOOLEAN;
353
                             MaxZyklus : CARDINAL);
354
355
         (*-----------------------------------------------------------------*)
356
         (* Fletcher-Powell Optimierungsroutine. Benutzt numerische         *)
357
         (* 1. und 2. Ableitungen.                                          *)
358
         (* Diese Routine sowie deren Unterroutine Suche sind stark an      *)
359
         (* die entsprechenden Routinen in GAUSSIAN 80 angelehnt, der       *)
360
         (* Beitrag deren Autoren zu diesem Programmteil sei hiermit        *)
361
         (* entsprechend gew"urdigt.                                        *)
362
         (*                                                                 *)
363
         (* NVar      : Anzahl zu varierender Parameter.                    *)
364
         (* X0        : Initialer Parametersatz, der zu optimieren ist.     *)
365
         (* DelX0     : Schrittweite bei der numerischen Berechnung der     *)
366
         (*             1. und 2. Ableitungen.                              *)
367
         (* E0        : Funktionswert der Funktion FunkNX am Punkt X0.      *)
368
         (* FunkNX    : Zu minimierende Funktion in NVar Variablen.         *)
369
         (* H         : Hessche Matrix. Diese mu3 bei einem Restart         *)
370
         (*             initialisiert sein.                                 *)
371
         (* genau     : Abbruchkriterium.                                   *)
372
         (* Restart   : Offensichtlich.                                     *)
373
         (* MaxZyklus : Maximalzahl der zul"assigen Optimierungszyklen.     *)
374
         (*             Im ersten Zyklus werden 2 NVar + 3 Funktionsaus-    *)
375
         (*             wertungen ben"otigt, in jedem weiteren Zyklus       *)
376
         (*             NVar + 3 Funktionsauswertungen, falls die 2. Ab-    *)
377
         (*             leitung nicht neu berechnet werden mu3.             *)
378
         (*                                                                 *)
379
         (* Literatur :                                                     *)
380
         (*                                                                 *)
381
         (*   Fletcher, R.; Powell, M.J.D.; Comput. J. 6, 163 (1963)        *)
382
         (*   Collins, J.B.; Schleyer, P.; Binkley, J.S.; Pople, J.A.;      *)
383
         (*   J. of Chem. Phys. 64, 5142 (1976)                             *)
384
         (*-----------------------------------------------------------------*)
385
386
TYPE  GeoOptParameter = RECORD (* LDirK set to reflect DirK < 0 in Original *) 
387
                          ReStart   : BOOLEAN;
388
                          LDirK     : BOOLEAN; 
389
                          DirK,DirJ : CARDINAL;
390
                        END;
391
392
PROCEDURE Trudge(    Funkt       : MinProc;
393
                 VAR X           : ARRAY OF LONGREAL;
394
                     NVar        : CARDINAL;
395
                 VAR Func        : LONGREAL;
396
                     TolF,TolR   : LONGREAL;
397
                 VAR Alpha       : LONGREAL;
398
                 VAR V           : SuchMatrix;
399
                     Noise       : LONGREAL;
400
                 VAR GeoOptParam : GeoOptParameter;
401
                 VAR konvergiert : BOOLEAN;
402
                     TimLim      : LONGCARD); (* Zeitlimit in Sekunden *)
403
404
          (*----------------------------------------------------------------*)
405
          (* Aus exp.f von Hondo VII                                        *)
406
          (*                                                                *)
407
          (* Minimiert eine Funktion von NVar Variablen mithilfe einer      *)
408
          (* modifizierten Powell-methode durch Suchen entlang              *)
409
          (* konjungierter Richtungen.                                      *)
410
          (*                                                                *)
411
          (* Wird die Routine mit ReStart = TRUE aufgerufen, m"ussen alle   *)
412
          (* Werte in den entsprechenden RECORDS gesetzt worden sein.       *)
413
          (* Wird die Routine mit GeoOptParam.LDirK = TRUE aufgerufen,      *)
414
          (* m"ussen nur TimLim,TolF,TolR,Noise,NVar und X gesetzt sein.    *)
415
          (* Wird die Routine mit GeoOptParam.LDirK = FALSE aber mit        *)
416
          (* ReStart = FALSE aufgerufen, m"ussen TimLim, TolF, TolR, Noise, *)
417
          (* NVar, X, und V entsprechend gesetzt sein. In diesem Fall wird  *)
418
          (* DirK nach dem ersten Durchgang auf Null gesetzt.               *)
419
          (*                                                                *)
420
          (* Parameter                                                      *)
421
          (*                                                                *)
422
          (* Funkt       : Prozedurparameter Funkt(X,NVar,Func) -           *)
423
          (*               zu optimierende Funktion                         *)
424
          (* X           : Eingangseitig die Anfangsposition im             *)
425
          (*               NVar-dimensionalen Parameterraum.                *)
426
          (*               Ausgansseitung das berechnete Minimum            *)
427
          (* NVar        : Anzahl der Parameter der zu optimierenden        *)
428
          (*               Funktion                                         *)
429
          (* Func        : Funktionswert. Die Varibale Func muss beim       *)
430
          (*               ersten Aufruf mit dem Funktionswert an der       *)
431
          (*               Stelle der Startwerte von X belegt sein.         *)
432
          (*               Beim Verlassen der Routine enthaelt Func den     *)
433
          (*               Funktionswert am gefundenen Optimum              *)
434
          (* TolF        : Wenn die Funkttionswerte einer neuen Iteration   *)
435
          (*               nur um weniger als TolF vom vorher gefundenen    *)
436
          (*               Minimum abweicht --- UND ---                     *)
437
          (* TolR        : die Wurzel der Summe der Quadrate der            *)
438
          (*               Abweichungnen in den X_i zum vorherigen Iter-    *)
439
          (*               rationsschritt, gewichtet mit der Anzahl der zu  *)
440
          (*               optimierenden Parameter, kleiner als TolR ist,   *)
441
          (*               wird die Optimierung als konvergiert angesehen.  *)
442
          (*               Vorgaben: TolF = 0.001, TolR = 0.05              *)
443
          (* Alpha       : Eingangsseitig die initiale Schrittweite fuer    *)
444
          (*               die Veraenderung der Parameter X                 *)
445
          (*               Ausgansseitig die berechnete Schrittweite am     *)
446
          (*               aufgefundenen Minumum.                           *)
447
          (* V           : Spalten der V-Matrix sind die jeweiligen         *)
448
          (*               Suchrichtungen, wobei Spalten 1 bis DirK         *)
449
          (*               annaehernd konjungiert sind                      *)
450
          (* Noise       : Genauigkeit der Funktionsauswertung. Variationen *)
451
          (*               die kleiner als Noise sind werden als nicht      *)
452
          (*               signifikant gewertet (Vorgabe = 0.0005)          *)
453
          (* GeoOptParam : Steuerparameter                                  *)
454
          (*                 ReStart : Restart eines vorherigen Laufs       *)
455
          (*                           (nicht implementiert)                *)
456
          (*                           Restart = Restart AND DirK # NVar    *)
457
          (*                 LDirK   : Siehe oben                           *)
458
          (*                 DirK    : Anzahl d. konjungierten Spalten in V *)
459
          (*                 DirJ    : Gibt die Suchrichtung an. Die        *)
460
          (*                           Zeile DirJ in V wird als erste Such- *)
461
          (*                           richtung gewaeht wenn ein Restart    *)
462
          (*                           durchgefuehrt wird                   *)
463
          (* konvergiert : Gibt an ob die Optimierung konvergiert ist oder  *)
464
          (*               nicht (siehe auch TolF,TolR)                     *)
465
          (* TimLim      : Zeitlimit in Sekunden. Wird dies ueberschritten  *)
466
          (*               wird die Routine abgebrochen, konvergiert wird   *)
467
          (*               dann auf "falsch" gesetzt                        *)
468
          (*----------------------------------------------------------------*)
469
          (* Minimizes a function of NDir variables by a modified powell    *)
470
          (* method of searches along conjugate directions. columns of V    *)
471
          (* matrix are current search directions. Columns 1 to KDir are    *)
472
          (* (approximately) conjugate.                                     *)
473
          (* When subroutine is entered with Restart=TRUE then values of    *)
474
          (* LdirK and of all quantities in common should have been set     *)
475
          (* previously by the calling program.                             *)
476
          (* When Trudge is called with LdirK negative then only required   *)
477
          (* values are TimLim,TolF,TolR,Noise,NDir,X and Noise for the     *)
478
          (* search. In this case initial values of KDir,JDir,Restart,      *)
479
          (* Alpha and V are ignored.                                       *)
480
          (* If Trudge is called with non-negative LDirK and Restart=FALSE  *)
481
          (* then values of TimLim,TolF,TolR,Noise,NDir,X and V are         *)
482
          (* required. In this case KDir is reset to zero after first pass  *)
483
          (*                                                                *)
484
          (* GeoOptParam : control parameter set                            *)
485
          (*                 DirK : indicates the conjugate gradient        *)
486
          (*                        direction in which the optimization     *)
487
          (*                        will proceed (Def. = FALSE)             *)
488
          (*                        FALSE : indicates that this is a        *)
489
          (*                                non-restart run.                *)
490
          (*                        TRUE  : corresponds to a restart run    *)
491
          (* Noise       : Accuracy of function values. Variation smaller   *)
492
          (*               than Noise are not considered to be significant  *)
493
          (*               (Def. 0.0005)                                    *)
494
          (* TolF        : accuracy required of the function (Def. 0.001)   *)
495
          (* TolR        : accuracy required of conjugate directions        *)
496
          (*               (Def. 0.05)                                      *)
497
          (*                                                                *)
498
          (* For geometry optimization, the values which give better        *)
499
          (* results (closer to the ones obtained with gradient methods)    *)
500
          (* are: TolF=0.0001, TolR=0.001, Noise=0.00001                    *)
501
          (*----------------------------------------------------------------*)
502
503
END OptimLib1.