Registriert seit: 28. Feb 2011
Ort: Mannheim
1.384 Beiträge
Delphi 10.4 Sydney
|
AW: Gauß-Verfahren - Matrix lösen
1. Sep 2015, 14:30
Was kriegst denn raus, wenn du (bei Floats) die Probe machst, also z.B. so. Da kann doch nix nennenswertes rauskommen?
Delphi-Quellcode:
function TGauss.GetMaxInversError: Extended; // E = A x A^-1;
var
I, J, K: integer;
Value: Extended;
begin
Result := 0;
SetLength(FTemp, Count, Count);
try
for I := 0 to Count - 1 do
for J := 0 to Count - 1 do
begin
Value := 0;
for K := 0 to Count - 1 do
Value := Value + FA[I, K] * FI[K, J];
FTemp[I, J] := Value;
end;
for I := 0 to Count - 1 do
for J := 0 to Count - 1 do
begin
if I = J then
Value := 1
else
Value := 0;
Result := Max(Result, Abs(Value - FTemp[I, J]));
end;
finally
SetLength(FTemp, 0);
end;
end;
|
|
Zitat
|