2.2.3.19.29 vectorbase::Pattern


Description

Fill vector with generated data sequence

Syntax

BOOL Pattern( double dStartVal, double dEndVal, double dIncVal = 1.0, int nValueRepeat = 1, int nSequenceRepeat = 1, int nFillFrom = -1, int nFillCount = -1 )

Parameters

dStartVal
[input]the starting value of the generated data sequence
dEndVal
[input]the ending value of the generated data sequence
dIncVal
[input]the increment within the generated data sequence
nValueRepeat
[input]how many times each value repeats itself in the generated data sequence
nSequenceRepeat
[input]how many times each whole data sequence repeats itself in the generated dataset
nFillFrom
[input]index of vector from which the data sequence should begin (0-based offset)
nFillCount
[input]the number of elements to be filled

Return

TRUE on success, otherwise FALSE

Examples

void Pattern_ex()
{
	double dStartVal 	= 0;
	double dEndVal		= 2;
	double dIncVal 		= 0.4;
	int nValueRepeat 	= 3;
	int nSequenceRepeat = 2; 
	int nFillFrom 		= -1; 
	int nFillCount 		= -1;
	
	vector vRet;
	if(	vRet.Pattern(dStartVal, dEndVal, dIncVal, nValueRepeat, nSequenceRepeat, nFillFrom, nFillCount) )
	{
		int nSize = vRet.GetSize();
		for(int ii = 0; ii < nSize; ii++)
			out_double("", vRet[ii]);
	}
}

Remark

See Also

Header to Included

origin.h