albrecht.gebhardt@uni-klu.ac.at
1999-Sep-13 01:02 UTC
axis() produces junk on DEC alpha (PR#274)
Full_Name: Albrecht Gebhardt Version: 0.65.0 OS: Digital Unix 4.0E Submission from: (NULL) (212.17.104.62) Plottimg on the Alpha stopped working with 0.65.0. The tickmarks have a length of -Inf and go across the whole plot. A first solution is the following patch: --- src/main/plot.c.alpha-patch Mon Sep 13 01:37:11 1999 +++ src/main/plot.c Mon Sep 13 01:58:16 1999 @@ -832,7 +832,7 @@ } dd->gp.col = fg; GLine(REAL(at)[0], y, REAL(at)[n - 1], y, USER, dd); - if (R_FINITE(dd->gp.tck)) { + if (R_FINITE(dd->gp.tck) && !(ISNAN(dd->gp.tck))) { /* The S way of doing ticks */ double y0, y1; if (dd->gp.tck > 0.5) { @@ -922,7 +922,7 @@ } dd->gp.col = fg; GLine(x, REAL(at)[0], x, REAL(at)[n - 1], USER, dd); - if (R_FINITE(dd->gp.tck)) { + if (R_FINITE(dd->gp.tck) && !(ISNAN(dd->gp.tck))) { /* The S way of doing ticks */ double x0, x1; if (dd->gp.tck > 0.5) { Albrecht Gebhardt -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 13 Sep 1999 albrecht.gebhardt@uni-klu.ac.at wrote:> Full_Name: Albrecht Gebhardt > Version: 0.65.0 > OS: Digital Unix 4.0E > Submission from: (NULL) (212.17.104.62) > > > Plottimg on the Alpha stopped working with 0.65.0. > > The tickmarks have a length of -Inf and go across the whole > plot.I've seen the problem on Solaris when make decided to re-configure and so parts of R got compiled with different compiler options (as under re-configuration different environmental variables were set). But for me the problem seems to be getting NaN.> A first solution is the following patch: > > --- src/main/plot.c.alpha-patch Mon Sep 13 01:37:11 1999 > +++ src/main/plot.c Mon Sep 13 01:58:16 1999 > @@ -832,7 +832,7 @@ > } > dd->gp.col = fg; > GLine(REAL(at)[0], y, REAL(at)[n - 1], y, USER, dd); > - if (R_FINITE(dd->gp.tck)) { > + if (R_FINITE(dd->gp.tck) && !(ISNAN(dd->gp.tck))) { > /* The S way of doing ticks */ > double y0, y1; > if (dd->gp.tck > 0.5) {.... I'm puzzled. Are you saying -Inf passes R_FINITE and passes ISNAN? (Wow!, if so,) In any case, let us try and fix the macros (which crop up in many places) not two instances. There are too many options in Arith.h to guess: can you please tell us what path is being taken (HAVE_FINITE, IEEE_754, FINITE_BROKEN, ...). I believe this can all be tested from interpreted R code. I believe you should get (is.na(c(2.0, Inf, -Inf, NaN, NA)) etc) 2.0 Inf -Inf NaN NA is.na F F F T T is.finite T F F F F is.infinite F T T F F is.nan F F F T F (Martin: I can't see this is checked in the tests explicitly. Should we add it?) Note though that is.na tests ISNAN and is.nan tests R_IsNaN, but is.finite does test R_FINITE. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
albrecht.gebhardt@uni-klu.ac.at
1999-Sep-13 08:57 UTC
axis() produces junk on DEC alpha (PR#274)
On Mon, 13 Sep 1999, Prof Brian D Ripley wrote:> On Mon, 13 Sep 1999 albrecht.gebhardt@uni-klu.ac.at wrote: > > > Full_Name: Albrecht Gebhardt > > Version: 0.65.0 > > OS: Digital Unix 4.0E > > Submission from: (NULL) (212.17.104.62) > > > > > > Plottimg on the Alpha stopped working with 0.65.0. > > > > The tickmarks have a length of -Inf and go across the whole > > plot. > > I've seen the problem on Solaris when make decided to re-configure > and so parts of R got compiled with different compiler options (as under > re-configuration different environmental variables were set). But for me > the problem seems to be getting NaN.Yes it was NaN and not -Inf! Sorry> > > A first solution is the following patch: > > > > --- src/main/plot.c.alpha-patch Mon Sep 13 01:37:11 1999 > > +++ src/main/plot.c Mon Sep 13 01:58:16 1999 > > @@ -832,7 +832,7 @@ > > } > > dd->gp.col = fg; > > GLine(REAL(at)[0], y, REAL(at)[n - 1], y, USER, dd); > > - if (R_FINITE(dd->gp.tck)) { > > + if (R_FINITE(dd->gp.tck) && !(ISNAN(dd->gp.tck))) { > > /* The S way of doing ticks */ > > double y0, y1; > > if (dd->gp.tck > 0.5) { > > .... > > I'm puzzled. Are you saying -Inf passes R_FINITE and passes ISNAN? (Wow!, > if so,) In any case, let us try and fix the macros (which crop up in many > places) not two instances.NaN passed R_FINITE (see above). Then it gets multiplied by some values and serves as tickmark length.> > There are too many options in Arith.h to guess: can you please tell us > what path is being taken (HAVE_FINITE, IEEE_754, FINITE_BROKEN, ...).in src/include/Rconfig.h: /* Floating Point Arithmetic */ /* #undef HAVE_MATHERR */ /* System V */ #define HAVE_ISNAN 1 /* IEEE Arith indicator */ #define HAVE_FINITE 1 /* #undef HAVE_FLOATINGPOINT_H */ /* #undef HAVE_FPU_CONTROL_H */ /* #undef HAVE_IEEEFP_H */ /* "-Wall" */ /* #undef HAVE_IEEE754_H */ /* Linux */ #ifdef HAVE_ISNAN #ifdef HAVE_FINITE #define IEEE_754 #endif #endif and some lines below: /* Bug Workarounds */ /* #undef HAVE_OSF_SPRINTF_BUG */ #define CALLOC_BROKEN 1 #define FINITE_BROKEN 1 #define LOG_BROKEN 1> > I believe this can all be tested from interpreted R code. I believe you > should get (is.na(c(2.0, Inf, -Inf, NaN, NA)) etc) > 2.0 Inf -Inf NaN NA > is.na F F F T T > is.finite T F F F F > is.infinite F T T F F > is.nan F F F T F> is.na(c(2.0, Inf, -Inf, NaN, NA))[1] FALSE FALSE FALSE TRUE TRUE> is.finite(c(2.0, Inf, -Inf, NaN, NA))[1] TRUE TRUE TRUE TRUE TRUE> is.infinite(c(2.0, Inf, -Inf, NaN, NA))[1] FALSE FALSE FALSE FALSE FALSE> is.nan(c(2.0, Inf, -Inf, NaN, NA))[1] FALSE FALSE FALSE TRUE FALSE Seems that everything is R_FINITE!> (Martin: I can't see this is checked in the tests explicitly. Should we add > it?) Note though that is.na tests ISNAN and is.nan tests R_IsNaN, but > is.finite does test R_FINITE. > > -- > Brian D. Ripley, ripley@stats.ox.ac.uk > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272860 (secr) > Oxford OX1 3TG, UK Fax: +44 1865 272595 >------------------------------------------------------------------------------- Albrecht Gebhardt email : albrecht.gebhardt@uni-klu.ac.at Institut fuer Mathematik Tel. : (++43 463) 2700/837 Universitaet Klagenfurt Fax : (++43 463) 2700/834 Villacher Str. 161 A-9020 Klagenfurt, Austria ------------------------------------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> Date: Mon, 13 Sep 1999 10:57:23 +0200 (MET DST) > From: Albrecht Gebhardt <albrecht.gebhardt@uni-klu.ac.at> > > On Mon, 13 Sep 1999, Prof Brian D Ripley wrote:[...]> > I'm puzzled. Are you saying -Inf passes R_FINITE and passes ISNAN? (Wow!, > > if so.) In any case, let us try and fix the macros (which crop up in many > > places) not two instances. > > NaN passed R_FINITE (see above). Then it gets multiplied by some values > and serves as tickmark length. > > > > > There are too many options in Arith.h to guess: can you please tell us > > what path is being taken (HAVE_FINITE, IEEE_754, FINITE_BROKEN, ...).> in src/include/Rconfig.h: > /* Floating Point Arithmetic */ > /* #undef HAVE_MATHERR */ /* System V */ > #define HAVE_ISNAN 1 /* IEEE Arith indicator */ > #define HAVE_FINITE 1 > > /* #undef HAVE_FLOATINGPOINT_H */ > /* #undef HAVE_FPU_CONTROL_H */ > /* #undef HAVE_IEEEFP_H */ /* "-Wall" */ > /* #undef HAVE_IEEE754_H */ /* Linux */ > > #ifdef HAVE_ISNAN > #ifdef HAVE_FINITE > #define IEEE_754 > #endif > #endif > > and some lines below: > /* Bug Workarounds */ > /* #undef HAVE_OSF_SPRINTF_BUG */ > #define CALLOC_BROKEN 1 > #define FINITE_BROKEN 1 > #define LOG_BROKEN 1 > > > > > > I believe this can all be tested from interpreted R code. I believe you > > should get (is.na(c(2.0, Inf, -Inf, NaN, NA)) etc) > > 2.0 Inf -Inf NaN NA > > is.na F F F T T > > is.finite T F F F F > > is.infinite F T T F F > > is.nan F F F T F > > > > is.na(c(2.0, Inf, -Inf, NaN, NA)) > [1] FALSE FALSE FALSE TRUE TRUE > > is.finite(c(2.0, Inf, -Inf, NaN, NA)) > [1] TRUE TRUE TRUE TRUE TRUE > > is.infinite(c(2.0, Inf, -Inf, NaN, NA)) > [1] FALSE FALSE FALSE FALSE FALSE > > is.nan(c(2.0, Inf, -Inf, NaN, NA)) > [1] FALSE FALSE FALSE TRUE FALSE > > Seems that everything is R_FINITE![...] OK, so I think you are at the line # define R_FINITE(x) ((x) != R_NaReal) in Arith.h, and that is clearly inadequate (although it should have caught the NA, I think). Can you please try replacing that line by static int R_FINITE(double x) { return !isnan(x) & (x != R_PosInf) & (x != R_NegInf); } and try those tests again. (Kurt: looks like finite can be broken in more ways than one. I suggest return(finite(1./0.) & finite(0./0.) & finite(-1./0.)) in aclocal.m4, and if FINITE_BROKEN going directly to some function like the above, and not trying to be efficient, just right!) -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
maechler@stat.math.ethz.ch
1999-Sep-13 16:08 UTC
axis() produces junk on DEC alpha (PR#274)
>>>>> On Mon, 13 Sep 1999 17:41:07 +0200 (MET DST), ripley@stats.ox.ac.uk (Brian D. Ripley) said:>> Date: Mon, 13 Sep 1999 10:57:23 +0200 (MET DST) >> From: Albrecht Gebhardt <albrecht.gebhardt@uni-klu.ac.at> >> >> On Mon, 13 Sep 1999, Prof Brian D Ripley wrote: BDR> [...] BDR> I'm puzzled. Are you saying -Inf passes R_FINITE and passes BDR> ISNAN? (Wow!, if so.) In any case, let us try and fix the macros BDR> (which crop up in many places) not two instances. BDR> >> NaN passed R_FINITE (see above). Then it gets multiplied by some >> values and serves as tickmark length. >> >> > >> > There are too many options in Arith.h to guess: can you please tell us >> > what path is being taken (HAVE_FINITE, IEEE_754, FINITE_BROKEN, ...). >> in src/include/Rconfig.h: >> /* Floating Point Arithmetic */ >> /* #undef HAVE_MATHERR */ /* System V */ >> #define HAVE_ISNAN 1 /* IEEE Arith indicator */ >> #define HAVE_FINITE 1 >> >> /* #undef HAVE_FLOATINGPOINT_H */ >> /* #undef HAVE_FPU_CONTROL_H */ >> /* #undef HAVE_IEEEFP_H */ /* "-Wall" */ >> /* #undef HAVE_IEEE754_H */ /* Linux */ >> >> #ifdef HAVE_ISNAN >> #ifdef HAVE_FINITE >> #define IEEE_754 >> #endif >> #endif >> >> and some lines below: >> /* Bug Workarounds */ >> /* #undef HAVE_OSF_SPRINTF_BUG */ >> #define CALLOC_BROKEN 1 >> #define FINITE_BROKEN 1 >> #define LOG_BROKEN 1 >> >> >> > >> > I believe this can all be tested from interpreted R code. I believe you >> > should get (is.na(c(2.0, Inf, -Inf, NaN, NA)) etc) >> > 2.0 Inf -Inf NaN NA >> > is.na F F F T T >> > is.finite T F F F F >> > is.infinite F T T F F >> > is.nan F F F T F >> >> >> > is.na(c(2.0, Inf, -Inf, NaN, NA)) >> [1] FALSE FALSE FALSE TRUE TRUE >> > is.finite(c(2.0, Inf, -Inf, NaN, NA)) >> [1] TRUE TRUE TRUE TRUE TRUE >> > is.infinite(c(2.0, Inf, -Inf, NaN, NA)) >> [1] FALSE FALSE FALSE FALSE FALSE >> > is.nan(c(2.0, Inf, -Inf, NaN, NA)) >> [1] FALSE FALSE FALSE TRUE FALSE >> >> Seems that everything is R_FINITE! BDR> [...] BDR> OK, so I think you are at the line BDR> # define R_FINITE(x) ((x) != R_NaReal) BDR> in Arith.h, and that is clearly inadequate (although it should have BDR> caught the NA, I think). Can you please try replacing that line by BDR> static int R_FINITE(double x) { BDR> return !isnan(x) & (x != R_PosInf) & (x != R_NegInf); BDR> } BDR> and try those tests again. BDR> (Kurt: looks like finite can be broken in more ways than one. I suggest BDR> return(finite(1./0.) & finite(0./0.) & finite(-1./0.)) in aclocal.m4, shouldn't this be "|" instead of "&" [broken if either is finite] ? BDR> and if FINITE_BROKEN going directly to some function like the BDR> above, and not trying to be efficient, just right!) {weak voice in the background: it may be worth tyring to be both right and efficient .. but I agree that "right" is much more important! } -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 13 Sep 1999, Martin Maechler wrote:> >>>>> On Mon, 13 Sep 1999 17:41:07 +0200 (MET DST), ripley@stats.ox.ac.uk (Brian D. Ripley) said: > > >> Date: Mon, 13 Sep 1999 10:57:23 +0200 (MET DST) > >> From: Albrecht Gebhardt <albrecht.gebhardt@uni-klu.ac.at> > >> > >> On Mon, 13 Sep 1999, Prof Brian D Ripley wrote: > > BDR> [...] > > BDR> I'm puzzled. Are you saying -Inf passes R_FINITE and passes > BDR> ISNAN? (Wow!, if so.) In any case, let us try and fix the macros > BDR> (which crop up in many places) not two instances. > BDR> > >> NaN passed R_FINITE (see above). Then it gets multiplied by some > >> values and serves as tickmark length. > >> > >> > > >> > There are too many options in Arith.h to guess: can you please tell us > >> > what path is being taken (HAVE_FINITE, IEEE_754, FINITE_BROKEN, ...). > > >> in src/include/Rconfig.h: > >> /* Floating Point Arithmetic */ > >> /* #undef HAVE_MATHERR */ /* System V */ > >> #define HAVE_ISNAN 1 /* IEEE Arith indicator */ > >> #define HAVE_FINITE 1 > >> > >> /* #undef HAVE_FLOATINGPOINT_H */ > >> /* #undef HAVE_FPU_CONTROL_H */ > >> /* #undef HAVE_IEEEFP_H */ /* "-Wall" */ > >> /* #undef HAVE_IEEE754_H */ /* Linux */ > >> > >> #ifdef HAVE_ISNAN > >> #ifdef HAVE_FINITE > >> #define IEEE_754 > >> #endif > >> #endif > >> > >> and some lines below: > >> /* Bug Workarounds */ > >> /* #undef HAVE_OSF_SPRINTF_BUG */ > >> #define CALLOC_BROKEN 1 > >> #define FINITE_BROKEN 1 > >> #define LOG_BROKEN 1 > >> > >> > >> > > >> > I believe this can all be tested from interpreted R code. I believe you > >> > should get (is.na(c(2.0, Inf, -Inf, NaN, NA)) etc) > >> > 2.0 Inf -Inf NaN NA > >> > is.na F F F T T > >> > is.finite T F F F F > >> > is.infinite F T T F F > >> > is.nan F F F T F > >> > >> > >> > is.na(c(2.0, Inf, -Inf, NaN, NA)) > >> [1] FALSE FALSE FALSE TRUE TRUE > >> > is.finite(c(2.0, Inf, -Inf, NaN, NA)) > >> [1] TRUE TRUE TRUE TRUE TRUE > >> > is.infinite(c(2.0, Inf, -Inf, NaN, NA)) > >> [1] FALSE FALSE FALSE FALSE FALSE > >> > is.nan(c(2.0, Inf, -Inf, NaN, NA)) > >> [1] FALSE FALSE FALSE TRUE FALSE > >> > >> Seems that everything is R_FINITE! > > BDR> [...] > > BDR> OK, so I think you are at the line > > BDR> # define R_FINITE(x) ((x) != R_NaReal) > > BDR> in Arith.h, and that is clearly inadequate (although it should have > BDR> caught the NA, I think). Can you please try replacing that line by > > BDR> static int R_FINITE(double x) { > BDR> return !isnan(x) & (x != R_PosInf) & (x != R_NegInf); > BDR> } > > BDR> and try those tests again. > > BDR> (Kurt: looks like finite can be broken in more ways than one. I suggest > BDR> return(finite(1./0.) & finite(0./0.) & finite(-1./0.)) in aclocal.m4, > > shouldn't this be "|" instead of "&" [broken if either is finite] ?Um. Yes, I think so: the man page is almost impossible to decipher, and I had read it reversed.> {weak voice in the background: > it may be worth tyring to be both right and efficient .. > but I agree that "right" is much more important!Not, I think, on platforms where the inbuilt ways are broken. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._