[Rd] qpois accuracy, efficiency, termination (PR#7900)

2005-05-26 Thread mwelinder
Full_Name: Morten Welinder
Version: 2.1.0
OS: src only
Submission from: (NULL) (216.223.241.226)


The qpois code has several problems in 2.1.0:

1. The code essentially does...

  z = qnorm(R_DT_qIv(porig), 0., 1., /*lower_tail*/TRUE, /*log_p*/FALSE);

   ...when it could just as well do...

  z = qnorm(porig, 0., 1., lower_tail, log_p);

   That would eliminate a lot of underflows.

2. A third party tells me that you want "gamma = 1 / sigma", not "gamma =
sigma".
   That should speed things up a lot.

3. If y>1/DBL_EPSILON (or a bit larger if intermediate results have better
   accuracy than double) then the loops will not terminate.  And, yes, the
   "fixme" is right that stepping is a bit too primitive.

__
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] seek(con, 0, "end", rw="r") does not always work correctly (PR#7899)

2005-05-26 Thread ligges
[EMAIL PROTECTED] wrote:

> I've noticed that seek(con, 0, "end", rw="r") on a file connection does 
> not always work correctly after a write (R 2.1.0 on Windows).
> 
> [Is a call to fflush() needed inside file_seek() in main/connections.c?]


If you have an idea where to fflush() precisely and your patch works, 
please tell it! I'll happily run some test cases where seeking matters.

Note that ?seek currently tells us "The value returned by seek(where=NA) 
appears to be unreliable on Windows systems, at least for text files."
It would be nice if this comment could be removed, of course 

Uwe Ligges



> Example (see the lines with the "***WRONG***" comment)
> 
>  > # seek(, rw="r") on a file does not always work correctly after a write
>  > f <- file("tmp3.txt", "w+b")
>  > # Write something earlier in the file
>  > seek(f, 10, rw="w")
> [1] 0
>  > writeLines(c("ghi", "jkl"), f)
>  > seek(f, 20, rw="w")
> [1] 18
>  > writeLines(c("abc"), f)
>  > seek(f, 0, "end", rw="w")
> [1] 24
>  > # Try to read at the end of the file
>  > seek(f, 0, "end", rw="r")
> [1] 0
>  > readLines(f, -1)
> character(0)
>  > seek(f, 0, "end", rw="w")
> [1] 18
>  > # write something at the end of the file
>  > writeLines(c("def"), f)
>  > # Try to read at the end of the file
>  > # flush(f) # flushing here makes the seek work correctly
>  > seek(f, 0, "end", rw="r")
> [1] 24
>  > seek(f, NA, rw="r") # ***WRONG*** (should return 28)
> [1] 24
>  > readLines(f, -1) # ***WRONG*** (should return character(0))
> [1] "def"
>  > seek(f, 20, rw="r")
> [1] 28
>  > readLines(f, -1)
> [1] "abc" "def"
>  > seek(f, 0, "end", rw="r") # now it works correctly
> [1] 28
>  > seek(f, NA, rw="r")
> [1] 28
>  > readLines(f, -1)
> character(0)
>  > close(f)
>  >
>  > version
>   _
> platform i386-pc-mingw32
> arch i386
> os   mingw32
> system   i386, mingw32
> status
> major2
> minor1.0
> year 2005
> month04
> day  18
> language R
>  >
> 
> -- Tony Plate
> 
> __
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Buidling R on Linux (Itanium) fails (PR#7897)

2005-05-26 Thread Ei-ji Nakama
> I tried to build R using the Intel compilers (icc, ifort) and the Math Kernel
> Libraries
> for BLAS/LAPACK
> 
> Optimizations used were -O3, and the 
> FPICFLAGS="-fpic"
> was exported.
> 
> The build failed with the following error message:

I did not use MKL, but there was a problem to Intel compiler. 
An as follows memo at that time. 
Because there is not yet an option restraining an exception in C++ of
IA64, icpc is not usable.

http://www.nakama.ne.jp/memo/ia64_linux/

--
e-mail : EIJI Nakama <[EMAIL PROTECTED]>

__
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Buidling R on Linux (Itanium) fails (PR#7897)

2005-05-26 Thread Christophe Pouzat

Hi,

here is the "configure" command line I used for an Intel PIV processor 
with icc, ifort and the intel mkl:


./configure CC=icc CFLAGS="-O2 -mp -prec_div" F77=ifort CXX=icc 
CXXFLAGS="-O2 -mp -prec_div" FFLAGS="-C90 -w90 -w95 -mp -prec_div" 
CPICFLAGS=-shared CXXPICFLAGS=-shared FPICFLAGS=-shared 
SHLIB_LDFLAGS=-shared SHLIB_CXXLDFLAGS=-shared --with-blas="-lmkl_lapack 
-lmkl -lguide -lpthread"


In my experience using "FPICFLAGS=-shared" is mendatory to get the 
compilation working. The other options are mainly there to pass almost 
all the tests (except one) of "make check".


Xtof.

[EMAIL PROTECTED] wrote:


Full_Name: Reinhold Bader
Version: 2.1.0
OS: SLES 9
Submission from: (NULL) (129.187.48.1)


I tried to build R using the Intel compilers (icc, ifort) and the Math Kernel
Libraries
for BLAS/LAPACK

Optimizations used were -O3, and the 
FPICFLAGS="-fpic"

was exported.

The build failed with the following error message:
...
dumping R code in package 'methods'
Saving namespace image ...
initializing class and method definitions now ...Error in
makePrototypeFromClassDef(properties, ClassDef, immediate, where) :
   in making the prototype for class "SClassExtension" elements of the
prototype failed to match the corresponding slot class: coerce (class
“character” ), test (class “character” ), replace (class “character” ), simple
(class “character” ), dataPart (class “character” )
Error: .onLoad failed in 'loadNamespace' for 'methods'
Execution halted

I am not a R specialist; how do I continue from here?
make[4]: *** [../..

__
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

 




--
A Master Carpenter has many tools and is expert with most of them.If you
only know how to use a hammer, every problem starts to look like a nail.
Stay away from that trap.
Richard B Johnson.
--

Christophe Pouzat
Laboratoire de Physiologie Cerebrale
CNRS UMR 8118
UFR biomedicale de l'Universite Paris V
45, rue des Saints Peres
75006 PARIS
France

tel: +33 (0)1 42 86 38 28
fax: +33 (0)1 42 86 38 30
web: www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html

__
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel