TVecByte.ThresholdGT_LT Method

Overload List

#SignatureDescription
1function ThresholdGT_LT(const GTLevel: Integer; const GTValue: Integer; const LTLevel: Integer; const LTValue: Integer): TMtxVecInt;Threshold greater than and less than operation.
└ indexed: function ThresholdGT_LT(const GTLevel: Integer; const GTValue: Integer; const LTLevel: Integer; const LTValue: Integer; Index: Integer; Len: Integer): TMtxVecInt;
2function ThresholdGT_LT(const Vec: TMtxVecInt; const GTLevel: Integer; const GTValue: Integer; const LTLevel: Integer; const LTValue: Integer): TMtxVecInt;Perform "greater than and less than" threshold operation on all Vec object values.
3function ThresholdGT_LT(const Vec: TMtxVecInt; const GTLevel: Integer; const GTValue: Integer; const LTLevel: Integer; const LTValue: Integer; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVecInt;Perform "greater than and less than" threshold operation on Vec elements from range [VecIndex]..[VecIndex+Len-1].

Overload 1: function ThresholdGT_LT(const GTLevel: Integer; const GTValue: Integer; const LTLevel: Integer; const LTValue: Integer): TMtxVecInt;

Threshold greater than and less than operation.

#NameTypeDescription
1GTLevelInteger
2GTValueInteger
3LTLevelInteger
4LTValueInteger

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

Remarks:

Perform operation on all calling object values. The LTValue parameter is an lower bound for threshold operation. The GTValue parameter is an upper bound for threshold operation. All values less than LTLevel will be replaced with LTValue. All values bigger than GTLevel will be replaced with GTValue.

Examples
var
    a: TMtxInt;
begin
MtxVecInt.CreateIt(out a);
try
a.SetIt(2,2, new int[] {20,1,30,40});
a.ThresholdGT_LT(23,34,10,5); // a = [20,5,34,34]
finally
MtxVecInt.FreeIt(ref a);
end;
end;

Indexed: function ThresholdGT_LT(const GTLevel: Integer; const GTValue: Integer; const LTLevel: Integer; const LTValue: Integer; Index: Integer; Len: Integer): TMtxVecInt;

Perfrom "greater than and less than" threshold operation on the calling object values in range [Index]..[Index+Len-1].

#NameTypeDescription
1GTLevelInteger
2GTValueInteger
3LTLevelInteger
4LTValueInteger
5IndexIntegerstart index
6LenIntegerelement count

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

Remarks:

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

Examples
var a: TMtxInt;
begin
    CreateIt(a);
    try
        a.SetIt(2,2,[20,1,30,40]);
        a.ThresholdGT_LT(23,34,10,5); // a = [20,5,34,34]
    finally
        FreeIt(a);
    end;
end;

Overload 2: function ThresholdGT_LT(const Vec: TMtxVecInt; const GTLevel: Integer; const GTValue: Integer; const LTLevel: Integer; const LTValue: Integer): TMtxVecInt;

Perform "greater than and less than" threshold operation on all Vec object values.

#NameTypeDescription
1VecTMtxVecIntsource TVecInt or TMtxInt
2GTLevelInteger
3GTValueInteger
4LTLevelInteger
5LTValueInteger

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

Remarks:

Store the results in calling object. Size of the calling object is adjusted automatically.

Overload 3: function ThresholdGT_LT(const Vec: TMtxVecInt; const GTLevel: Integer; const GTValue: Integer; const LTLevel: Integer; const LTValue: Integer; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVecInt;

Perform "greater than and less than" threshold operation on Vec elements from range [VecIndex]..[VecIndex+Len-1].

#NameTypeDescription
1VecTMtxVecIntsource TVecInt or TMtxInt
2GTLevelInteger
3GTValueInteger
4LTLevelInteger
5LTValueInteger
6VecIndexInteger
7IndexIntegerstart index
8LenIntegerelement 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 of the calling object must be set explicitly. An exception is raised if TMtxVecBase.ConditionCheck is true and array borders are overrun/underrun.