Skip to content

qr(x,LAPACK=TRUE) (PR#2867)

2 messages · Simon Wood, Brian Ripley

#
Hi, 

I think there is a problem with the LAPACK version of qr() in version
1.7.0. (version below).

1. The documentation states that LAPACK=TRUE is the default, but the code
has LAPACK=FALSE.

2. With LAPACK=TRUE qr() is never pivoting, even in cases where it very
clearly should be. e.g.

set.seed(0)
X<-matrix(rnorm(40),10,4);X[,1]<-X[,2]
qrx<-qr(X,LAPACK=TRUE)
qrx$pivot # note, no pivoting
qr.R(qrx) # note zero on leading diagonal is not in trailing block

3. ?qr includes the statement:

Using LAPACK (including in the complex case) uses column pivoting

4. If I call F77_NAME(dgeqp3) directly I get correct pivoting.

platform i686-pc-linux-gnu
arch     i686             
os       linux-gnu        
system   i686, linux-gnu  
status                    
major    1                
minor    7.0              
year     2003             
month    04               
day      16               
language R     

Apologies if I'm doing something dumb, but I can't see what it is at the
moment.

best,
Simon

_____________________________________________________________________
#
Thanks for this.
On Mon, 28 Apr 2003 simon@stats.gla.ac.uk wrote:

            
The code is the intended. Originally I intended to change the default, but 
discovered that quite a bit of code depended on the (generous) tolerance 
in the previous qr, not least to determine the rank.
Well, it did pivot sometimes.  I had assumed that jpvt was zeroed, but it
was not guaranteed.  In fact I got pivoting sometimes in your example,
which threw me for a while.  It is now explicitly zeroed in R-patched, and
seems to be solved.