You are here: Symbol Reference > clMtxVec Namespace > Classes > TOpenCLMtxVec Class > public > NormC Method > TOpenCLMtxVec.NormC Method (TOpenCLMtxVec, boolean)
MtxVec VCL
ContentsIndex
PreviousUpNext
TOpenCLMtxVec.NormC Method (TOpenCLMtxVec, boolean)

The C-norm.

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

C norm: ||V-Vec||, where V is the calling vector.

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": 

 

 

 

var a,b: TOpenCLVector; c: double; begin CreateIt(a,b); try a.CopyFromArray(TDoubleArray.Create(1,2,3,4)); b.CopyFromArray(TDoubleArray.Create(4,3,2,1)); c := a.NormC(b); finally FreeIt(a,b); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!