You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TOpenCLMtxVec Class > TOpenCLMtxVec Methods > Sum Method > TOpenCLMtxVec.Sum Method ()
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TOpenCLMtxVec.Sum Method ()

Sums vector values.

Syntax
C#
Visual Basic
public double Sum();

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

using Dew.Math; using Dew.Math.Units; namespace Dew.Examples() { void Example() { TOpenCLVector a; clMtxVec.CreateIt(out a); try { a.CopyFromArray(new double[] {1,3,-2}); doouble s = a.Sum(); // s = 2 } finally { clMtxVec.FreeIt(ref a); } } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!