Overload List
| # | Signature | Description |
|---|---|---|
| 1 | Double Sum | Sums vector values. |
| └ indexed: Double Sum(Int32 Index, Int32 Len) | ||
| 2 | void Sum(ref TCplx ASum) | Calculates the sum of all calling object complex elements. |
| └ indexed: void Sum(ref TCplx ASum, Int32 Index, Int32 Len) | ||
| 3 | void Sum(ref Double ASum, Int32 Index, Int32 Len) | Calculates the sum of calling object elements [Index]..[Index+Len-1]. |
Overload 1: Double Sum
Sums vector values.
Returns: Double - the sum of all calling object elements. An exception is raised if calling object Dew.Math.TOpenCLBase.Complex property 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);
}
}
}
Indexed: Double Sum(Int32 Index, Int32 Len)
Returns the sum of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Int32 | start index |
| 2 | Len | Int32 | element count |
Returns: Double
An exception is raised if calling object Dew.Math.TOpenCLBase.Complex property is True or array borders are overrun/underrun.
Overload 2: void Sum(ref TCplx ASum)
Calculates the sum of all calling object complex elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ASum | TCplx (ref) | output sum |
Result: stored in self (calling object)
Stores the result in complex ASum variable. An exception is raised if calling object Dew.Math.TOpenCLBase.Complex property is False.
Indexed: void Sum(ref TCplx ASum, Int32 Index, Int32 Len)
Calculates the sum of calling object complex elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ASum | TCplx (ref) | output sum |
| 2 | Index | Int32 | start index |
| 3 | Len | Int32 | element count |
Result: stored in self (calling object)
Stores the result in complex ASum variable. An exception is raised if calling object Dew.Math.TOpenCLBase.Complex property is False or array borders are overrun/underrun.
Overload 3: void Sum(ref Double ASum, Int32 Index, Int32 Len)
Calculates the sum of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | ASum | Double (ref) | output sum |
| 2 | Index | Int32 | start index |
| 3 | Len | Int32 | element count |
Result: stored in self (calling object)
Stores the result in real ASum variable. An exception is raised if calling object Dew.Math.TOpenCLBase.Complex property is True or array borders are overrun/underrun.