Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function NormC: Double; | Calculate the C-norm of calling vector. |
| └ indexed: function NormC(Index: Integer; Len: Integer): Double; | ||
| 2 | function NormC(const Vec: TOpenCLMtxVec; RelativeError: Boolean): Double; | The C-norm. |
| └ indexed: function NormC(const Vec: TOpenCLMtxVec; VecIndex: Integer; Index: Integer; Len: Integer; RelativeError: Boolean): Double; |
Overload 1: function NormC: Double;
Calculate the C-norm of calling vector.
Returns: Double - NormC = max|a[i]|, 0 < i < Length-1 .
Indexed: function NormC(Index: Integer; Len: Integer): Double;
Calculates the C 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 NormC(const Vec: TOpenCLMtxVec; RelativeError: Boolean): Double;
The C-norm.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TOpenCLMtxVec | |
| 2 | RelativeError | Boolean |
Returns: Double - C norm: ||V-Vec||, where V is the calling vector.
Remarks:
If the NormC is called without any parameters, the NormC calculates the norm of the calling vector. The C 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
c: Double;
begin
TOpenCLMatrix a,b;
clMtxVec.CreateIt(out a, out b);
try
a.Size(2,2, TclFloatPrecision.clFloat, False);
b.Size(2,2, TclFloatPrecision.clFloat, False);
a.CopyFromArray([1,2,3,4]);
b.CopyFromArray([4,3,2,1]);
c := a.NormC(b,true);
finally
clMtxVec.FreeIt(out a, out b);
end;
end;
See Also: clMatrix.NormL1, clMatrix.NormL2
Indexed: function NormC(const Vec: TOpenCLMtxVec; VecIndex: Integer; Index: Integer; Len: Integer; RelativeError: Boolean): Double;
Calculates the C norm ||V-Vec|| between Vec elements [VecIndex]..[VecIndex+Len-1] and calling vector elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TOpenCLMtxVec | |
| 2 | VecIndex | Integer | |
| 3 | Index | Integer | start index |
| 4 | Len | Integer | element count |
| 5 | RelativeError | Boolean |
Returns: Double