Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-12 Thread Berend Hasselman
> On 12 Sep 2019, at 10:36, Serguei Sokol wrote: > > On 11/09/2019 21:38, Berend Hasselman wrote: >> The Lapack library is loaded automatically by R itself when it needs it for >> doing some calculation. >> You can force it to do that with a (dummy) solve for ex

Re: [Rd] Calling a LAPACK subroutine from R

2019-09-12 Thread Berend Hasselman
Followup: I have checked my package nleqslv which uses dgemv only from Fortran, on Kubuntu 18.04 with the development version of R. No errors or problems. Berend > On 12 Sep 2019, at 08:57, Berend Hasselman wrote: > > > I have tried what I proposed in a virtual Kubuntu 18.0

Re: [Rd] Calling a LAPACK subroutine from R

2019-09-11 Thread Berend Hasselman
y of dgemv and changing the character parameter to integer, and > adding Jack Dongarra, Jeremy Du Croz, Sven Hammarling, and Richard Hanson as > authors of eha. And a Copyright note, all in the DESCRIPTION file. Ugly but > what can I do (except rewriting the Fortran code in C with f2c)?

Re: [Rd] Fw: Calling a LAPACK subroutine from R

2019-09-11 Thread Berend Hasselman
lt;- -phi round(AB, 3) AB.ch <- .Fortran("xdpbtrf", kUPLO=1L, N = as.integer(n), KD = 1L, AB = AB, LDAB = 2L, INFO = as.integer(0))$AB AB.ch and you are good to go. You should always do something as described above when you need to pass character arguments to

Re: [Rd] gfortran 9 quantreg bug

2019-08-04 Thread Berend Hasselman
nings "Possible change of value ...". This is going to be very difficult. Berend Hasselman > On 4 Aug 2019, at 08:48, Koenker, Roger W wrote: > > I’d like to solicit some advice on a debugging problem I have in the quantreg > package. > Kurt and Brian have repo

Re: [Rd] R problems with lapack with gfortran

2019-05-04 Thread Berend Hasselman
Hi, Thomas, Tomas, Doesn't this issue demonstrate the warning and advice given in the last paragraph of section 6.6 of the "Writing R Extensions" manual: Passing character strings from C to Fortran or vice versa is not portable (and to Fortran 90 or later is even less so). We have found that

Re: [Rd] code for sum function

2019-02-20 Thread Berend Hasselman
b <- (s-t)+xi # intermediate step needed in R otherwise cancellation z <- z+b # If sum is bigger, low-order digits of xi are lost. } else { b <- (xi-t)+s # intermediate step needed in R otherwise cancellation z <- z+b # else low-order digits of sum are lost } s <- t } s+z # correction only applied once in the very end } testx <- c(1,10^100,1,-10^100) neumaierSum(testx) gives 2 as answer. Berend Hasselman __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] nlminb with constraints failing on some platforms

