From ea581336bc987954043e165df6f4ac5210ba4c21 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 26 Sep 2017 13:50:50 +0200 Subject: werteunit.pas: repetitive Dinge in werteunit.inc ausgelagert --- werteunit.pas | 665 ++++------------------------------------------------------ 1 file changed, 40 insertions(+), 625 deletions(-) (limited to 'werteunit.pas') diff --git a/werteunit.pas b/werteunit.pas index a9214b7..3f31f0f 100644 --- a/werteunit.pas +++ b/werteunit.pas @@ -244,443 +244,68 @@ begin setLength(werte,0); end; +{$DEFINE tLLWerte_create} constructor tLLWerte.create(original: pTLLWerteSingle; ps: tExtraInfos; xMin,xMax: longint); -begin - inherited create; - params:=ps; - kopiereVon(false,original,xMin,xMax); -end; - +{$INCLUDE werteunit.inc} constructor tLLWerte.create(original: pTLLWerteDouble; ps: tExtraInfos; xMin,xMax: longint); -begin - inherited create; - params:=ps; - kopiereVon(false,original,xMin,xMax); -end; - +{$INCLUDE werteunit.inc} constructor tLLWerte.create(original: pTLLWerteExtended; ps: tExtraInfos; xMin,xMax: longint); -begin - inherited create; - params:=ps; - kopiereVon(false,original,xMin,xMax); -end; +{$INCLUDE werteunit.inc} +{$UNDEF tLLWerte_create.create} +{$DEFINE tLLWerte_kopiereVon} procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteSingle); -begin - kopiereVon(sT,original,0,original^.params.xSteps-1); -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteDouble); -begin - kopiereVon(sT,original,0,original^.params.xSteps-1); -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteExtended); -begin - kopiereVon(sT,original,0,original^.params.xSteps-1); -end; +{$INCLUDE werteunit.inc} +{$UNDEF tLLWerte_kopiereVon} +{$DEFINE tLLWerte_kopiereVon_xMiMa} procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteSingle; xMin,xMax: longint); -begin - kopiereVon(sT,original,xMin,xMax,0,original^.params.tSiz-1); -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteDouble; xMin,xMax: longint); -begin - kopiereVon(sT,original,xMin,xMax,0,original^.params.tSiz-1); -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteExtended; xMin,xMax: longint); -begin - kopiereVon(sT,original,xMin,xMax,0,original^.params.tSiz-1); -end; +{$INCLUDE werteunit.inc} +{$UNDEF tLLWerte_kopiereVon_xMiMa} +{$DEFINE tLLWerte_kopiereVon_xTMiMa} procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteSingle; xMin,xMax,tMin,tMax: longint); -var - i,j: longint; -begin - inherited create; - tMax:=min(tMax,original^.params.tSiz-1); - tMin:=max(tMin,0); - params.tSiz:=tMax+1-tMin; - xMax:=min(xMax,original^.params.xSteps-1); - xMin:=max(xMin,0); - params.xSteps:=xMax+1-xMin; - zerstoereTransformationWennObsolet(params.transformationen); - params.transformationen:=tKoordinatenAusschnitt.create(original^.params.transformationen,xMin,xMax,tMin,tMax); - params.maxW:=0; - params.minW:=0; - params.np:=original^.params.np; - params.beta:=original^.params.beta; - params.refreshKnownValues; - if not sT then begin - holeRAM(0); - for i:=xMin to xMax do - for j:=tMin to tMax do - werte[i-xMin+(j-tMin)*params.xSteps]:=original^.werte[i+j*original^.params.xSteps]; - end; -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteDouble; xMin,xMax,tMin,tMax: longint); -var - i,j: longint; -begin - inherited create; - tMax:=min(tMax,original^.params.tSiz-1); - tMin:=max(tMin,0); - params.tSiz:=tMax+1-tMin; - xMax:=min(xMax,original^.params.xSteps-1); - xMin:=max(xMin,0); - params.xSteps:=xMax+1-xMin; - zerstoereTransformationWennObsolet(params.transformationen); - params.transformationen:=tKoordinatenAusschnitt.create(original^.params.transformationen,xMin,xMax,tMin,tMax); - params.maxW:=0; - params.minW:=0; - params.np:=original^.params.np; - params.beta:=original^.params.beta; - params.refreshKnownValues; - if not sT then begin - holeRAM(0); - for i:=xMin to xMax do - for j:=tMin to tMax do - werte[i-xMin+(j-tMin)*params.xSteps]:=original^.werte[i+j*original^.params.xSteps]; - end; -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteExtended; xMin,xMax,tMin,tMax: longint); -var - i,j: longint; -begin - inherited create; - tMax:=min(tMax,original^.params.tSiz-1); - tMin:=max(tMin,0); - params.tSiz:=tMax+1-tMin; - xMax:=min(xMax,original^.params.xSteps-1); - xMin:=max(xMin,0); - params.xSteps:=xMax+1-xMin; - zerstoereTransformationWennObsolet(params.transformationen); - params.transformationen:=tKoordinatenAusschnitt.create(original^.params.transformationen,xMin,xMax,tMin,tMax); - params.maxW:=0; - params.minW:=0; - params.np:=original^.params.np; - params.beta:=original^.params.beta; - params.refreshKnownValues; - if not sT then begin - holeRAM(0); - for i:=xMin to xMax do - for j:=tMin to tMax do - werte[i-xMin+(j-tMin)*params.xSteps]:=original^.werte[i+j*original^.params.xSteps]; - end; -end; +{$INCLUDE werteunit.inc} +{$UNDEF tLLWerte_kopiereVon_xTMiMa} +{$DEFINE tLLWerte_kopiereVonNach} procedure tLLWerte.kopiereVonNach(original: pTLLWerteSingle; qxmin,qxmax,qtmin,qtmax,zxmin,ztmin: longint); -var - i,j: longint; -begin - inherited create; - for i:=qxmin to qxmax do - for j:=qtmin to qtmax do - werte[i-qxmin+zxmin + (j-qtmin+ztmin)*params.xSteps]:= - original^.werte[i+j*original^.params.xSteps]; -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereVonNach(original: pTLLWerteDouble; qxmin,qxmax,qtmin,qtmax,zxmin,ztmin: longint); -var - i,j: longint; -begin - inherited create; - for i:=qxmin to qxmax do - for j:=qtmin to qtmax do - werte[i-qxmin+zxmin + (j-qtmin+ztmin)*params.xSteps]:= - original^.werte[i+j*original^.params.xSteps]; -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereVonNach(original: pTLLWerteExtended; qxmin,qxmax,qtmin,qtmax,zxmin,ztmin: longint); -var - i,j: longint; -begin - inherited create; - for i:=qxmin to qxmax do - for j:=qtmin to qtmax do - werte[i-qxmin+zxmin + (j-qtmin+ztmin)*params.xSteps]:= - original^.werte[i+j*original^.params.xSteps]; -end; +{$INCLUDE werteunit.inc} +{$UNDEF tLLWerte_kopiereVonNach} +{$DEFINE tLLWerte_kopiereVerzerrt} procedure tLLWerte.kopiereVerzerrt(original: pTLLWerteSingle; zPs: tIntPointArray; zGs: tExtPointArray; zAs: tExtendedArray; xMin,xMax,tMin,tMax: longint; vB,nB: tTransformation; vA,nA: longint); -var - i,j,k: longint; - tmp: extended; -begin - for i:=tMin to tMax do - for j:=xMin to xMax do - werte[j+i*params.xSteps]:=0; - for i:=0 to length(zPs)-1 do - for j:=0 to 1 do - for k:=0 to 1 do - if (zPs[i]['x']+j>=xMin) and (zPs[i]['x']+j<=xMax) and - (zPs[i]['y']+k>=tMin) and (zPs[i]['y']+k<=tMax) then begin - tmp:=original^.werte[i]; - if (vA>0) or (nA>0) then - tmp:=(tmp-original^.params.minW)/(original^.params.maxW-original^.params.minW); - if vA>0 then - vB.transformiereWert(tmp,vA-1); - tmp:=tmp * (zGs[i]['x'] * (2*j-1) + 1-j) * (zGs[i]['y'] * (2*k-1) + 1-k); - werte[zPs[i]['x']+j + (zPs[i]['y']+k)*params.xSteps]:= - werte[zPs[i]['x']+j + (zPs[i]['y']+k)*params.xSteps] + - tmp; - end; - for i:=tMin to tMax do - for j:=xMin to xMax do begin - tmp:=werte[j + i*params.xSteps] / zAs[j + i*params.xSteps]; - if nA>0 then - tmp:=nB.transformiereWert(tmp,nA-1); - werte[j + i*params.xSteps]:=tmp; - end; -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereVerzerrt(original: pTLLWerteDouble; zPs: tIntPointArray; zGs: tExtPointArray; zAs: tExtendedArray; xMin,xMax,tMin,tMax: longint; vB,nB: tTransformation; vA,nA: longint); -var - i,j,k: longint; - tmp: extended; -begin - for i:=tMin to tMax do - for j:=xMin to xMax do - werte[j+i*params.xSteps]:=0; - for i:=0 to length(zPs)-1 do - for j:=0 to 1 do - for k:=0 to 1 do - if (zPs[i]['x']+j>=xMin) and (zPs[i]['x']+j<=xMax) and - (zPs[i]['y']+k>=tMin) and (zPs[i]['y']+k<=tMax) then begin - tmp:=original^.werte[i]; - if (vA>0) or (nA>0) then - tmp:=(tmp-original^.params.minW)/(original^.params.maxW-original^.params.minW); - if vA>0 then - vB.transformiereWert(tmp,vA-1); - tmp:=tmp * (zGs[i]['x'] * (2*j-1) + 1-j) * (zGs[i]['y'] * (2*k-1) + 1-k); - werte[zPs[i]['x']+j + (zPs[i]['y']+k)*params.xSteps]:= - werte[zPs[i]['x']+j + (zPs[i]['y']+k)*params.xSteps] + - tmp; - end; - for i:=tMin to tMax do - for j:=xMin to xMax do begin - tmp:=werte[j + i*params.xSteps] / zAs[j + i*params.xSteps]; - if nA>0 then - tmp:=nB.transformiereWert(tmp,nA-1); - werte[j + i*params.xSteps]:=tmp; - end; -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereVerzerrt(original: pTLLWerteExtended; zPs: tIntPointArray; zGs: tExtPointArray; zAs: tExtendedArray; xMin,xMax,tMin,tMax: longint; vB,nB: tTransformation; vA,nA: longint); -var - i,j,k: longint; - tmp: extended; -begin - for i:=tMin to tMax do - for j:=xMin to xMax do - werte[j+i*params.xSteps]:=0; - for i:=0 to length(zPs)-1 do - for j:=0 to 1 do - for k:=0 to 1 do - if (zPs[i]['x']+j>=xMin) and (zPs[i]['x']+j<=xMax) and - (zPs[i]['y']+k>=tMin) and (zPs[i]['y']+k<=tMax) then begin - tmp:=original^.werte[i]; - if (vA>0) or (nA>0) then - tmp:=(tmp-original^.params.minW)/(original^.params.maxW-original^.params.minW); - if vA>0 then - vB.transformiereWert(tmp,vA-1); - tmp:=tmp * (zGs[i]['x'] * (2*j-1) + 1-j) * (zGs[i]['y'] * (2*k-1) + 1-k); - werte[zPs[i]['x']+j + (zPs[i]['y']+k)*params.xSteps]:= - werte[zPs[i]['x']+j + (zPs[i]['y']+k)*params.xSteps] + - tmp; - end; - for i:=tMin to tMax do - for j:=xMin to xMax do begin - tmp:=werte[j + i*params.xSteps] / zAs[j + i*params.xSteps]; - if nA>0 then - tmp:=nB.transformiereWert(tmp,nA-1); - werte[j + i*params.xSteps]:=tmp; - end; -end; +{$INCLUDE werteunit.inc} +{$UNDEF tLLWerte_kopiereVerzerrt} +{$DEFINE tLLWerte_kopiereLOVerzerrt} procedure tLLWerte.kopiereLOVerzerrt(original: pTLLWerteSingle; xMin,xMax,tMin,tMax: longint; verhHo,verhVe: extended); overload; -var - i,j,hV,hB,vV,vB,h,v: int64; -begin - writeln(xMin,' .. ',xMax,' x ',tMin,' .. ',tMax); - for i:=tMin to tMax do begin - if verhVe>0 then begin - vV:=max( - 0, - round( - (params.tSiz-1-i+0.5)/ - (1 + (i+0.5)/verhVe/(params.tSiz-1)) - ) - ); - vB:=min( - params.tSiz-1, - round( - (params.tSiz-1-i+0.5)/ - (1 + (i-0.5)/verhVe/(params.tSiz-1)) - ) - ); - end - else begin - vV:=i; - vB:=i; - end; - for j:=xMin to xMax do begin - if verhHo>0 then begin - hV:=max( - 0, - round( - (params.xSteps-1-(j+0.5))/ - (1 + (j+0.5)/verhHo/(params.xSteps-1)) - ) - ); - hB:=min( - params.xSteps-1, - round( - (params.xSteps-1-(j-0.5))/ - (1 + (j-0.5)/verhHo/(params.xSteps-1)) - ) - ); - end - else begin - hV:=j; - hB:=j; - end; - werte[j+i*params.xSteps]:=0; - for h:=hV to hB do - for v:=vV to vB do - werte[j+i*params.xSteps]:= - werte[j+i*params.xSteps]+ - original^.werte[h+v*params.xSteps]; - if (hB>=hV) and (vB>=vV) then - werte[j+i*params.xSteps]:= - werte[j+i*params.xSteps] / (hB+1-hV) / (vB+1-vV); - end; - end; -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereLOVerzerrt(original: pTLLWerteDouble; xMin,xMax,tMin,tMax: longint; verhHo,verhVe: extended); overload; -var - i,j,hV,hB,vV,vB,h,v: int64; -begin - writeln(xMin,' .. ',xMax,' x ',tMin,' .. ',tMax); - for i:=tMin to tMax do begin - if verhVe>0 then begin - vV:=max( - 0, - round( - (params.tSiz-1-i+0.5)/ - (1 + (i+0.5)/verhVe/(params.tSiz-1)) - ) - ); - vB:=min( - params.tSiz-1, - round( - (params.tSiz-1-i+0.5)/ - (1 + (i-0.5)/verhVe/(params.tSiz-1)) - ) - ); - end - else begin - vV:=i; - vB:=i; - end; - for j:=xMin to xMax do begin - if verhHo>0 then begin - hV:=max( - 0, - round( - (params.xSteps-1-(j+0.5))/ - (1 + (j+0.5)/verhHo/(params.xSteps-1)) - ) - ); - hB:=min( - params.xSteps-1, - round( - (params.xSteps-1-(j-0.5))/ - (1 + (j-0.5)/verhHo/(params.xSteps-1)) - ) - ); - end - else begin - hV:=j; - hB:=j; - end; - werte[j+i*params.xSteps]:=0; - for h:=hV to hB do - for v:=vV to vB do - werte[j+i*params.xSteps]:= - werte[j+i*params.xSteps]+ - original^.werte[h+v*params.xSteps]; - if (hB>=hV) and (vB>=vV) then - werte[j+i*params.xSteps]:= - werte[j+i*params.xSteps] / (hB+1-hV) / (vB+1-vV); - end; - end; -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.kopiereLOVerzerrt(original: pTLLWerteExtended; xMin,xMax,tMin,tMax: longint; verhHo,verhVe: extended); overload; -var - i,j,hV,hB,vV,vB,h,v: int64; -begin - writeln(xMin,' .. ',xMax,' x ',tMin,' .. ',tMax); - for i:=tMin to tMax do begin - if verhVe>0 then begin - vV:=max( - 0, - round( - (params.tSiz-1-i+0.5)/ - (1 + (i+0.5)/verhVe/(params.tSiz-1)) - ) - ); - vB:=min( - params.tSiz-1, - round( - (params.tSiz-1-i+0.5)/ - (1 + (i-0.5)/verhVe/(params.tSiz-1)) - ) - ); - end - else begin - vV:=i; - vB:=i; - end; - for j:=xMin to xMax do begin - if verhHo>0 then begin - hV:=max( - 0, - round( - (params.xSteps-1-(j+0.5))/ - (1 + (j+0.5)/verhHo/(params.xSteps-1)) - ) - ); - hB:=min( - params.xSteps-1, - round( - (params.xSteps-1-(j-0.5))/ - (1 + (j-0.5)/verhHo/(params.xSteps-1)) - ) - ); - end - else begin - hV:=j; - hB:=j; - end; - werte[j+i*params.xSteps]:=0; - for h:=hV to hB do - for v:=vV to vB do - werte[j+i*params.xSteps]:= - werte[j+i*params.xSteps]+ - original^.werte[h+v*params.xSteps]; - if (hB>=hV) and (vB>=vV) then - werte[j+i*params.xSteps]:= - werte[j+i*params.xSteps] / (hB+1-hV) / (vB+1-vV); - end; - end; -end; +{$INCLUDE werteunit.inc} +{$UNDEF tLLWerte_kopiereLOVerzerrt} destructor tLLWerte.destroy; begin @@ -1587,224 +1212,14 @@ begin setLength(result,i); end; +{$DEFINE tLLWerte_integriere} procedure tLLWerte.integriereSingle(qu: pTLLWerteSingle; xMi,xMa,tMi,tMa,xOf,tOf: longint; richtung: tIntegrationsRichtung); -var - i,j: longint; - int,faktor: extended; -begin - case richtung of - irHorizontal: begin - faktor:=(qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1); - for i:=tMi to tMa do begin - int:=0; - for j:=0 to xMi-1 do - int:=int+qu^.werte[j + i*qu^.params.xSteps]; - for j:=xMi to xMa do begin - int:=int+qu^.werte[j + i*qu^.params.xSteps]; - werte[j-xOf + (i-tOf)*params.xSteps]:=int*faktor; - end; - end; - end; - irEinfall: begin - faktor:= - sqrt( - sqr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)) + - sqr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1))); - gibAus('dx = '+floatToStr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)),1); - gibAus('dt = '+floatToStr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1)),1); - for i:=tMi to tMa do begin // von links eintretendes (inkl. Ecke links unten) - int:=0; - for j:=1 to min(xMi,i) do - int:=int+qu^.werte[xMi-j + (i-j)*qu^.params.xSteps]; - for j:=0 to min(tMa-i,xMa-xMi) do begin - int:=int+qu^.werte[xMi+j + (i+j)*qu^.params.xSteps]; - werte[j+xMi-xOf + (i+j-tOf)*params.xSteps]:=int*faktor; - end; - end; - for i:=xMi+1 to xMa do begin // von unten eintretendes (exkl. Ecke links unten) - int:=0; - for j:=1 to min(tMi,i) do - int:=int+qu^.werte[i-j + (tMi-j)*qu^.params.xSteps]; - for j:=0 to min(tMa-tMi,xMa-i) do begin - int:=int+qu^.werte[i+j + (tMi+j)*qu^.params.xSteps]; - werte[i+j-xOf + (tMi+j-tOf)*params.xSteps]:=int*faktor; - end; - end; - end; - irAusfall: begin - faktor:= - sqrt( - sqr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)) + - sqr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1))); - gibAus('dx = '+floatToStr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)),1); - gibAus('dt = '+floatToStr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1)),1); - for i:=tMi to tMa do begin // nach links austretendes (inkl. Ecke links oben) - int:=0; - for j:=1 to min(xMi,qu^.params.tSiz-1-i) do - int:=int+qu^.werte[xMi-j + (i+j)*qu^.params.xSteps]; - for j:=0 to min(i-tMi,xMa-xMi) do begin - int:=int+qu^.werte[xMi+j + (i-j)*qu^.params.xSteps]; - werte[j+xMi-xOf + (i-j-tOf)*params.xSteps]:=int*faktor; - end; - end; - for i:=xMi+1 to xMa do begin // nach oben austretendes (exkl. Ecke links oben) - int:=0; - for j:=1 to min(qu^.params.tSiz-1-tMa,i) do - int:=int+qu^.werte[i-j + (tMa+j)*qu^.params.xSteps]; - for j:=0 to min(tMa-tMi,xMa-i) do begin - int:=int+qu^.werte[i+j + (tMa-j)*qu^.params.xSteps]; - werte[i+j-xOf + (tMa-j-tOf)*params.xSteps]:=int*faktor; - end; - end; - end; - end{of case}; -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.integriereDouble(qu: pTLLWerteDouble; xMi,xMa,tMi,tMa,xOf,tOf: longint; richtung: tIntegrationsRichtung); -var - i,j: longint; - int,faktor: extended; -begin - case richtung of - irHorizontal: begin - faktor:=(qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1); - for i:=tMi to tMa do begin - int:=0; - for j:=0 to xMi-1 do - int:=int+qu^.werte[j + i*qu^.params.xSteps]; - for j:=xMi to xMa do begin - int:=int+qu^.werte[j + i*qu^.params.xSteps]; - werte[j-xOf + (i-tOf)*params.xSteps]:=int*faktor; - end; - end; - end; - irEinfall: begin - faktor:= - sqrt( - sqr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)) + - sqr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1))); - gibAus('dx = '+floatToStr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)),1); - gibAus('dt = '+floatToStr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1)),1); - for i:=tMi to tMa do begin // von links eintretendes (inkl. Ecke links unten) - int:=0; - for j:=1 to min(xMi,i) do - int:=int+qu^.werte[xMi-j + (i-j)*qu^.params.xSteps]; - for j:=0 to min(tMa-i,xMa-xMi) do begin - int:=int+qu^.werte[xMi+j + (i+j)*qu^.params.xSteps]; - werte[j+xMi-xOf + (i+j-tOf)*params.xSteps]:=int*faktor; - end; - end; - for i:=xMi+1 to xMa do begin // von unten eintretendes (exkl. Ecke links unten) - int:=0; - for j:=1 to min(tMi,i) do - int:=int+qu^.werte[i-j + (tMi-j)*qu^.params.xSteps]; - for j:=0 to min(tMa-tMi,xMa-i) do begin - int:=int+qu^.werte[i+j + (tMi+j)*qu^.params.xSteps]; - werte[i+j-xOf + (tMi+j-tOf)*params.xSteps]:=int*faktor; - end; - end; - end; - irAusfall: begin - faktor:= - sqrt( - sqr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)) + - sqr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1))); - gibAus('dx = '+floatToStr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)),1); - gibAus('dt = '+floatToStr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1)),1); - for i:=tMi to tMa do begin // nach links austretendes (inkl. Ecke links oben) - int:=0; - for j:=1 to min(xMi,qu^.params.tSiz-1-i) do - int:=int+qu^.werte[xMi-j + (i+j)*qu^.params.xSteps]; - for j:=0 to min(i-tMi,xMa-xMi) do begin - int:=int+qu^.werte[xMi+j + (i-j)*qu^.params.xSteps]; - werte[j+xMi-xOf + (i-j-tOf)*params.xSteps]:=int*faktor; - end; - end; - for i:=xMi+1 to xMa do begin // nach oben austretendes (exkl. Ecke links oben) - int:=0; - for j:=1 to min(qu^.params.tSiz-1-tMa,i) do - int:=int+qu^.werte[i-j + (tMa+j)*qu^.params.xSteps]; - for j:=0 to min(tMa-tMi,xMa-i) do begin - int:=int+qu^.werte[i+j + (tMa-j)*qu^.params.xSteps]; - werte[i+j-xOf + (tMa-j-tOf)*params.xSteps]:=int*faktor; - end; - end; - end; - end{of case}; -end; - +{$INCLUDE werteunit.inc} procedure tLLWerte.integriereExtended(qu: pTLLWerteDouble; xMi,xMa,tMi,tMa,xOf,tOf: longint; richtung: tIntegrationsRichtung); -var - i,j: longint; - int,faktor: extended; -begin - case richtung of - irHorizontal: begin - faktor:=(qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1); - for i:=tMi to tMa do begin - int:=0; - for j:=0 to xMi-1 do - int:=int+qu^.werte[j + i*qu^.params.xSteps]; - for j:=xMi to xMa do begin - int:=int+qu^.werte[j + i*qu^.params.xSteps]; - werte[j-xOf + (i-tOf)*params.xSteps]:=int*faktor; - end; - end; - end; - irEinfall: begin - faktor:= - sqrt( - sqr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)) + - sqr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1))); - gibAus('dx = '+floatToStr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)),1); - gibAus('dt = '+floatToStr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1)),1); - for i:=tMi to tMa do begin // von links eintretendes (inkl. Ecke links unten) - int:=0; - for j:=1 to min(xMi,i) do - int:=int+qu^.werte[xMi-j + (i-j)*qu^.params.xSteps]; - for j:=0 to min(tMa-i,xMa-xMi) do begin - int:=int+qu^.werte[xMi+j + (i+j)*qu^.params.xSteps]; - werte[j+xMi-xOf + (i+j-tOf)*params.xSteps]:=int*faktor; - end; - end; - for i:=xMi+1 to xMa do begin // von unten eintretendes (exkl. Ecke links unten) - int:=0; - for j:=1 to min(tMi,i) do - int:=int+qu^.werte[i-j + (tMi-j)*qu^.params.xSteps]; - for j:=0 to min(tMa-tMi,xMa-i) do begin - int:=int+qu^.werte[i+j + (tMi+j)*qu^.params.xSteps]; - werte[i+j-xOf + (tMi+j-tOf)*params.xSteps]:=int*faktor; - end; - end; - end; - irAusfall: begin - faktor:= - sqrt( - sqr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)) + - sqr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1))); - gibAus('dx = '+floatToStr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)),1); - gibAus('dt = '+floatToStr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1)),1); - for i:=tMi to tMa do begin // nach links austretendes (inkl. Ecke links oben) - int:=0; - for j:=1 to min(xMi,qu^.params.tSiz-1-i) do - int:=int+qu^.werte[xMi-j + (i+j)*qu^.params.xSteps]; - for j:=0 to min(i-tMi,xMa-xMi) do begin - int:=int+qu^.werte[xMi+j + (i-j)*qu^.params.xSteps]; - werte[j+xMi-xOf + (i-j-tOf)*params.xSteps]:=int*faktor; - end; - end; - for i:=xMi+1 to xMa do begin // nach oben austretendes (exkl. Ecke links oben) - int:=0; - for j:=1 to min(qu^.params.tSiz-1-tMa,i) do - int:=int+qu^.werte[i-j + (tMa+j)*qu^.params.xSteps]; - for j:=0 to min(tMa-tMi,xMa-i) do begin - int:=int+qu^.werte[i+j + (tMa-j)*qu^.params.xSteps]; - werte[i+j-xOf + (tMa-j-tOf)*params.xSteps]:=int*faktor; - end; - end; - end; - end{of case}; -end; +{$INCLUDE werteunit.inc} +{$UNDEF tLLWerte_integriere} procedure tLLWerte.gauszFit(amplituden,breiten,positionen,ueberlappe,hintergruende: pTLLWerteExtended; von,bis: longint; senkrecht: boolean; fensterBreite,maxBreite,maxVerschiebung: extended; positionsMitten: tExtendedArray); var -- cgit v1.2.3-70-g09d2