Overload List
| # | Signature | Description |
|---|---|---|
| 1 | Int32 Max | Maximum value. |
| └ indexed: Int32 Max(Int32 Index, Int32 Len) | ||
| 2 | Int32 Max(ref Int32 aIndex) | Calculate the maximum value of all calling object elements. |
| └ indexed: Int32 Max(ref Int32 aIndex, Int32 Index, Int32 Len) |
Overload 1: Int32 Max
Maximum value.
Returns: Int32 - The maximum value of all calling object elements. The result is an integer value.
Examples
Matrix a = new Matrix();
a.SetIt(2, 2, false, new double[] { 1.0, 2.0, 3.0, 4.0 });
double result = a.Max();
if (Math.Abs(result - 4.0) > 1e-10)
throw new Exception("Matrix.Max: expected 4.0, got " + result);
Matrix a;
double b;
a.SetIt(2,2,false,new double[] {1,2,3,4});
b = a.Max; // b = 4
Indexed: Int32 Max(Int32 Index, Int32 Len)
Calculate the maximum value from calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Int32 | start index |
| 2 | Len | Int32 | element count |
Returns: Int32
Remarks:
The result is an integer value. An exception is raised if array borders are overrun.
Overload 2: Int32 Max(ref Int32 aIndex)
Calculate the maximum value of all calling object elements.
| # | Name | Description |
|---|---|---|
| 1 | aIndex | Stores maximum value index. |
Returns: Int32 - the maximum of all calling vector integer elements in-place.
Examples
using Dew.Math;
using Dew.Math.Units;
namespace Dew.Examples
{
void Example()
{
var a = new MatrixInt(2, 2);
a.CopyFromArray([1, 2, 3, 4]);
int ind;
int max = a.Max(out ind); // max = 4, ind = 3
}
}
Indexed: Int32 Max(ref Int32 aIndex, Int32 Index, Int32 Len)
Calculate the maximum value of calling object elements [Index..Index+Len-1].
| # | Name | Description |
|---|---|---|
| 1 | aIndex | Returns maximum value index. |
| 2 | Index | The starting index at which to start the search. |
| 3 | Len | The number of elements to search starting from Index. |
Returns: Int32 - the maximum of calling vector integer elements [Index..Index+Len-1].
Remarks:
An exception is raised if array borders are overrun/underrun.