2019-02-06 Thread Berend Hasselman
> On 6 Feb 2019, at 10:58, Martin Maechler wrote: > . > --- > > I summarize what has been reported till: > > Failure in these cases > > 1. Kasper K ("Scientific Linux", self compiled R, using Intel's MKL >

Re: [Rd] nlminb with constraints failing on some platforms

2019-02-01 Thread Berend Hasselman
l(opt$par, xhat, tol=0) # good: 5.53 e-7 > [1] "Mean relative difference: 5.534757e-07" >> all.equal(opt$objective, f(xhat), tol=0) # good: 1.8 e-12 > [1] "Mean relative difference: 1.816536e-12" >> abs( opt$objective - f(xhat) ) < 1e-4 ## Must be

[Rd] Where are dggsvd3 and dggsvp3?

2017-11-13 Thread Berend Hasselman
are they in the R sources? Berend Hasselman __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Possible with enableJIT function

2017-06-14 Thread Berend Hasselman
> On 13 Jun 2017, at 22:05, luke-tier...@uiowa.edu wrote: > > Thanks. This should be resolved in R-devel(r72788) and R-patched > (r72789) > Also thanks. It is resolved in R-patched. Berend > Best, > > luke > > On Mon, 12 Jun 2017, Berend Hasselman wrote: >

[Rd] Possible with enableJIT function

2017-06-12 Thread Berend Hasselman
ed is 24495816" [1] "nleqslv iteration 7 and memory used is 24495816" [1] "nleqslv iteration 8 and memory used is 24495816" [1] "nleqslv iteration 9 and memory used is 24495816" [1] "nleqslv iteration 10 and memory used is 24495816" My questions are

Re: [Rd] precision of do_arith() in arithmetic.c

2017-05-24 Thread Berend Hasselman
> On 24 May 2017, at 04:24, M Kim wrote: > > To the R development team: > > First of all, thank you so much for maintaining wonderful R software. > > Perhaps, Dr. Ahn has just reported an error on the wilcox.test() function, > and suggesting that an error may arise from abs() and rank(). > >

Re: [Rd] registering Fortran routines in R packages

2017-05-10 Thread Berend Hasselman
> On 10 May 2017, at 08:48, Berend Hasselman wrote: > > Christophe, > >> On 10 May 2017, at 08:08, Christophe Dutang wrote: >> >> Thanks for your email. >> >> I try to change the name in lowercase but it conflicts with a C >> implementati

Re: [Rd] registering Fortran routines in R packages

2017-05-09 Thread Berend Hasselman
Christophe, > On 10 May 2017, at 08:08, Christophe Dutang wrote: > > Thanks for your email. > > I try to change the name in lowercase but it conflicts with a C > implementation also named halton. So I rename the C function halton2() and > sobol2() while the Fortran function are HALTON() and

Re: [Rd] registering Fortran routines in R packages

2017-05-09 Thread Berend Hasselman
NC) &F77_SUB(SOBOL), 11}, > {NULL, NULL, 0} > }; > > But the problem remains the same. > > Is there a way to have header file for Fortran codes? how to declare routines > defined in my Fortran file src/LowDiscrepancy.f? > lowercase routine names? manual does m

Re: [Rd] Ancient C /Fortran code linpack error

2017-02-10 Thread Berend Hasselman
> On 10 Feb 2017, at 14:53, Göran Broström wrote: > > Thanks to all who answered my third question. I learned something, but: > > On 2017-02-09 17:44, Martin Maechler wrote: >> On 9 Feb 2017, at 16:00, Göran Broström wrote: In my package 'glmmML' I'm using old C code and linpa

Re: [Rd] Ancient C /Fortran code linpack error

2017-02-09 Thread Berend Hasselman
= REAL(sexp_fjac); > for (j = 0; j < *n; j++) >for (i = 0; i < *n; i++) { >if( !R_FINITE(fj[(*n)*j + i]) ) > error("non-finite value(s) returned by jacobian > (row=%d,col=%d)",i+1,j+1); > rjac[(*ldr)*j + i] = fj[(*n)*j + i]; > } >

Re: [Rd] Ancient C /Fortran code linpack error

2017-02-09 Thread Berend Hasselman
ot;,i+1,j+1); rjac[(*ldr)*j + i] = REAL(sexp_fjac)[(*n)*j + i]; } There may be a more compact way with a macro in the R headers. I feel that If other code can't handle non-finite values: then test. Berend Hasselman __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] BUG?: On Linux setTimeLimit() fails to propagate timeout error when it occurs (works on Windows)

