bugGNU Scientific Library - Bugs: bug #42472, gsl_linalg_HH_solve bugs


You are not allowed to post comments on this tracker with your current authentication level.

bug #42472: gsl_linalg_HH_solve bugs

Submitted by:  Patrick Alken <psa>
Submitted on:  Sat 31 May 2014 02:02:04 AM UTC  
Category: Runtime errorSeverity: 3 - Normal
Operating System: Status: None
Assigned to: NoneOpen/Closed: Open

Sat 31 May 2014 02:03:34 AM UTC, comment #1:

reported by dunlucky1 =at= gmail.com

Patrick Alken <psa>
Project Administrator
Sat 31 May 2014 02:02:04 AM UTC, original submission:

I think there is a bug in the Linear Algebra Householder solver for the
problem Ax = b. The function gsl_linalg_HH_svx incorrectly calls an over
determined system under determined (and vice versa). Looking in to the
code I see that the dimensions are mixed up such that the code will only
work correctly for a square matrix and not for the over determined case.

I've written a test case based on the expected output from case 4 from
that is attached.

I've also attached a patch file that will fix the problem for
gsl_linalg_HH_svx (apply with patch linalg/hh.c < gsl_linalg_hh.c.patch).

Looking at the code there is a bigger problem with the function
gsl_linalg_HH_solve which assumes that the length of the vector b and the
length of the vector x (in Ax = b) are equal, copying the data from b in to
x before passing this to the function gsl_linalg_HH_svx. This is only true
in a square case and in the over determined case x will have less elements
than b, such that this copy can't be done. The solution to this problem is
harder (probably allocate a working array of size M the length of b, and
copy vector b there and then copy the first N elements out in to x ...
using standard notation of A being an M x N matrix). Anyway, I've left
that alone.


Patrick Alken <psa>
Project Administrator


Attached Files
file #31474:  gsl_hh_test.c added by psa (718B - text/x-csrc)
file #31475:  gsl_linalg_hh.c.patch added by psa (743B - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by psa (Submitted the item)

    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 31 May 2014 02:02:04 AM UTCpsaAttached File-=>Added gsl_hh_test.c, #31474
      Attached File-=>Added gsl_linalg_hh.c.patch, #31475

    Back to the top

    Powered by Savane 3.1-cleanup1