Overload List
| # | Signature | Description |
|---|---|---|
| 1 | int Max() const; | Maximum value. |
| 2 | int Max(const int Index, const int Len) const; | Calculate the maximum value from calling object elements [Index]..[Index+Len-1]. |
| 3 | int Max(int &aIndex) const; | Calculate the maximum value of all calling object elements. |
| 4 | int Max(int &aIndex, const int Index, const int Len) const; | Calculate the maximum value of calling object elements [Index..Index+Len-1]. |
Overload 1: int Max() const;
Maximum value.
Returns: The maximum value of all calling object elements. The result is an integer value.
Examples
#include "MtxVecInt.h"
#include "Units.MtxVecInt.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVecInt;
void Example()
{
TMtxInt* a;
CreateIt(a);
a->SetIt(2, 2, DewArray<int>{1,2,3,4});
int b = a->Max(); // 4
FreeIt(a);
}
See Also: MatrixInt::Max
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler
Overload 2: int Max(const int Index, const int Len) const;
Calculate the maximum value from calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | const int | |
| 2 | Len | const int |
Remarks:
The result is an integer value. An exception is raised if array borders are overrun.
Examples
#include "MtxExprInt.h"
#include "Units.MtxExprInt.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxExprInt;
void Example()
{
MatrixInt a;
int max, ind;
a = {{1, 2}, {3, 4}};
max = a.Max(ind); // max = 4, ind = 3
}
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler
Overload 3: int Max(int &aIndex) const;
Calculate the maximum value of all calling object elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | aIndex | int & | Stores maximum value index. |
Returns: the maximum of all calling vector integer elements in-place.
Examples
#include "MtxExprInt.h"
using namespace Dew;
using namespace Dew::Math;
void Example()
{
MatrixInt a(2, 2);
a.CopyFromArray(DewArray<int>{1, 2, 3, 4});
int ind;
int max = a.Max(ind); // max = 4, ind = 3
}
See Also: MatrixInt::Min
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler
Overload 4: int Max(int &aIndex, const int Index, const int Len) const;
Calculate the maximum value of calling object elements [Index..Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | aIndex | int & | Returns maximum value index. |
| 2 | Index | const int | The starting index at which to start the search. |
| 3 | Len | const int | The number of elements to search starting from Index. |
Returns: the maximum of calling vector integer elements [Index..Index+Len-1].
Remarks:
An exception is raised if array borders are overrun/underrun.
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler