Overload List
| # | Signature | Description |
|---|---|---|
| 1 | int Sum() const; | Sums vector values. |
| 2 | int Sum(const int Index, const int Len) const; | Returns the sum of calling object elements [Index]..[Index+Len-1]. |
Overload 1: int Sum() const;
Sums vector values.
Returns: the sum of all calling object elements.
Examples
#include "MtxVecInt.h"
#include "Units.MtxVecInt.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVecInt;
void Example()
{
TMtxInt* a;
CreateIt(a);
a->SetIt(1, 3, DewArray<int>{1,3,-2});
int s = a->Sum(); // s = 2
FreeIt(a);
}
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler
Overload 2: int Sum(const int Index, const int Len) const;
Returns the sum of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | const int | |
| 2 | Len | const int |
Remarks:
An exception is raised if array borders are overrun/underrun.
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler