search for: requal3

Displaying 1 result from an estimated 1 matches for "requal3".

Did you mean: equal3
2011 Dec 02
1
1.6x speedup for requal() function (in R/src/main/unique.c)
...; 0 || j < 0) return 0; xi = REAL(x)[i]; yj = REAL(y)[j]; if (!ISNAN(xi) && !ISNAN(yj)) return xi == yj; if (R_IsNA(xi) && R_IsNA(yj)) return 1; if (R_IsNaN(xi) && R_IsNaN(yj)) return 1; return 0; } /* Another extra 1.18x speedup. So overall requal3() is about 1.6x faster than requal() for me. requal3() uses a simpler logic than requal() but this logic should be equivalent to the logic used by requal(), based on the following facts: (a) If *one* of xi or yi is a number (i.e. not NA or NaN), then xi and yi can be com...