|Function||Extract a sub-vector from the input vector|
|Syntax C/C++||#include <VFstd.h>
void VF_subvector( fVector Y, ui subsize, fVector X, int samp );
|C++ VecObj||#include <OptiVec.h>
void vector<T>::subvector( const vector<T>& X, int samp, ui start=0 );
procedure VF_subvector( Y:fVector; sizey:UIntSize; X:fVector; samp:Integer );
|Description||Yi = Xi*samp
A sub-vector Y is extracted from X with a sampling interval samp. This means that every samp'th element is taken, up to a total of subsize elements, starting with the zero'th element of X. Since X may be an expression like XX+1000 (C/C++) or VF_Pelement( XX, 1000 ) (Pascal/Delphi), samp does not always need to be positive, but may also take on negative values (or the trivial value of 0). X and Y have to be distinct. Instead of using a samp of 0, 1, or -1, one should use VF_equC, VF_equV, or VF_rev, respectively.
The VecObj version is called with an additional argument start, denoting the element of X to start with. This is necessary to avoid input expressions like XX+1000, which are possible only with pointers, but would be mis-interpreted as the operator + in the class-based object-oriented interface.
VectorLib Table of Contents OptiVec home