You've already forked lazarus-ccr
LazStats: Refactor NormalityUnit (integrate report, add probability chart based on TAChart).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7694 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -25,7 +25,7 @@ procedure Exchange(var a, b: Double); overload;
|
||||
procedure Exchange(var a, b: Integer); overload;
|
||||
procedure Exchange(var a, b: String); overload;
|
||||
|
||||
procedure SortOnX(X, Y: DblDyneVec);
|
||||
procedure SortOnX(X: DblDyneVec; Y: DblDyneVec = nil; Z: DblDyneVec = nil);
|
||||
procedure SortOnX(X: DblDyneVec; Y: DblDyneMat);
|
||||
|
||||
function IndexOfString(L: StrDyneVec; s: String): Integer;
|
||||
@@ -131,13 +131,15 @@ begin
|
||||
b := tmp;
|
||||
end;
|
||||
|
||||
procedure SortOnX(X, Y: DblDyneVec);
|
||||
procedure SortOnX(X: DblDyneVec; Y: DblDyneVec = nil; Z: DblDyneVec = nil);
|
||||
var
|
||||
i, j, N: Integer;
|
||||
begin
|
||||
N := Length(X);
|
||||
if N <> Length(Y) then
|
||||
raise Exception.Create('[SortOnX] Both arrays must have the same length');
|
||||
if (Y <> nil) and (N <> Length(Y)) then
|
||||
raise Exception.Create('[SortOnX] Arrays must have the same length.');
|
||||
if (Z <> nil) and (N <> Length(Z)) then
|
||||
raise Exception.Create('[SortOnX] Arrays must have the same length.');
|
||||
|
||||
for i := 0 to N - 2 do
|
||||
begin
|
||||
@@ -146,7 +148,10 @@ begin
|
||||
if X[i] > X[j] then //swap
|
||||
begin
|
||||
Exchange(X[i], X[j]);
|
||||
Exchange(Y[i], Y[j]);
|
||||
if Y <> nil then
|
||||
Exchange(Y[i], Y[j]);
|
||||
if Z <> nil then
|
||||
Exchange(Z[i], Z[j]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user