clMatrix.NormC Method

Overload List

#SignatureDescription
1function NormC: double; overload;Calculate the C-norm of calling vector.
└ indexed: function NormC(Index,Len: integer): double; overload;
2function NormC(const Vec: TOpenCLMtxVec; RelativeError: boolean = false): double; overload;The C-norm.
└ indexed: function NormC(const Vec: TOpenCLMtxVec; VecIndex,Index,Len: integer; RelativeError: boolean = false): double; overload;

Overload 1: function NormC: double; overload;

Calculate the C-norm of calling vector.

Returns: double - NormC = max|a[i]|, 0 < i < Length-1 .

Indexed: function NormC(Index,Len: integer): double; overload;

Calculates the C norm from calling vector elements [Index]..[Index+Len-1].

#NameTypeDescription
1Indexintegerstart index
2Lenintegerelement count

Returns: double

Overload 2: function NormC(const Vec: TOpenCLMtxVec; RelativeError: boolean = false): double; overload;

The C-norm.

#NameTypeDescription
1VecTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2RelativeErrorBoolean

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:

∥V−Vec∥C=max⁡k∣V[k]−Vec[k]∣\|\text{V} - \text{Vec}\| _C = \max _k |\text{V}[k]-\text{Vec}[k]|

If RelativeError is true then the computed norm is divided by the norm of V, and the function returns the "relative error":

∥V−Vec∥∥V∥\frac{\| \text{V} - \text{Vec}\|}{\|\text{V}\|}
Examples
var a,b: clMatrix;
    c: double;
begin
    a.Size(2,2, clFloat, false);
    b.Size(2,2, clFloat, false);

    a.CopyFromArray(TDoubleArray.Create(1,2,3,4));
    b.CopyFromArray(TDoubleArray.Create(4,3,2,1));
    c := a.NormC(b);
end;
See Also: clMatrix.NormL1, clMatrix.NormL1, clMatrix.NormL1, clMatrix.NormL1, clMatrix.NormL2, clMatrix.NormL2, clMatrix.NormL2, clMatrix.NormL2

Indexed: function NormC(const Vec: TOpenCLMtxVec; VecIndex,Index,Len: integer; RelativeError: boolean = false): double; overload;

Calculates the C norm ||V-Vec|| between Vec elements [VecIndex]..[VecIndex+Len-1] and calling vector elements [Index]..[Index+Len-1].

#NameTypeDescription
1VecTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2VecIndexinteger
3Indexintegerstart index
4Lenintegerelement count
5RelativeErrorBoolean

Returns: double