TVec::ThreshBottom Method

Overload List

#SignatureDescription
1TMtxVec *ThreshBottom(const double Value);Threshold bottom operation.
2TMtxVec *ThreshBottom(const double Value, int Index, int Len);Perform the threshold operation on calling object values [Index]..[Index+Len-1].
3TMtxVec *ThreshBottom(TMtxVec *Src, const double Value);Perform threshold operation on all Src object values.
4TMtxVec *ThreshBottom(TMtxVec *Vec, const double Value, int VecIndex, int Index, int Len);Perform a threshold operation on Vec elements [VecIndex]..[VecIndex+Len-1].

Overload 1: TMtxVec *ThreshBottom(const double Value);

Threshold bottom operation.

#NameTypeDescription
1Valueconst double
Remarks:

Perform threshold operation on all calling object values. The Value parameter is a lower bound for threshold operation. All values smaller than Value will be replaced with Value.

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, 0.1, 3, 4});
    a->ThreshBottom(0.2); // a = [2,0.2,3,4]
    FreeIt(a);
}
#include "Math387.h"
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Vector a;
    a.SetIt(DewArray<double>{ 1.0, 5.0, 3.0, 7.0, 2.0 });
    a.ThreshBottom(4.0);
    Vector expected;
    expected.SetIt(DewArray<double>{ 4.0, 5.0, 4.0, 7.0, 4.0 });
    if (!a.IsEqual(expected, 1e-10, TCompare::cmpAbsolute))
        throw tException("Vector.ThreshBottom: mismatch");
}
See Also: TVec::ThreshTop
Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

Overload 2: TMtxVec *ThreshBottom(const double Value, int Index, int Len);

Perform the threshold operation on calling object values [Index]..[Index+Len-1].

#NameTypeDescription
1Valueconst double
2Indexint
3Lenint
Remarks:

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

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

Overload 3: TMtxVec *ThreshBottom(TMtxVec *Src, const double Value);

Perform threshold operation on all Src object values.

#NameTypeDescription
1SrcTMtxVec *
2Valueconst double
Remarks:

Store the results in calling object. Size and TVec::Complex properties of the calling object are adjusted automatically.

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

Overload 4: TMtxVec *ThreshBottom(TMtxVec *Vec, const double Value, int VecIndex, int Index, int Len);

Perform a threshold operation on Vec elements [VecIndex]..[VecIndex+Len-1].

#NameTypeDescription
1VecTMtxVec *
2Valueconst double
3VecIndexint
4Indexint
5Lenint
Remarks:

Store the results in the calling object elements [Index]..[Index+Len-1]. Size and TVec::Complex properties of the calling object must be set explicitly. An exception is raised if TVec::ConditionCheck is true and array borders are overrun/underrun.

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