相关代码 |
|
Procedure LINMIN(var P,XI:array of real; N:integer;var FRET:real); var TOL,AX,BX,XX,FA,FB,FX,XMIN:real; J:integer; begin TOL:=0.0001; NCOM:=N; For J:=1 To N do begin PCOM[J]:=P[J]; XICOM[J]:=XI[J]; end; AX:=0 ; XX:=1; MNBRAK(AX, XX, BX, FA, FX, FB); FRET:=BRENT(AX, XX, BX, TOL, XMIN); For J:=1 To N do begin XI[J]:=XMIN * XI[J]; P[J]:=P[J] + XI[J]; end; end;