2.1.17.8.16 ocmath_sort_xy


Description

sort two double arrays with X sorted and Y to reorder accordingly

Syntax

void ocmath_sort_xy( double * pX, double * pY, UINT nSize, BOOL bAscending = true )

Parameters

pX
[modify] X vector
pY
[modify] Y vector
nSize
[input] XY vector size
bAscending
[input] sort order for X

Return

Examples

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;
}

Remark

See Also

Header to Included

origin.h

Reference