File tree Expand file tree Collapse file tree 3 files changed +36
-30
lines changed
Expand file tree Collapse file tree 3 files changed +36
-30
lines changed Original file line number Diff line number Diff line change 88 \itemize {
99 \item Two missing \code {is <> ()} templates for
1010 \code {CharacterVector } and \code {CharacterMatrix } have been added ,
11- and tests for \code {is.na()} have been corrected thanks to Thomas Tse.
11+ and some tests for \code {is_na()} and \code {is_finite()} have been
12+ corrected thanks to Thomas Tse.
1213 }
1314 }
1415}
Original file line number Diff line number Diff line change 1- // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
1+ // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
22//
33// is_finite.h: Rcpp R/C++ interface class library -- is finite
44//
2323#define Rcpp__traits_is_finite_h
2424
2525namespace Rcpp {
26- namespace traits {
27-
28- // default for complex,
29- template <int RTYPE>
30- bool is_finite ( typename storage_type<RTYPE>::type) ;
31-
32- template <>
33- inline bool is_finite<INTSXP>( int x ){
34- return x != NA_INTEGER ;
35- }
36-
37- template <>
38- inline bool is_finite<REALSXP>( double x ){
39- return R_finite (x) ;
40- }
41-
42- template <>
43- inline bool is_finite<CPLXSXP>( Rcomplex x ){
44- return !( !R_finite (x.r ) || !R_finite (x.i ) );
45- }
46-
47- template <>
48- inline bool is_finite<STRSXP>( SEXP x ){ return x != NA_STRING ; }
49-
50- template <>
51- inline bool is_finite<LGLSXP>( int x ){ return x != NA_LOGICAL ; }
52-
26+
27+ namespace traits {
28+
29+ // default for complex,
30+ template <int RTYPE>
31+ bool is_finite ( typename storage_type<RTYPE>::type);
32+
33+ template <>
34+ inline bool is_finite<INTSXP>(int x){
35+ return x != NA_INTEGER;
36+ }
37+
38+ template <>
39+ inline bool is_finite<REALSXP>(double x) {
40+ return R_finite (x);
41+ }
42+
43+ template <>
44+ inline bool is_finite<CPLXSXP>(Rcomplex x) {
45+ return !( !R_finite (x.r ) || !R_finite (x.i ) );
46+ }
47+
48+ template <>
49+ inline bool is_finite<STRSXP>(SEXP x) {
50+ return false ; // see rcpp-devel on 2013-10-02; was: x != NA_STRING;
51+ }
52+
53+ template <>
54+ inline bool is_finite<LGLSXP>(int x) {
55+ return x != NA_LOGICAL;
56+ }
57+
5358}
5459}
5560
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ namespace Rcpp{
4949
5050 template <>
5151 inline bool is_na<STRSXP>(SEXP x) {
52- return false ; // see rcpp-devel on 2013-10-02; was: x == NA_STRING;
52+ return x == NA_STRING;
5353 }
5454
5555 template <>
You can’t perform that action at this time.
0 commit comments