TSparseMtx.RMS Method

function RMS: Double;

Root mean squared of all non-zero elements.

Returns: Double

Examples
var a: Matrix;
    c: double;
begin
    a.SetIt(1,4,False,[1,2,3,4]);
    c := a.RMS;
end;
var
    a: Matrix;
    result: double;
begin
    a := [[1.0, 2.0], [3.0, 4.0]];
    result := a.RMS;
    if Abs(result - 2.73861278752583) > 1e-10 then
        raise Exception.Create('Matrix.RMS: expected 2.73861278752583, got ' + result.ToString);
end;

Indexed: function RMS(Index: Integer; Len: Integer): Double;

Calculate the RMS for calling object elements [Index]..[Index+Len-1] in-place.

#NameTypeDescription
1IndexIntegerstart index
2LenIntegerelement count

Returns: Double

Remarks:

An exception is raised if array borders are overrun.