Copy a vector of type BYTE with given array of indices.
void ocmath_b_copy( uint nPts, const uint * pIndices, BYTE * pDestX, const BYTE * pSrcX, int nSrcSize )
There is nothing to return, It is assumed that caller will prepare all the pointers and arrays such that they are all in the valid range, as this function does not check for errors.
EX1
void ocmath_b_copy_ex1() { vector vd = {1,1.1, 2 ,2.1, 3,3.1,4,4.1,5,5.1}; vector<uint> vnIndices = {0,2,4,6,8}; vector vDestX; bool bRet = vDestX.SetSize(vnIndices.GetSize()); if(!bRet) return ; ocmath_d_copy(vnIndices.GetSize(), vnIndices,vDestX, vd, vd.GetSize() ); //vDestX should have data of : 1, 2, 3, 4, 5 }
Copy source vector's elements indexed by pIndice to destination array.
Data types supported:
double: ocmath_d_copy
float: ocmath_f_copy
unsigned short: ocmath_us_copy
unsigned int: ocmath_ui_copy
unsigned char: ocmath_b_copy
ocmath_f_copy, ocmath_ui_copy, ocmath_us_copy
origin.h