| ocmath_d_copy  DescriptionCopy a vector of type double with given array of indices. Syntax
void ocmath_d_copy( uint nPts, const uint * pIndices, double * pDestX, const double * pSrcX, int nSrcSize )
 Parameters
    nPts[input] size of pIndices arrays, must be smaller then the size of pSrcX.pIndices[input] array of indices to copy from pSrcX to pDestX, the largestelement of this array must be smaller then the size of pDestX.pDestX[output] destination vector, must be SetSize to nPts.pSrcX[input] source vector, must be SetSize to at least the largest element in pIndices.nSrcSize[input] the size of source vector. ReturnThere 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. ExamplesEX1 
#include <Origin.h>
#include <ocmath.h>
void ocmath_d_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
}
RemarkCopy 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 See Alsoocmath_f_copy, ocmath_ui_copy, ocmath_us_copy, ocmath_b_copy header to Includeorigin.h Reference |