TMtx::Find Method

Overload List

#SignatureDescription
1int Find(const double x);Finds a match for X in object values.
2int Find(const TCplx &x);Compare complex value X with all calling object elements.

Overload 1: int Find(const double x);

Finds a match for X in object values.

#NameTypeDescription
1xconst double

Returns: the index of first matched element. If no matching elements are found, the result is -1.

Remarks:

Compare real value X with all calling object elements.

Note
This method also supports the NAN and INF search.

Examples
#include "Units.MtxVec.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;

void Example()
{
    TVec* a;
    CreateIt(a);
    a->SetIt(false, DewArray<double>{2,5,1,6});
    int indes = a->Find(1.0);  // returns 2 (the arrays are zero based)
    FreeIt(a);
}
Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

Overload 2: int Find(const TCplx &x);

Compare complex value X with all calling object elements.

#NameTypeDescription
1xconst TCplx &

Returns: the index of first matched element. If no matching elements are found, the result is -1.

Remarks:

An exception is raised if calling object TMtx::Complex property is false.

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler