Matrix.ThreshBottom Method

Overload List

#SignatureDescription
1function ThreshBottom(const Src: TMtxVec; Value: Double): TMtxVec;Perform threshold operation on all Src object values and store the results in calling object.
└ indexed: function ThreshBottom(const Vec: TMtxVec; Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
2function ThreshBottom(Value: Double): TMtxVec;Threshold bottom operation.
└ indexed: function ThreshBottom(Value: Double; Index: Integer; Len: Integer): TMtxVec;

Overload 1: function ThreshBottom(const Src: TMtxVec; Value: Double): TMtxVec;

Perform threshold operation on all Src object values and store the results in calling object.

#NameTypeDescription
1SrcTMtxVec
2ValueDoublescalar

Result: stored in self (calling object), returns self for chaining

Remarks:

Size and Matrix.Complex properties of the calling object are adjusted automatically.

Indexed: function ThreshBottom(const Vec: TMtxVec; Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;

Perform a threshold operation on Vec elements [VecIndex]..[VecIndex+Len-1].

#NameTypeDescription
1VecTMtxVec
2ValueDoublescalar
3VecIndexInteger
4IndexIntegerstart index
5LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Remarks:

Store the results in the calling object elements [Index]..[Index+Len-1]. Size and Matrix.Complex properties of the calling object must be set explicitly. An exception is raised if Matrix.ConditionCheck is true and array borders are overrun/underrun.

Overload 2: function ThreshBottom(Value: Double): TMtxVec;

Threshold bottom operation.

#NameTypeDescription
1ValueDoublescalar

Result: stored in self (calling object), returns self for chaining

Remarks:

Perform threshold operation on all calling object values. The Value parameter is a lower bound for threshold operation. All values smaller than Value will be replaced with Value.

Examples
var a: Matrix;
begin
    a.SetIt(1,2,True,[2,0.1,3,4]);
    a.ThreshBottom(0.2); // a = [2,0.2,3,4]
end;
var
    a, expected: Matrix;
begin
    a := [[1.0, 5.0, 3.0, 7.0, 2.0]];
    a.ThreshBottom(4.0);
    expected := [[4.0, 5.0, 4.0, 7.0, 4.0]];
    if not a.IsEqual(expected, 1e-10, TCompare.cmpAbsolute) then
        raise Exception.Create('Matrix.ThreshBottom: mismatch');
end;
See Also: Matrix.ThreshTop

Indexed: function ThreshBottom(Value: Double; Index: Integer; Len: Integer): TMtxVec;

Perform the threshold operation on calling object values [Index]..[Index+Len-1].

#NameTypeDescription
1ValueDoublescalar
2IndexIntegerstart index
3LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Remarks:

An exception is raised if array borders are overrun/underrun.