From ripley at stats.ox.ac.uk  Fri Jul 18 09:45:23 2003
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri Jul 18 09:45:47 2003
Subject: [Rd] (PR#2867)
In-Reply-To: <x2u19k66bk.fsf@biostat.ku.dk>
Message-ID: <Pine.LNX.4.44.0307180843360.6655-100000@gannet.stats>

On 18 Jul 2003, Peter Dalgaard BSA wrote:

> richard.roger@agric.nsw.gov.au writes:
> 
> > 
> > As an R novice, I am puzzled that the call to dgeqp3 has more arguments 
> > than dgeqp3 itself.  The call has an extra argument "rwork".  But this 
> > could explain the strange error code!
> > 
> > The call:
> > 
> >     F77_CALL(dgeqp3)(&m, &n, REAL(A), &m, INTEGER(jpvt), REAL(tau),
> >                      &tmp, &lwork, rwork, &info);
> > 
> > The subroutine:
> >       SUBROUTINE DGEQP3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO )
> 
> I don't think you need to be a novice to be puzzled by that one...
> The extra argument would likely cause info not to be modified, and
> being uninitialized it can contain random garbage, quite possibly < 0. 
> 
> But what was the allocation of rwork supposed to be good for then??

It is needed for the complex version of qr(), and I failed to notice the 
difference in the calls when producing the real version with LAPACK=TRUE.

Fixed now.

-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] (PR#2867)
Prof Brian Ripley