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

Sums vector values.

Pascal
function Sum: double; overload;

the sum of all calling object elements. An exception is raised if calling object TOpenCLBase.ComplexComplexproperty is true.

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