VectorInt::Min Method

Overload List

#SignatureDescription
1int Min() const;Minimum value.
2int Min(const int Index, const int Len) const;Calculate the minimum value from calling object elements [Index]..[Index+Len-1].
3int Min(int &aIndex) const;Calculate the minimum value of all calling object elements.
4int Min(int &aIndex, const int Index, const int Len) const;Calculate the maximum value of calling object elements [Index..Index+Len-1].

Overload 1: int Min() const;

Minimum value.

Returns: The minimum value of all calling object elements. The result is an integer value.

Examples
#include "Units.MtxVecInt.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVecInt;

void Example()
{
    TVecInt* a;
    CreateIt(a);
    a->SetIt(DewArray<int>{1,2,3,4});
    int b = a->Min();  // 1
    FreeIt(a);
}
See Also: VectorInt::Max
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 2: int Min(const int Index, const int Len) const;

Calculate the minimum value from calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1Indexconst int
2Lenconst 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()
{
    VectorInt a;
    int min, ind;

    a = {1, 2, 3, 4};
    min = a.Min(ind); //min=1, ind = 0
}
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 3: int Min(int &aIndex) const;

Calculate the minimum value of all calling object elements.

#NameTypeDescription
1aIndexint &Stores minimum value index.

Returns: the minimum of all calling vector integer elements in-place.

Examples
#include "Units.MtxVecInt.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVecInt;

void Example()
{
    TVecInt* a;
    int ind;
    CreateIt(a);
    a->SetIt(DewArray<int>{1,2,3,4});
    int min = a->Min(ind); //min=1, ind = 0
    FreeIt(a);
}
See Also: VectorInt::Max
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 4: int Min(int &aIndex, const int Index, const int Len) const;

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

#NameTypeDescription
1aIndexint &Returns minimum value index.
2Indexconst intThe starting index at which to start the search.
3Lenconst intThe number of elements to search starting from Index.

Returns: the minimum of calling vector integer elements [Index..Index+Len-1].

Remarks:

An exception is raised if array borders are overrun/underrun.

Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler