Displaying 1 result from an estimated 1 matches for "both_finit".
Did you mean:
both_finite
2010 Jan 22
2
Optimizing C code
Hi the list,
I need to write some efficient distances function, so I read the code
for the Euclidean distance.
I do not understand the purpose of the line 11 : if x[i] and y[i] are
not NA (line 9), can dev be NA ?
Christophe
#define both_FINITE(a,b) (R_FINITE(a) && R_FINITE(b))
#define both_non_NA(a,b) (!ISNAN(a) && !ISNAN(b))
1. static double R_euclidean2(double *x, double *y, int taille)
2. {
3. double dev, dist;
4. int count, i;
5.
6. count= 0;
7. dist = 0;
8. for(i = 0 ; i < taille ; i++) {
9. if...