Int32 Sum
Sums vector values.
Returns: Int32 - the sum of all calling object elements.
Examples
Matrix a = new Matrix();
a.SetIt(2, 2, false, new double[] { 1.0, 2.0, 3.0, 4.0 });
double result = a.Sum();
if (Math.Abs(result - 10.0) > 1e-10)
throw new Exception("Matrix.Sum: expected 10.0, got " + result);
Matrix a;
double b;
a.SetIt(1,4,false,new double[] {1,2,3,4});
b = a.Sum; // b = 10
Indexed: Int32 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: Int32
Remarks:
An exception is raised if array borders are overrun/underrun.