You are here: Symbol Reference > clMtxExpr Namespace > Classes > clMatrix Record > public > NormL1 Method > clMatrix.NormL1 Method (TOpenCLMtxVec, boolean)
MtxVec VCL
ContentsIndex
PreviousUpNext
clMatrix.NormL1 Method (TOpenCLMtxVec, boolean)

The L1-norm.

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

L-1 norm, defined by: ||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": 

 

 

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.NormL1(b,True); end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!