This function remove duplicated values of an array.
int ocmath_array_remove_duplicates(UINT n, double* x, double dPrecision = 1.0e-8);
the number of unique points in an array.
EX1
#include <wks2mat.h> void ocmath_array_remove_duplicates_ex1() { int n = 10; double a[]={2.1,2,4,6,2,4,8,5,0,3}; int nr = ocmath_array_remove_duplicates(n, a, 0.1); printf("%d\n", nr); for(int i =0 ; i<nr; i++) { printf("%f\n", a[i]); } }
wks2mat.h