mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 03:29:28 +02:00
Merged revision(s) 62069-62070 #40d59fec0b-#40d59fec0b, 62073 #6d317e22dc from trunk:
TAChart: Fix chart distance tools crashing when series contains a NaN value. ........ TAChart: Replace r62069 #40d59fec0b by better solution. ........ TAChart: Fix divide-by-zero error in TFitSeries. ........ git-svn-id: branches/fixes_2_0@62084 -
This commit is contained in:
parent
8e223c396b
commit
fbe9203283
@ -1742,8 +1742,12 @@ var
|
|||||||
begin
|
begin
|
||||||
Unused(APointIdx);
|
Unused(APointIdx);
|
||||||
Unused(AXIdx, AYIdx);
|
Unused(AXIdx, AYIdx);
|
||||||
pt := ParentChart.GraphToImage(AGraphPt);
|
if IsNaN(AGraphPt) then
|
||||||
Result := AParams.FDistFunc(AParams.FPoint, pt);
|
exit(MaxInt)
|
||||||
|
else begin
|
||||||
|
pt := ParentChart.GraphToImage(AGraphPt);
|
||||||
|
Result := AParams.FDistFunc(AParams.FPoint, pt);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// AIndex refers to the index into YList here.
|
// AIndex refers to the index into YList here.
|
||||||
|
@ -332,7 +332,10 @@ begin
|
|||||||
ycalc := CalcBestFitValues(x, y, n, m, FitParams);
|
ycalc := CalcBestFitValues(x, y, n, m, FitParams);
|
||||||
CalcSumOfSquares(y, dy, ycalc, Result.SSE, Result.SSR);
|
CalcSumOfSquares(y, dy, ycalc, Result.SSE, Result.SSR);
|
||||||
SetLength(ycalc, 0);
|
SetLength(ycalc, 0);
|
||||||
chi2 := Result.SSE / (n - mfit);
|
if n > mfit then
|
||||||
|
chi2 := Result.SSE / (n - mfit)
|
||||||
|
else
|
||||||
|
chi2 := NaN;
|
||||||
|
|
||||||
// Calculate inverse of alpha. This is (almost) the variance-covariance matrix
|
// Calculate inverse of alpha. This is (almost) the variance-covariance matrix
|
||||||
invgen(mfit, mfit, alpha[0], term);
|
invgen(mfit, mfit, alpha[0], term);
|
||||||
|
Loading…
Reference in New Issue
Block a user