From fcfdc2dc0d7e82a7815d07f89779cc6653a0fcce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Thu, 11 Jan 2018 13:29:49 +0100 Subject: [PATCH 1/3] simplify is_na() --- inst/include/Rcpp/traits/is_na.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/include/Rcpp/traits/is_na.h b/inst/include/Rcpp/traits/is_na.h index bc96d4b2e..feb5db0b2 100644 --- a/inst/include/Rcpp/traits/is_na.h +++ b/inst/include/Rcpp/traits/is_na.h @@ -39,7 +39,7 @@ namespace Rcpp{ template <> inline bool is_na(double x) { - return internal::Rcpp_IsNA(x) || internal::Rcpp_IsNaN(x); + return R_isnancpp(x); } template <> From 38d024f7cd3cc28b399cc88d8b2b111fdc2e7e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Thu, 11 Jan 2018 13:38:23 +0100 Subject: [PATCH 2/3] NEWS --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index fc35f8eb7..740cb4f70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-01-11 Kirill Müller + + * inst/include/Rcpp/traits/is_na.h: Speed up Rcpp::is_na() + (pull request #799) + 2018-01-09 Iñaki Ucar * inst/include/Rcpp/vector/proxy.h: Improve support for NVCC, the CUDA From bd491da8c1bbf831af0bdbbdbaef5c7ec14b3f08 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Sun, 14 Jan 2018 13:15:42 -0600 Subject: [PATCH 3/3] also speed up complex case (extending #799) --- ChangeLog | 7 +++++-- DESCRIPTION | 4 ++-- inst/include/Rcpp/traits/is_na.h | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 740cb4f70..411240547 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,15 @@ +2018-01-14 Dirk Eddelbuettel + + * inst/include/Rcpp/traits/is_na.h (Rcpp): Also speed up + Rcpp::is_na + 2018-01-11 Kirill Müller * inst/include/Rcpp/traits/is_na.h: Speed up Rcpp::is_na() - (pull request #799) 2018-01-09 Iñaki Ucar * inst/include/Rcpp/vector/proxy.h: Improve support for NVCC, the CUDA - compiler (pull request #798, fixed issue #797) 2018-01-06 Kendon Bell diff --git a/DESCRIPTION b/DESCRIPTION index d225cc9cf..6c4d96c32 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Rcpp Title: Seamless R and C++ Integration -Version: 0.12.14.5 -Date: 2017-12-21 +Version: 0.12.14.6 +Date: 2018-01-14 Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou, Nathan Russell, Douglas Bates and John Chambers Maintainer: Dirk Eddelbuettel diff --git a/inst/include/Rcpp/traits/is_na.h b/inst/include/Rcpp/traits/is_na.h index feb5db0b2..b2002209b 100644 --- a/inst/include/Rcpp/traits/is_na.h +++ b/inst/include/Rcpp/traits/is_na.h @@ -2,7 +2,8 @@ // // is_na.h: Rcpp R/C++ interface class library -- vector operators // -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2018 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2018 Dirk Eddelbuettel and Kirill Mueller // // This file is part of Rcpp. // @@ -44,8 +45,7 @@ namespace Rcpp{ template <> inline bool is_na(Rcomplex x) { - return internal::Rcpp_IsNA(x.r) || internal::Rcpp_IsNA(x.i) || - internal::Rcpp_IsNaN(x.r) || internal::Rcpp_IsNaN(x.i); + return R_isnancpp(x.r) || R_isnancpp(x.i); } template <>