LazStats: Inherit form in CorSimUnit from TBasicStatsReportAndChartForm. Use TAChart.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7784 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-10-19 22:03:10 +00:00
parent ad2b13edcf
commit 272f8ced87
5 changed files with 644 additions and 550 deletions

View File

@ -42,19 +42,24 @@ procedure VecMeanVarStdDevSS(const AData: TDblVector;
procedure VecSumSS(const AData: TDblVector;
out Sum, SS: Double);
function VecHistogram(const AData: TDblVector; AMin, AMax: Double;
N: Integer): TDblVector;
function VecMedian(const AData: TDblVector): Double;
// Matrices
{ NOTE: Indices follow math convention:
- 1st index is the row index, i.e. runs vertically
- 2nd index is the col index, i.e. runs horizontally
All indices are 0-based. }
operator + (A, B: TDblMatrix): TDblMatrix;
operator - (A, B: TDblMatrix): TDblMatrix;
operator * (A, B: TDblMatrix): TDblMatrix;
operator * (A: TDblMatrix; v: TDblVector): TDblVector;
{ NOTE: Indices follow math convention:
- 1st index is the row index, i.e. runs vertically
- 2nd index is the col index, i.e. runs horizontally
All indices are 0-based. }
function MatAppendColVector(A: TDblMatrix; v: TDblVector): TDblMatrix;
procedure MatCheck(A: TDblMatrix);
procedure MatCheckSquare(A: TDblMatrix; out n: Integer);
@ -319,6 +324,26 @@ begin
end;
function VecHistogram(const AData: TDblVector; AMin, AMax: Double;
N: Integer): TDblVector;
var
i, j: Integer;
factor: Double;
begin
SetLength(Result, N);
for j := 0 to N-1 do Result[j] := 0;
factor := N / (AMax - AMin);
for i := 0 to High(AData) do
begin
j := trunc((AData[i] - AMin) * factor);
if j <= 0 then j := 0;
if j >= N then j := N-1;
Result[j] := Result[j] + 1;
end;
end;
function VecMedian(const AData: TDblVector): Double;
var
N, midPt: integer;