相关代码 |
|
procedure QROMB(A, B:real; var SS:real); CONST EPS = 0.000001; JMAX = 20; VAR S,H:ARRAY[0..21] of real; JMAXP,J,K,KM:integer; DSS:real; begin JMAXP:=JMAX + 1; K:=5; KM:=K - 1; H[1]:=1; For J:=1 To JMAX do begin TRAPZD(A, B, S[J], J); If J >= K Then begin POLINT(H, S, K, 0, SS, DSS); If (AbS(DSS) < (EPS * Abs(SS))) Then Exit; end; S[J + 1]:=S[J]; H[J + 1]:=0.25 * H[J]; end; ShowMessage('Too many steps.'); end;
相关资源 |
|