2016-10-26 Thread Berend Hasselman
> On 26 Oct 2016, at 04:44, Henrik Bengtsson wrote: > ... > This looks like a bug to me. Can anyone on macOS confirm whether this > is also a problem there or not? > Tried it on macOS El Capitan and got this (running in R.app with R version 3.3.2 RC (2016-10-23 r71574): > setTimeLimit(e

Re: [Rd] rmultinom.c error probability not sum to 1

2016-03-10 Thread Berend Hasselman
> On 10 Mar 2016, at 21:25, m.van_iter...@lumc.nl wrote: > > Hi all, > > I should have given a better explanation of my problem. Here it is. > > I extracted from my code the bit that gives the error. Place this in a file > called test.c > > #include > #include > #include > #include > #in

Re: [Rd] ALLOCATE in a FORTRAN subroutine

2016-03-07 Thread Berend Hasselman
> On 7 Mar 2016, at 18:55, Berend Hasselman wrote: > >> >> On 7 Mar 2016, at 16:45, MAURICE Jean - externe >> wrote: >> >> Hi Martyn, >> >> Many thanks for your answer. If I make it short : >> we can, once we know how to do it,

Re: [Rd] ALLOCATE in a FORTRAN subroutine

2016-03-07 Thread Berend Hasselman
> On 7 Mar 2016, at 16:45, MAURICE Jean - externe > wrote: > > Hi Martyn, > > Many thanks for your answer. If I make it short : > we can, once we know how to do it, 'drive' R from within FORTRAN for example > to do a > Myarray = seq(0, mydimension) > in R once we have compute mydimension

Re: [Rd] Return options used to configure R

2016-01-22 Thread Berend Hasselman
> On 22 Jan 2016, at 14:07, Tom Quarendon wrote: > > I did have a search, but searching for "configure" just brought up loads of > results for how to configure R. > I'm sure it is in the manual, once you know where to look for it and if you > know all the manuals inside out. > > Looking at th

Re: [Rd] Expected error with help.search in R 3.2.0

2015-06-13 Thread Berend Hasselman
> On 14-06-2015, at 06:47, David Winsemius wrote: > > Using the Mavericks/Yosemite version of R 3.2.0, I see this: > >> utils::help.search("linear models") > Error in help(db[i, "topic"], package = db[i, "Package"], lib.loc = lib, : > 'topic' should be a name, length-one character vector or re

Re: [Rd] R-devel Digest, Vol 148, Issue 5

2015-06-05 Thread Berend Hasselman
> On 05-06-2015, at 14:16, Thomas J. Leeper wrote: > > It's disappointing that many packages do not have a NEWS file. Perhaps > CRAN should require NEWS or CHANGELOG, as long as the system is being > reformed to potentially accommodate markdown anyway. > I don’t really care about markdown. But

Re: [Rd] Problem with shared library and lapack under windows

2015-06-03 Thread Berend Hasselman
> On 03-06-2015, at 09:48, bstr wrote: > > Hi all, > > I have a C function, say Cfun, that calls Lapack's DGEMM routine and I need > to create a shared library to use Cfun inside R. The C file is the following > > #include > #include > #include > > > void Cfun(double *res, double *X, int *n,

Re: [Rd] Building R package: “Found 'rand', possibly from 'rand' (C)” NOTE when checking package

2014-11-02 Thread Berend Hasselman
On 02-11-2014, at 12:20, January Weiner wrote: > I am building a package that makes a simple visualization. A part of > the code is in C++, and utilizes the functions srand() and rand() for > purposes not related to statistics (introducing random noise in the > visualization). The package compil

Re: [Rd] Replace isnan and lgamma in Fortran subroutine in R package

2014-09-22 Thread Berend Hasselman
On 23-09-2014, at 00:33, Wang, Zhu wrote: > 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 G

Re: [Rd] help.start() web page contains a bad link

2014-09-18 Thread Berend Hasselman
On 18-09-2014, at 19:48, Davison, Jerry wrote: > Hi, > > At my work, the web page opened with the R command help.start() has a link > "User Manuals". Activating it gives this response: > > Error in vignettes[i, "PDF"] : subscript out of bounds > Fixed in R 3.1.1 patched. Berend >> sess

[Rd] Typo in doc/html/about.html

2014-08-31 Thread Berend Hasselman
There is a typo in the file /doc/html/about.html: In the line with "The two languages are implemented quite differently, but bear enough superficial resemblence that users should be able to switch between the two with relative ease.” resemblence should be resemblance. Berend Hass

Re: [Rd] dubious behaviour of match.arg() with nested functions.

2014-08-25 Thread Berend Hasselman
On 25-08-2014, at 16:27, Joris Meys wrote: > Dear all, > > I initially ran into this problem while rebuilding a package dependent on > nleqslv. I got the following error: > > Error in match.arg(global) : 'arg' must be of length 1 > > This didn't occur in previous versions of nleqslv, but did

Re: [Rd] Problem running checks after building R-patched

2014-05-07 Thread Berend Hasselman
On 07-05-2014, at 11:23, Martin Maechler wrote: >>>>>> Berend Hasselman >>>>>>on Wed, 7 May 2014 09:24:46 +0200 writes: > >> I am compiling the latest R-patched (Revision: 65533) Ubuntu Lucid (10.04). > >> Building succeeds bu

[Rd] Problem running checks after building R-patched

2014-05-07 Thread Berend Hasselman
I am compiling the latest R-patched (Revision: 65533) Ubuntu Lucid (10.04). Building succeeds but make check stops with an error. The output in the terminal from make check: Testing examples for package ‘base’ Testing examples for package ‘tools’ Error: testing 'tools' failed Execution halted m

Re: [Rd] Fortran BLAS giving bad results

2014-01-12 Thread Berend Hasselman
On 12-01-2014, at 08:26, Berwin A Turlach wrote: > G'day Emmanuel, > > On Sat, 11 Jan 2014 14:08:41 -0800 > Emmanuel Sharef wrote: > >> Example: this program creates two double vectors, takes the dot >> product with ddot, and prints the result: >> >> test.f: >> subroutine testddot(n,x,y

Re: [Rd] Subversion log no longer being updated daily

2013-10-20 Thread Berend Hasselman
On 21-10-2013, at 03:38, Simon Urbanek wrote: > On Oct 20, 2013, at 2:00 AM, Berend Hasselman wrote: > >> >> The subversion log for 2013 (http://developer.r-project.org/R_svnlog_2013) >> on the R developer page hasn't been updated since September 29. I would &g

[Rd] Subversion log no longer being updated daily

2013-10-19 Thread Berend Hasselman
The subversion log for 2013 (http://developer.r-project.org/R_svnlog_2013) on the R developer page hasn't been updated since September 29. I would appreciate the daily updates returning. Berend Hasselman __ R-devel@r-project.org mailing list

Re: [Rd] Using long long types in C++

2013-09-20 Thread Berend Hasselman
On 20-09-2013, at 03:47, Eric Malitz wrote: > I've been trying desperately to unsubscribe from this. Not that I don't > like R; but I only wanted help and then ended up on this email list. I've > put in more than one request to unsubscribe. > > __ > R

[Rd] Redundant text in help page for eigen

2013-08-04 Thread Berend Hasselman
I noticed that there is some redundant text in eigen.Rd (both the patched and the devel version). "whereas" appears to be a leftover of previous versions. \source{ By default \code{eigen} uses the LAPACK routines \code{DSYEVR}, \code{DGEEV}, \code{ZHEEV} and \code{ZGEEV} whereas LAPACK

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-19 Thread Berend Hasselman
On 19-06-2013, at 14:17, peter dalgaard wrote: > > > > Thanks. I think I have it nailed down now. The culprit was indeed in our > reference BLAS (I had only checked the LAPACK code), cmplxblas.f to be > specific. Revision 53001 had a number of IF statements being commented out, > but two o

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-19 Thread Berend Hasselman
On 19-06-2013, at 10:24, peter dalgaard wrote: > > On Jun 18, 2013, at 21:49 , peter dalgaard wrote: > >> >> On Jun 18, 2013, at 21:23 , Berend Hasselman wrote: >> >>> >>> So it seems that the blocked algorithm is the cause of the error and

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-18 Thread Berend Hasselman
On 18-06-2013, at 13:23, peter dalgaard wrote: > On some further digging, on the Lion machine, the problem seems absent from > builds against the veclib framework. I strongly suspect that the issue is the > same as PR#14964, which also affects Hermitian matrices of dimension 33x33 > and above

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-18 Thread Berend Hasselman
On 18-06-2013, at 09:57, peter dalgaard wrote: > > On Jun 18, 2013, at 03:30 , robin hankin wrote: > >> R-3.0.1 rev 62743, binary downloaded from CRAN just now; macosx 10.8.3 >> >> Hello, >> >> eigen(symmetric=TRUE) behaves strangely when given complex matrices. >> >> >> The following two

Re: [Rd] RFC: a "safe" uniroot() function for future R

2013-06-03 Thread Berend Hasselman
On 31-05-2013, at 10:34, Martin Maechler wrote: ….. > From the current feedbacks, I'd come to propose / further > discuss the following issues: > > 1) the goal is to remain with one function uniroot() > > 2) Instead of the 'Sig' = "sign(f'(x_0))" {not quite, but typically} > with 4 different

Re: [Rd] Error Message while Package creation

2013-04-24 Thread Berend Hasselman
On 25-04-2013, at 07:21, Crish.. wrote: > Hello Guys, > > I wanted to build a new R package from the R code. I installed all the > required software and made all the path settings. > > When i tried running, > cmd> RCMD check SamplePackageName > > while "Checking R code for possible errors"

Re: [Rd] R CMD check in R-3.0.0 gives warnings

2013-03-22 Thread Berend Hasselman
On 22-03-2013, at 21:26, Dirk Eddelbuettel wrote: > > On 22 March 2013 at 21:03, Berend Hasselman wrote: > | I am running R CMD check on my package nleqslv with R-3.0.0 beta > (2013-03-33 r62364) on Mac OS X 10.6.8 > | > | In contrast with R-2.15.3 R CMD check now

[Rd] R CMD check in R-3.0.0 gives warnings

2013-03-22 Thread Berend Hasselman
I am running R CMD check on my package nleqslv with R-3.0.0 beta (2013-03-33 r62364) on Mac OS X 10.6.8 In contrast with R-2.15.3 R CMD check now issues a note for - Mercurial version control files .hgignore, .hgtags and directory .hg. These are however included in .hidden_file_exclusions. -

Re: [Rd] qr.qy and qr.qty give an error message when y is integer and LAPACK=TRUE

2012-12-03 Thread Berend Hasselman
On 03-12-2012, at 16:17, Martin Maechler wrote: >>>>>> Berend Hasselman >>>>>>on Mon, 3 Dec 2012 15:25:21 +0100 writes: > >> With this example > >> set.seed(123) A <- matrix(runif(40), nrow = 8) y <- >> 1:nrow(A) >

[Rd] qr.qy and qr.qty give an error message when y is integer and LAPACK=TRUE

2012-12-03 Thread Berend Hasselman
With this example set.seed(123) A <- matrix(runif(40), nrow = 8) y <- 1:nrow(A) A.laqr <- qr(A, LAPACK=TRUE) both qr.qy(A.laqr,y) and qr.qty(A.laqr,y) give the respective error messages Error in qr.qy(A.laqr, y) : 'b' must be a numeric matrix Error in qr.qty(A.laqr, y) : 'b' must be a nume

Re: [Rd] malloc error in tab-completion: OS X

2012-10-07 Thread Berend Hasselman
On 07-10-2012, at 17:34, R. Michael Weylandt wrote: > I've just built R-devel (r60889) from source on my Mac OS X 10.6.8 > using gcc from Xcode and gfortran from Simon. I didn't use all the > recommended configuration flags only > > . > My compiler info follows > > mweylandt-laptop:~ michae

Re: [Rd] include dll in R-package

2012-08-29 Thread Berend Hasselman
On 29-08-2012, at 05:31, LIYING HUANG wrote: > > > Thanks a lot for those examples, is there any example with Fortran > source codes which could depend on an external Fortran DLL? > I wouldn't know. Berend __ R-devel@r-project.org mailing list htt

Re: [Rd] include dll in R-package

2012-08-28 Thread Berend Hasselman
On 28-08-2012, at 01:29, LIYING HUANG wrote: > > I am quite new in R, I looked at R manual- how to build R Package, > still not very clear. Yes, it would be very helpful if I could > download a package having Fortran source codes to look at, Do > you know any package built with Fortran source

Re: [Rd] Hidden files in source packages

2012-08-27 Thread Berend Hasselman
On 27-08-2012, at 09:46, Prof Brian Ripley wrote: > R-devel has been warning for some time about hidden files (in the Unix sense, > starting with a period) in source packages. We could get R CMD build and > the CRAN incoming scripts to remove these *if* we knew that they were never > needed.

Re: [Rd] How does .Fortran "dqrls" work?

2012-04-27 Thread Berend Hasselman
On 27-04-2012, at 14:56, David L Lorenz wrote: > Of course, what you could do is Google dqrls and get the source and > documentation. That is because it is in the publically available linpack. > If it were not publically available that would not work. Theoretically, > all FORTRAN or C code in

Re: [Rd] Task View on Numerical Analysis and Differential Equations

2012-03-08 Thread Berend Hasselman
On 08-03-2012, at 12:16, Hans W Borchers wrote: > I am wondering if it would be time to have a new Task View, this time > for the subject of "Numerical Analysis and Differential Equations". > The list of packages possibly appearing in such a task view is already > quite long and could, for exampl

Re: [Rd] Calling FORTRAN function from R issue?

2012-03-06 Thread Berend Hasselman
On 06-03-2012, at 15:46, Berend Hasselman wrote: > >> >>> Thus, perhaps strangely, if there is only a >>> external double complex zdotc >>> declaration in your subroutine, the compiler doesn't know that a call >> >> The only 'st

Re: [Rd] Calling FORTRAN function from R issue?

2012-03-06 Thread Berend Hasselman
On 06-03-2012, at 15:17, Prof Brian Ripley wrote: >> [..] >> used to indicate that the function/variable/symbol is defined in >> another compilation unit. In FORTRAN77, "external" is used to tell the >> compiler that you are passing a function to another >> function/subroutine. At least that is

Re: [Rd] Calling FORTRAN function from R issue?

2012-03-06 Thread Berend Hasselman
On 06-03-2012, at 14:37, Berwin A Turlach wrote: > G'day Berend, > > On Tue, 6 Mar 2012 13:06:34 +0100 > Berend Hasselman wrote: > > [... big snip ...] > >> But I would really like to hear from an Rexpert why you >> shouldn't/can't use ex

Re: [Rd] Calling FORTRAN function from R issue?

2012-03-06 Thread Berend Hasselman
On 06-03-2012, at 12:56, Berwin A Turlach wrote: > G'day Berend, > > [..] >> I tried calling zdotc through an intermediate Fortran routine hoping >> it would solve your problem. > [...] >> Above C routine changed to > [...] >> The fortran subroutine is >> >> >> subroutine callzdotc(retv

Re: [Rd] Calling FORTRAN function from R issue?

2012-03-06 Thread Berend Hasselman
On 06-03-2012, at 01:21, Dominick Samperi wrote: > Hello, > > I am trying to call the BLAS Level1 function zdotc from R via > a .C call like this: > > #include "R.h" > #include "R_ext/BLAS.h" > > void testzdotc() { >Rcomplex zx[3], zy[3], ret_val; > >zx[0].r = 1.0; zx[0].i = 0.0; >

Re: [Rd] Jazzing up the Task Views index page

2012-02-21 Thread Berend Hasselman
On 21-02-2012, at 13:58, Barry Rowlingson wrote: > A little while ago here we had a short discussion about Task Views - I > think ignited by someone saying 'how many times do I have to say "have > you read the Optimisation Task View?"?' and I poured some fuel on that > fire by saying "Task Views"