[Rcpp-devel] is_na, is_infinite etc
This is not implemented as members of Vector. See: https://github.com/RcppCore/Rcpp/blob/b5ff9b5530e4a82682caab5ddc87ac23a7b8857e/inst/include/Rcpp/traits/is_infinite.h So, you can use: traits::is_infinite<REALSXP>(x) Romain Le 23 janv. 2014 ? 00:07, S?ren H?jsgaard <sorenh at math.aau.dk> a ?crit :
Dear all,
I am struggeling with checking for NA and Inf in a loop over a numeric vector. I have created these two helpers:
//[[Rcpp::export]]
bool isna( double x){
return NumericVector::is_na(x) ;
}
//[[Rcpp::export]]
bool isinf( double x){
return NumericVector::is_infinite(x) ;
}
isna works but compiling isinf gives:
error: 'is_infinite' is not a member of 'Rcpp::NumericVector {aka Rcpp::Vector<14>}'
From what I can read on the web, is_infinte IS implemented, so I can't spot what is wrong. Any insight?
Cheers
S?ren
_______________________________________________ Rcpp-devel mailing list Rcpp-devel at lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel