Displaying 20 results from an estimated 254 matches for "isnan".
2005 Jan 04
2
ISNAN() broken? in ver 2.x on MacOS X
I have a problem building an extension using ISNAN() on R version 2.0.x.
In R 1.9.1 Arith.h and Rmath.h contained code like
#ifdef IEEE_754
# define ISNAN(x) (isnan(x)!=0)
#else
# define ISNAN(x) R_IsNaNorNA(x)
#endif
#define R_FINITE(x) R_finite(x)
int R_IsNaNorNA(double);
int R_finite(double);
which works.
R 2.0.x has
# define ISNAN(x...
2005 Jan 04
2
ISNAN() broken? in ver 2.x on MacOS X
I have a problem building an extension using ISNAN() on R version 2.0.x.
In R 1.9.1 Arith.h and Rmath.h contained code like
#ifdef IEEE_754
# define ISNAN(x) (isnan(x)!=0)
#else
# define ISNAN(x) R_IsNaNorNA(x)
#endif
#define R_FINITE(x) R_finite(x)
int R_IsNaNorNA(double);
int R_finite(double);
which works.
R 2.0.x has
# define ISNAN(x...
2004 Jul 18
1
[LLVMdev] IsNAN.cpp:23:3: #error "Don't know how to get isnan()"
...macro for Interix is __INTERIX if this is to any help.
/Henrik
>From: "Brian R. Gaeke" <gaeke at uiuc.edu>
>Reply-To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu>
>To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu>
>Subject: Re: [LLVMdev] IsNAN.cpp:23:3: #error "Don't know how to get
>isnan()"
>Date: Sat, 17 Jul 2004 03:55:00 -0500
>
>Please send your 'config.log' file to me.
>
> > >From: Chris Lattner <sabre at nondot.org>
> > >Date: Thu, 15 Jul 2004 17:43:27 -0500 (CDT)
>...
2004 Jul 19
0
[LLVMdev] IsNAN.cpp:23:3: #error "Don't know how to get isnan()"
Hi Brian,
I've been playing around with your test programs and came to the result:
---------------------
#ifdef __INTERIX
# define _GLIBCPP_USE_C99 1 //Define this macro before including isnan()
function from cmath
#endif
#include <cmath>
using std::isnan;
int foo(float f) {return isnan(f);}
---------------------
/Henrik
>From: "Brian R. Gaeke" <gaeke at uiuc.edu>
>Reply-To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu>
>To: LLVM Develop...
2004 Jul 16
2
[LLVMdev] IsNAN.cpp:23:3: #error "Don't know how to get isnan()"
...u're interested in LLVM on the
>windows platform, *please* get CVS.
Last night I've got the latest version of LLVM from CVS and now porting LLVM
to Interix from this version on.
I got this error:
---------------------
gmake[1]: Entering directory `/usr/local/src/llvm/lib/Support'
IsNAN.cpp:23:3: #error "Don't know how to get isnan()"
---------------------
I can see that the .\configure script didn't find any version of isnan().
However, I've manually found isnan() in /opt/gcc.3.3/include/c++/3.3/cmath.
Is this another configuration error from Interix or w...
2005 Jan 05
1
Standalone Mathlib, C++ and ISNAN()
...of some meaningful response and ignoring the risk of
further abuse, let me try to clarify the issue here.
I have re-read the 'Writing R Extensions' manual. It seems to me that
it clearly says R API functions can be called from from C++ programs,
and the API includes the special values ISNAN() and R_FINITE() and the
missing test ISNA().
R_FINITE is no problem. It is defined as R_finite, which is declared
in Rmath.h and included in libRmath.
ISNAN() however is broken.
In R 1.9 it was defined as R_IsNaNorNA unless IEEE_754 was defined
which was not done in the standalone libRmath/R...
2018 Nov 09
3
Proposed new min and max intrinsics
...not if the first is.
>
> So we need to explicitly catch the case where a is NaN as well. For
> minimum, that works out to something like:
>
> %3 = fcmp olt float %a, %b
> %4 = select i1 %3, float %a, float %b ; (a < b) ? a : b
> %5 = fcmp ord float %a, %a ; true if !isNaN(a)
> %6 = select i1 %5, float %4, float %a ; if a was NaN, return a
>
> for the entire operation. The logic here is that if isNaN(a) ||
> isNaN(b), the initial comparison will evaluate to false and %4 ends up
> being b. If isNaN(b), this is a NaN value (as required). The case we a...
2004 May 24
1
Cannot call R's ISNAN() from a C code in >1.7 versions.
Dear R users,
Have you experienced any difficulty in calling R's ISNAN() from a C
code? I have C codes including ISNAN() calls and they worked well until
I upgraded my R from 1.7 to later versions. When I tried to compile the
codes in the version 1.8 and 1.9, I got error messages like this:
test.obj : error LNK2001: unresolved external symbol _isnan
.\testR.dll...
2004 Oct 19
0
[LLVMdev] Visual C Patches for IsNAN.cpp and IsInf.cpp
I submitted a patch keeping the traditional approach,
HAVE_FINITE_IN_FLOAT_H and HAVE_ISNAN_IN_FLOAT...
Just another case added to the others instead of a custom approach.
---
Paolo
On Oct 19, 2004, at 12:16 PM, Morten Ofstad wrote:
> I don't know if Paolo submitted his patches for these files, but they
> are not in the CVS -- I've chosen a slightly different strategy,...
1999 Apr 09
9
a strange logical bug (PR#162)
In R0.64.0, try
as.numeric(is.na(c(NA,NA,1)))
as.numeric(c(T,T,F))
Jim
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
2004 Oct 19
2
[LLVMdev] Visual C Patches for IsNAN.cpp and IsInf.cpp
I don't know if Paolo submitted his patches for these files, but they
are not in the CVS -- I've chosen a slightly different strategy, adding
a case that checks if the compiler is MSVC instead of adding
HAVE_FINITE_IN_FLOAT_H and HAVE_ISNAN_IN_FLOAT_H to the config.h file.
I don't know which is the best approach, but this is the minimal patch
to make it work...
m.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff.txt
URL: <http://lists.llvm.org/pipermail/llvm-dev/att...
2010 Jan 22
2
Optimizing C code
...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(both_non_NA(x[i], y[i])) {
10. dev = (x[i] - y[i]);
11. if(!I...
2007 May 31
0
Branch 'as' - 8 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_string.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c test/trace
...| 20 +
libswfdec/swfdec_as_interpret.c | 9
libswfdec/swfdec_as_string.c | 15 -
libswfdec/swfdec_as_strings.c | 2
libswfdec/swfdec_as_types.c | 2
test/trace/Makefile.am | 28 +
test/trace/isnan-5.swf |binary
test/trace/isnan-5.swf.trace | 7
test/trace/isnan-6.swf |binary
test/trace/isnan-6.swf.trace | 7
test/trace/isnan-7.swf |binary
test/trace/isnan-7.swf.trace | 7...
2014 Sep 22
2
Replace isnan and lgamma in Fortran subroutine in R package
Hello,
I submitted a package which used Fortran functions isnan and lgamma. However, I was told that:
isnan and lgamma are not Fortran 95 functions.
I was asked to write 'cross-platform portable code' and so should not be writing GNU extensions to Fortran.
See http://cran.r-project.org/web/checks/check_results_mpath.html, which will shortly show inst...
2018 Nov 08
2
Proposed new min and max intrinsics
Alex,
After looking into this a bit, it looks to me like the best thing to do for
targets that do not natively support ISD::MINIMUM and ISD::MAXIMUM would be
to fall back to a libcall, since implementing these operations in terms of
existing operations is actually rather complicated. Do you think it would
make sense to add builtin functions to compiler-rt to implement these
operations, or is
2003 Dec 30
1
Accuracy: Correct sums in rowSums(), colSums() (PR#6196)
...gs); args = CDR(args);
***************
*** 1046,1062 ****
switch (type) {
case REALSXP:
rx = REAL(x) + n*j;
#ifdef IEEE_754
if (keepNA)
! for (sum = 0., i = 0; i < n; i++) sum += *rx++;
else {
! for (cnt = 0, sum = 0., i = 0; i < n; i++, rx++)
! if (!ISNAN(*rx)) {cnt++; sum += *rx;}
else if (keepNA) {sum = NA_REAL; break;}
}
#else
! for (cnt = 0, sum = 0., i = 0; i < n; i++, rx++)
! if (!ISNAN(*rx)) {cnt++; sum += *rx;}
else if (keepNA) {sum = NA_REAL; break;}
#endif
break;
--- 1046,1082 ----
switch (type) {...
2011 Dec 02
1
1.6x speedup for requal() function (in R/src/main/unique.c)
Hi,
FWIW:
/* Taken from R/src/main/unique.c */
static int requal(SEXP x, int i, SEXP y, int j)
{
if (i < 0 || j < 0) return 0;
if (!ISNAN(REAL(x)[i]) && !ISNAN(REAL(y)[j]))
return (REAL(x)[i] == REAL(y)[j]);
else if (R_IsNA(REAL(x)[i]) && R_IsNA(REAL(y)[j])) return 1;
else if (R_IsNaN(REAL(x)[i]) && R_IsNaN(REAL(y)[j])) return 1;
else return 0;
}
/* Between 1.34x and 1.37x faster on my...
2008 Nov 11
4
[LLVMdev] Invalid comparison instruction generation
Eli,
Using the variables from the original IR,
assuming tmp == tmp1 and assume the value is not nan
ogt(tmp, tmp1) is !isnan(tmp) && !isnan(tmp1) && tmp > tmp1, or false
ule(tmp, tmp1) is isnan(tmp) || isnan(tmp1) || tmp <= tmp1, or true
So, this is invalid, or am I misunderstanding what ogt and ule stand
for?
Assuming this is valid, why convert comparison instructions instead of
just passing them...
2019 Sep 29
2
speed up R_IsNA, R_IsNaN for vector input
Dear R developers,
I spotted that R_isNA and R_IsNaN could be improved when applied on a
vector where we could take out small part of their logic, run it once,
and then reuse inside the loop.
I setup tiny plain-C experiment. Taking R_IsNA, R_IsNaN from R's
arithmetic.c, and building R_vIsNA and R_vIsNaN accordingly.
For double input of size 1e9 (...
2005 May 27
1
qcauchy accuracy (PR#7902)
...,FALSE,TRUE),0,1,FALSE,TRUE)
should yield 1e100 back, but I get 1.633178e+16. The code below does much
better. Notes:
1. p need not be finite. -Inf is ok in the log_p case and R_Q_P01_check
already checks things.
2. No need to disallow scale=0 and infinite location.
3. The code below uses isnan and finite directly. It needs to be adapted to
the
R way of doing that.
double
qcauchy (double p, double location, double scale, int lower_tail, int log_p)
{
if (isnan(p) || isnan(location) || isnan(scale))
return p + location + scale;
R_Q_P01_check(p);
if (scale < 0 || !finite(scale...