Vector.ThreshAbsGT Method

Overload List

#SignatureDescription
1function ThreshAbsGT(const Src: TMtxVec; const Value: Double): TMtxVec;Perform threshold operation on all Src object values.
└ indexed: function ThreshAbsGT(const Vec: TMtxVec; const Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
2function ThreshAbsGT(const Value: Double): TMtxVec;Threshold top and bottom centered around zero.
└ indexed: function ThreshAbsGT(const Value: Double; Index: Integer; Len: Integer): TMtxVec;

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

Perform threshold operation on all Src object values.

#NameTypeDescription
1SrcTMtxVec
2ValueDouble

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

Remarks:

Store the results in calling object. Size and Vector.Complex properties of the calling object are adjusted automatically.

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

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

#NameTypeDescription
1VecTMtxVec
2ValueDouble
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 Vector.Complex properties of the calling object must be set explicitly. An exception is raised if TMtxVecBase.ConditionCheck is true and array borders are overrun/underrun.

Overload 2: function ThreshAbsGT(const Value: Double): TMtxVec;

Threshold top and bottom centered around zero.

#NameTypeDescription
1ValueDouble

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

Remarks:

Perform threshold operation on all calling object values. The Value parameter is an upper bound for threshold operation. All values bigger than Value will be replaced with Value and all values smaller than -Value will be replaced with -Value. The comparison checks if abs(Values[i]) > Value.

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

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

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

#NameTypeDescription
1ValueDouble
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.