2.1.18.23 xyz_examine_data


Description

Check the xyz scatters and return the proposed method for converting the XYZ to matrix

Syntax

int xyz_examine_data( UINT nSize, double * x, double * y, double * z, double dPrecision = 1.0e-8, UINT * pVar = NULL, double * pXmin = NULL, double * pXStep = NULL, double * pXmax = NULL, double * pYmin = NULL, double * pYStep = NULL, double * pYmax = NULL, bool bRemoveDuplicate = false, int nMethod = Remove_With_Mean )

Parameters

nSize
[input] the number of points
x
[input] the X-coordinates of the points
y
[input] the Y-coordinates of the points
z
[input] the Z-coordinates of the points
dPrecision
[input] the precision to determine whether two points are duplicated
pVar
[output] the number of points after removing the duplicates
pXmin
[output] the interval in x-coordinates when scatters are not randomly distributed
pXStep
[output] the interval in x-coordinates when scatters are not randomly distributed
pXmax
[output] the maximum in x-coordinates when scatters are not randomly distributed
pYmin
[output] the minimum in y-coordinates when scatters are not randomly distributed
pYStep
[output] the interval in y-coordinates when scatters are not randomly distributed
pYmax
[output] the maximum in y-coordinates when scatters are not randomly distributed
bRemoveDuplicate
[input] if true, the function will remove the duplicates, or else the array x, y, z will not change
nMethod
[input] the method used in removing the duplicates

Return

examine result, 0 for regular conversion, 1 for sparse conversion, 2 for random conversion, other value for error.

Examples

EX1

#include <wks2mat.h>
void xyz_examine_data_ex1()
{
    int n = 10;
    double a[]={1,1,1,2,2,2,3,3,3,2};
    double b[]={1,2,3,1,2,3,1,2,3,2};
    double c[]={5,3,7,3,6,5,0,4,3,7};
 
    int nRet = xyz_examine_data(n, a, b, c, 1.0e-4);
    switch(nRet)
    {
    case Examine_XYZ_Regular:
        out_str("Regular");
        break;
    case Examine_XYZ_Sparse:
        out_str("Sparse");
        break;
    case Examine_XYZ_Random:
        out_str("Random");
        break;
    }
}

Remark

See Also

ocmath_xyz_examine_data

Header to Included

wks2mat.h

Reference