sort two double arrays with X sorted and Y to reorder accordingly
void ocmath_sort_xy( double * pX, double * pY, UINT nSize, BOOL bAscending = true )
EX1
//Before running, make sure the active worksheet with at least 2 columns exists in current project. void sortab() { Worksheet wks = Project.ActiveLayer(); Dataset aa(wks, 0); Dataset bb(wks, 1); vector vx, vy; vx = aa; vy = bb; ocmath_sort_xy(vx, vy, vx.GetSize()); aa = vx; bb = vy; }
origin.h