Overload List
| # | Signature | Description |
|---|---|---|
| 1 | Double Sum | Sums Matrix 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 Matrix values.
Returns: Double - the sum of all calling object elements.
An exception is raised if calling object Dew.Math.Matrix.Complex property is true.
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: 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.Matrix.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.Matrix.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] and stores the result in complex ASum variable.
| # | 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)
An exception is raised if calling object Dew.Math.Matrix.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.Matrix.Complex property is True or array borders are overrun/underrun.