TMtxInt.Sum Method

Int32 Sum

Sums vector values.

Returns: Int32 - the sum of all calling object elements.

Examples
using Dew.Math;
using Dew.Math.Units;

namespace Dew.Examples
{
    void Example()
    {
        TMtxInt a;
        MtxVecInt.CreateIt(out a);
        try
        {
            a.SetIt(2,2,new int[] {1,3,-2});
            int s = a.Sum();  // s = 2
        }
        finally
        {
            MtxVecInt.FreeIt(ref a);
        }
    }
}

Indexed: Int32 Sum(Int32 Index, Int32 Len)

Returns the sum of calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1IndexInt32start index
2LenInt32element count

Returns: Int32

Remarks:

An exception is raised if array borders are overrun/underrun.