Overload List
| # | Signature | Description |
|---|---|---|
| 1 | Double NormL1 | Calculate the L1-norm of the calling vector. |
| └ indexed: Double NormL1(Int32 Index, Int32 Len) | ||
| 2 | Double NormL1(TDenseMtxVec Vec, Boolean RelativeError) | The L1-norm. |
| └ indexed: Double NormL1(TDenseMtxVec Vec, Int32 VecIndex, Int32 Index, Int32 Len, Boolean RelativeError) |
Overload 1: Double NormL1
Calculate the L1-norm of the calling vector.
Returns: Double
Remarks:
NormL1 = sum | a[i] |, 0 < i < Length-1
Indexed: Double NormL1(Int32 Index, Int32 Len)
Calculates the L1 norm from calling vector elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Int32 | start index |
| 2 | Len | Int32 | element count |
Returns: Double
Overload 2: Double NormL1(TDenseMtxVec Vec, Boolean RelativeError)
The L1-norm.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TDenseMtxVec | source TVec or TMtx |
| 2 | RelativeError | Boolean |
Returns: Double
Remarks:
Calculates the L1 norm : ||V-Vec||, where V is calling vector. 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
Vector a;
Vector b;
double c;
a.SetIt(false,new double[] {1,2,3,4});
b.SetIt(false,new double[] {4,3,2,1});
c = a.NormL1(b,true);
See Also: Vector.NormC, Vector.NormL2
Indexed: Double NormL1(TDenseMtxVec Vec, Int32 VecIndex, Int32 Index, Int32 Len, Boolean RelativeError)
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 | TDenseMtxVec | source TVec or TMtx |
| 2 | VecIndex | Int32 | |
| 3 | Index | Int32 | start index |
| 4 | Len | Int32 | element count |
| 5 | RelativeError | Boolean |
Returns: Double