Matrix::Max Method

Overload List

#SignatureDescription
1double Max() const;Maximum value.
2double Max(int Index, int Len) const;Returns the maximum value from calling object elements [Index]..[Index+Len-1]. The result is a real value.
3void Max(double &AMax, int Index, int Len) const;Calculate the maximum value from calling object elements [Index]..[Index+Len-1]. The result AMean is a real value.
4void Max(double &AMax, int &AIndex) const;Calculate the maximum value of all calling object elements.
5void Max(double &AMax, int &AIndex, int Index, int Len) const;Calculate the maximum value of calling object elements [Index]..[Index+Len-1].

Overload 1: double Max() const;

Maximum value.

Remarks:

Returns the maximum value of all calling object elements. The result is a real value. An exception is raised is calling object Matrix::Complex is true.

Examples
#include "MtxExpr.h"
#include "Units.Math387.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;

void Example()
{
    Matrix a;
    a.SetIt(2, 2, false, DewArray<double>{ 1.0, 2.0, 3.0, 4.0 });
    double result = a.Max();
    if (Abs(result - 4.0) > 1e-10)
        throw tException(DewString("Matrix.Max: expected 4.0, got ") + SampleToStr(result));
}
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Matrix a;
    double b;

    a.SetIt(2, 2, false, DewArray<double>{1, 2, 3, 4});
    b = a.Max(); // b = 4
}
See Also: Matrix::Min, Matrix::Maxc, Matrix::MaxMin
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler

Overload 2: double Max(int Index, int Len) const;

Returns the maximum value from calling object elements [Index]..[Index+Len-1]. The result is a real value.

#NameTypeDescription
1Indexint
2Lenint
Remarks:

An exception is raised if calling object Matrix::Complex property is true or array borders are overrun.

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Matrix a;
    double b;

    a = {{1, 2}, {3, 4}};
    b = a.Max(); // b = 4
}
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler

Overload 3: void Max(double &AMax, int Index, int Len) const;

Calculate the maximum value from calling object elements [Index]..[Index+Len-1]. The result AMean is a real value.

#NameTypeDescription
1AMaxdouble &
2Indexint
3Lenint
Remarks:

An exception is raised if calling object Matrix::Complex property is true or array borders are overrun.

Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler

Overload 4: void Max(double &AMax, int &AIndex) const;

Calculate the maximum value of all calling object elements.

#NameTypeDescription
1AMaxdouble &
2AIndexint &
Remarks:

The AMax parameter returns the maximum value. The AIndex parameter returns the Index of maximum value. An exception is raised if calling object Matrix::Complex property is true.

Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler

Overload 5: void Max(double &AMax, int &AIndex, int Index, int Len) const;

Calculate the maximum value of calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1AMaxdouble &
2AIndexint &
3Indexint
4Lenint
Remarks:

The AMax parameter returns the maximum value. The AIndex parameter returns the index of maximum value. An exception is raised if calling object Matrix::Complex property is true or array borders are overrud/underrun.

Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler