【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.1.18.3 ocmath_array_remove_duplicates
Contents
Description
This function remove duplicated values of an array.
Syntax
int ocmath_array_remove_duplicates(UINT n, double* x, double dPrecision = 1.0e-8);
Parameters
- n
- [input] the number of scatters.
- x
- [modify] the x-coordinates of the scatters, when output, the unique points are stored in the lower bound of x
- dPrecision
- [input] the precision to determine whether the points are duplicated.
Return
the number of unique points in an array.
Examples
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]); } }
Remark
See Also
Header to Include
wks2mat.h