Overload List
| # | Signature | Description |
|---|---|---|
| 1 | Double Mean | Mean value. |
| └ indexed: Double Mean(Int32 Index, Int32 Len) | ||
| 2 | void Mean(ref Double AMean, Int32 Index, Int32 Len) | Calculate the mean value from calling object elements [Index]..[Index+Len-1]. |
Overload 1: Double Mean
Mean value.
Returns: Double
Remarks:
Calculate the mean value of all calling object elements. The result is a real value. An exception is raised if calling object Dew.Math.Matrix.Complex property is true.
Examples
Matrix a = new Matrix();
a.SetIt(2, 2, false, new double[] { 1.0, 2.0, 3.0, 4.0 });
double result = a.Mean();
if (Math.Abs(result - 2.5) > 1e-10)
throw new Exception("Matrix.Mean: expected 2.5, got " + result);
Matrix a;
double b;
a.SetIt(4,1,false,new double[] {1,2,3,4});
b = a.Mean; // b = 2.5
See Also: Matrix.Sum, Matrix.Meanc
Indexed: Double Mean(Int32 Index, Int32 Len)
Returns real mean value from calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Int32 | start index |
| 2 | Len | Int32 | element count |
Returns: Double
Remarks:
An exception is raised if calling object Dew.Math.Matrix.Complex property is true or array borders are overrun.
Overload 2: void Mean(ref Double AMean, Int32 Index, Int32 Len)
Calculate the mean value from calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | AMean | Double (ref) | pre-computed mean |
| 2 | Index | Int32 | start index |
| 3 | Len | Int32 | element count |
Result: stored in self (calling object)
Remarks:
The result AMean is a real value. An exception is raised if calling object Dew.Math.Matrix.Complex property is true or array borders are overrun/underrun.