bugGNU Octave - Bugs: bug #34953, Bug with qrdelete

 
 

bug #34953: Bug with qrdelete

Submitter:  Aswin Kannan <aswink>
Submitted:  Wed 30 Nov 2011 04:57:14 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  None
Originator Name:  Aswin Kannan Open/Closed:  * Closed
Release:  * 3.2.4 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 16 Feb 2012 06:30:28 PM UTC, comment #6: 

This bug has been fixed in the qrupdate library and Octave will inherit that fix.  Closing report.

Rik <rik5>
Group administrator
Thu 09 Feb 2012 11:33:18 PM UTC, comment #5: 

Can this bug be closed now that qrupdate-1.1.2 is available?

Rik <rik5>
Group administrator
Tue 07 Feb 2012 09:30:42 PM UTC, comment #4: 

Jaroslav released qrupdate-1.1.2 to
cover the bug.

marco atzeri <matzeri>
Thu 05 Jan 2012 10:44:27 PM UTC, comment #3: 

I built a test arpack package adding the proposed
change from John

--- origsrc/qrupdate-1.1.1/src/dqrder.f 2009-01-09 12:21:34.000000000 +0100
+++ src/qrupdate-1.1.1/src/dqrder.f     2012-01-05 23:26:01.043758100 +0100
@@ -49,7 +49,7 @@ c check arguments
       info = 0
       if (m < 1) then
         info = 1
-      else if (j < 1 .or. j > n) then
+      else if (j < 1 .or. j > m) then
         info = 7
       end if
       if (info /= 0) then

with that the
[Q1,R1] = qrdelete(Q,R,7,'row')

succeeded as expected.

Adding Jaroslav on copy as there is no bug tracker for qrupdate

marco atzeri <matzeri>
Thu 01 Dec 2011 07:51:15 PM UTC, comment #2: 

Thanks a lot John. I thought that the issue was something similar.

I presume that the source files are not distributed with octave (just the ocx files I suppose). Then, for recompilation and fixing this stuff, it would be great if you could let me know how to proceed and whom to contact (or would octave be looking at this?).

Aswin Kannan <aswink>
Thu 01 Dec 2011 09:58:56 AM UTC, comment #1: 

This looks like a bug with the qrupdate package, not Octave itself.  Looking at the source for dqrder here:

http://qrupdate.svn.sourceforge.net/viewvc/qrupdate/src/dqrder.f?revision=1&view=markup

I see


      subroutine dqrder(m,n,Q,ldq,R,ldr,j,w)
...
c arguments:
c m (in)        number of rows of the matrix Q.
c n (in)        number of columns of the matrix R.
c Q (io)        on entry, the orthogonal matrix Q.
c               on exit, the updated matrix Q1.
c ldq (in)      leading dimension of Q. ldq >= m.
c R (io)        on entry, the original matrix R.
c               on exit, the updated matrix R1.
c ldr (in)      leading dimension of R. ldr >= m.
c j (in)        the position of the deleted row.
c w (out)       a workspace vector of size 2*m.
c
...
      if (m < 1) then
        info = 1
      else if (j < 1 .or. j > n) then
        info = 7
      end if
      if (info /= 0) then
        call xerbla('DQRDER',info)
        return
      end if
...


I think that test should be j > m, not j > n.

I fixed the docstring in the following changeset:

hg.savannah.gnu.org/hgweb/octave/rev/62c8205b3fab

John W. Eaton <jwe>
Group administrator
Wed 30 Nov 2011 04:57:14 PM UTC, original submission:  

This pertains to a bug with respect to the function 'qrdelete'.
The version of octave that I'm using is 3.2.4. The operating system that I use is linux-ubuntu-10.10 (maverick).

A sample code fragment is as follows:

A = randn(7,5); [Q,R] = qr(A);
[Q1,R1] = qrdelete(Q,R,7,'row');

The error that I get is as follows: 

** On entry to DQRDER parameter number  7 had an illegal value
error: exception encountered in Fortran subroutine dqrder_

I think that this is a bug, since I get the same error when I try to delete a row from a
factorization with m > n (m being the number of rows and n being the number of columns -- Q is of dimension m x m and R is of dimension m x n). I did try on both 32 and 64 bit versions
of linux and I get the same error.

Also there is an issue with the help file/ documentation with qrdelete:
Typing 'help qrdelete' gives me the following (partly shown below):

***********
 -- Loadable Function: [Q1, R1] = qrdelete (Q, R, J, ORIENT)
     Given a QR factorization of a real or complex matrix A = Q*R,
     Q unitary and R upper trapezoidal, return the QR factorization of
     [A(:,1:j-1) A(:,j+1:n)], i.e., A with one column deleted (if
     ORIENT is "col"), or the QR factorization of
     [A(1:j-1,:);A(:,j+1:n)], i.e., A with one row deleted (if ORIENT
     is "row").

*************
*************

In the line before the last "[A(1:j-1,:);A(:,j+1:n)]" it should be
[A(1:j-1,:);A(j+1:n,:)]

I presume the error is due to something similar with j > n (Consider a matrix A -- m x n -- the operation should be with m and not n).

Aswin Kannan <aswink>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by matzeri (Posted a comment)
  • -email is unavailable- added by matzeri
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by aswink (Submitted the item)
  • -email is unavailable- added by aswink
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-02-16 rik5 Open/ClosedOpen Closed
    2012-01-05 matzeri Carbon-Copy- Added -email is unavailable-
    2011-11-30 aswink Carbon-Copy- Added aswink

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code