Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function NormL2: Double; | Calculate the L2-norm of the calling vector. |
| └ indexed: function NormL2(Index: Integer; Len: Integer): Double; | ||
| 2 | function NormL2(const Vec: TDenseMtxVec; RelativeError: Boolean): Double; | The L2-norm. |
| └ indexed: function NormL2(const Vec: TDenseMtxVec; VecIndex: Integer; Index: Integer; Len: Integer; RelativeError: Boolean): Double; |
Overload 1: function NormL2: Double;
Calculate the L2-norm of the calling vector.
Returns: Double
Remarks:
NormL2 = ( sum | a[i] |^2 )^(0.5), 0 < i < Length-1
Indexed: function NormL2(Index: Integer; Len: Integer): Double;
Calculates the L2 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 NormL2(const Vec: TDenseMtxVec; RelativeError: Boolean): Double;
The L2-norm.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TDenseMtxVec | |
| 2 | RelativeError | Boolean |
Returns: Double
Remarks:
Calculates the L2 norm : ||V-Vec||, where V is calling vector. If the NormL2 is called without any parameters, the NormL2 calculates the norm of calling vector. The L2 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: Vector;
c: double;
begin
a.SetIt(False,[1,2,3,4]);
b.SetIt(False,[4,3,2,1]);
c := a.NormL2(b,True);
end;
See Also: Vector.NormC, Vector.NormL1
Indexed: function NormL2(const Vec: TDenseMtxVec; VecIndex: Integer; Index: Integer; Len: Integer; RelativeError: Boolean): Double;
Calculates the L2 norm ||V-Vec|| between Vec elements [VecIndex]..[VecIndex+Len-1] and calling vector elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TDenseMtxVec | |
| 2 | VecIndex | Integer | |
| 3 | Index | Integer | start index |
| 4 | Len | Integer | element count |
| 5 | RelativeError | Boolean |
Returns: Double