Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function NormL1: double; overload; | Calculate the L1-norm of the calling vector. |
| └ indexed: function NormL1(Index,Len: integer): double; overload; | ||
| 2 | function NormL1(const Vec: TOpenCLMtxVec; RelativeError: boolean = false): double; overload; | The L1-norm. |
| └ indexed: function NormL1(const Vec: TOpenCLMtxVec; VecIndex,Index,Len: integer; RelativeError: boolean = false): double; overload; |
Overload 1: function NormL1: double; overload;
Calculate the L1-norm of the calling vector.
Returns: double - L-1 norm, defined by the following equation: NormL1 = Sum(|a[i]|), 0 < i < Length-1
Indexed: function NormL1(Index,Len: integer): double; overload;
Calculates the L1 norm from calling vector elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | integer | start index |
| 2 | Len | integer | element count |
Returns: double
Overload 2: function NormL1(const Vec: TOpenCLMtxVec; RelativeError: boolean = false): double; overload;
The L1-norm.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TOpenCLMtxVec | source TOpenCLVector or TOpenCLMatrix |
| 2 | RelativeError | Boolean |
Returns: double - L-1 norm, defined by: ||V-Vec||, where V is calling vector.
Remarks:
If the NormL1 is called without any parameters, the NormL1 calculates the norm of calling vector. The L1 norm of ||V-Vec|| is defined by the formula:
If RelativeError is true then the computed norm is divided by the norm of V, and the function returns the "relative error":
Examples
var a,b: clVector;
c: double;
begin
a.CopyFromArray(TDoubleArray.Create(1,2,3,4));
b.CopyFromArray(TDoubleArray.Create(4,3,2,1));
c := a.NormL1(b,True);
end;
Indexed: function NormL1(const Vec: TOpenCLMtxVec; VecIndex,Index,Len: integer; RelativeError: boolean = false): double; overload;
Calculates the L1 norm ||V-Vec|| between Vec elements [VecIndex]..[VecIndex+Len-1] and calling vector elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TOpenCLMtxVec | source TOpenCLVector or TOpenCLMatrix |
| 2 | VecIndex | integer | |
| 3 | Index | integer | start index |
| 4 | Len | integer | element count |
| 5 | RelativeError | Boolean |
Returns: double