FunctionSort the index-array of a vector
Syntax C/C++#include <VFstd.h>
void VF_sortind( uiVector Ind, fVector X, ui size, int dir );
C++ VecObj#include <OptiVec.h>
void vector<ui>::sortind( const vector<T>& X, int dir=1 );
Pascal/Delphiuses VFstd;
procedure VF_sortind( Ind:uiVector; X:fVector; size:UIntSize; dir:Integer );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_sortind( uiVector d_Ind, fVector d_X, ui size, int dir );
void VFcu_sortind( uiVector h_IndY, fVector h_X, ui size, int dir );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_sortind( d_Ind:uiVector; d_X:fVector; size:UIntSize; dir:Integer ): IntBool;
procedure VFcu_sortind( h_Ind:uiVector; h_X:fVector; size:UIntSize; dir:Integer );
DescriptionThe routine is similar to VF_sort, but this time it is the index-array of X rather than the vector X itself that is ordered. Ascending order is obtained by setting dir to any positive number. Here, ascending order means that Ind0 will contain the index of the smallest element of X, Ind1 the index of the second-smallest, and so on, up to Indsize−1, the index of the largest element in X. Descending order is obtained by setting dir negative. In the case of two or more identical vector elements, the lower index comes first (regardless of the sortind direction).
This routine is used if other vectors are correlated with X and the correlation of the individual elements has to be maintained. After sorting the index-array, use VF_indpick (VD_indpick,   VI_indpick, etc.) to actually perform the sorting of X and the other vectors correlated with X.
Error handlingnone
Return valuenone
See alsoVF_sort,   VF_indpick

VectorLib Table of Contents  OptiVec home