TVecInt::Ramp Method

Overload List

#SignatureDescription
1TMtxVecInt *Ramp(double Offset, double Step, int Index, int Len);Fills the calling vector elements [Index]..[Index+Len-1].
2TVecInt *Ramp();Fills the calling vector with a series following linear rule.
3TVecInt *Ramp(double Offset, double Step);Fills the calling vector.

Overload 1: TMtxVecInt *Ramp(double Offset, double Step, int Index, int Len);

Fills the calling vector elements [Index]..[Index+Len-1].

#NameTypeDescription
1Offsetdouble
2Stepdouble
3Indexint
4Lenint
Remarks:

Method uses the following rule:

Values[k] := Offset + k*Step.

An exception is raised if calling vector array borders are overrun.

Declared in Dew::Math::TMtxVecInt · Dew.Math/AbstractMtxVecInt.h · Cross-compiler

Overload 2: TVecInt *Ramp();

Fills the calling vector with a series following linear rule.

Remarks:

Fills the calling vector with a series following the rule:

Values[k] :=  k

(Offset is zero and Step is one).

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

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

void Example()
{
    TVecInt* a;

    CreateIt(a);
    a->Size(5, TIntPrecision::prInt32);
    a->Ramp(0, 2); // [0, 2, 4, 6, 8]
    FreeIt(a);
}
#include "MtxVecInt.h"
#include "Units.MtxVecInt.h"

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

void Example()
{
    TVecInt* a;
    int i;

    CreateIt(a);
    a->Size(5, TIntPrecision::prInt32);
    for (i = 0; i < a->Length; i++) (*a)[i] = i*2;
    FreeIt(a);
}
See Also: TVecInt::SetVal
Declared in Dew::Math::TVecInt · Dew.Math/MtxVecInt.h · Cross-compiler

Overload 3: TVecInt *Ramp(double Offset, double Step);

Fills the calling vector.

#NameTypeDescription
1Offsetdouble
2Stepdouble
Remarks:

Method uses the following rule:

Values[k] := Offset + k*Step.
Declared in Dew::Math::TVecInt · Dew.Math/MtxVecInt.h · Cross-compiler