Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function ThreshTop(const Src: TMtxVec; Value: Double): TMtxVec; | Perform threshold operation on all Src object values and store the results in calling object. |
| └ indexed: function ThreshTop(const Vec: TMtxVec; Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec; | ||
| 2 | function ThreshTop(Value: Double): TMtxVec; | Threshold top operation. |
| └ indexed: function ThreshTop(Value: Double; Index: Integer; Len: Integer): TMtxVec; |
Overload 1: function ThreshTop(const Src: TMtxVec; Value: Double): TMtxVec;
Perform threshold operation on all Src object values and store the results in calling object.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxVec | |
| 2 | Value | Double | scalar |
Result: stored in self (calling object), returns self for chaining
Size and Vector.Complex properties of the calling object are adjusted automatically.
Indexed: function ThreshTop(const Vec: TMtxVec; Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
Perform a threshold operation Vec elements [VecIndex]..[VecIndex+Len-1] and store the results in the calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TMtxVec | |
| 2 | Value | Double | scalar |
| 3 | VecIndex | Integer | |
| 4 | Index | Integer | start index |
| 5 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Size and Vector.Complex properties of the calling object must be set explicitly. An exception is raised if Vector.ConditionCheck is true and array borders are overrun/underrun.
Overload 2: function ThreshTop(Value: Double): TMtxVec;
Threshold top operation.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | Double | scalar |
Result: stored in self (calling object), returns self for chaining
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.
var a: Vector;
begin
a.SetIt(True,[2,0.1,3,4]);
a.Threshtop(0.2); // a = [0.2,0.1,0.2,0.2]
end;
var
a, expected: Vector;
begin
a := [1.0, 5.0, 3.0, 7.0, 2.0];
a.ThreshTop(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.ThreshTop: mismatch');
end;
Indexed: function ThreshTop(Value: Double; Index: Integer; Len: Integer): TMtxVec;
Perfrom the threshold operation on calling object values [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Value | Double | scalar |
| 2 | Index | Integer | start index |
| 3 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
An exception is raised if array borders are overrun/underrun.