Follow-up Comment #1, bug #52540 (project gsl):

Hi,

The function gsl_linalg_complex_householder_hv(tau, v, w) [apply the
Householder transform defined by (tau, v) to the vector w] does not
check for the mildly pathological case where length of the involved
vectors is 1. In this case, a subvector()-call in the code cannot be
executed as it exceeds the index limits and the code breaks.

I encountered this problem when implementing the QR decomposition for
complex-valued matrices.


In the real-valued case, a vector of length 1 results in tau=0 when
calculating the HH transform using gsl_linalg_householder_transform()
and the corresponding function gsl_linalg_househoulder_hv() explicitly
checks for tau=0 and exits in this case.

In the complex-valued case, the HH transform of a vector of length 1
does *not* necessarily imply tau=0 which is why the case N=1 has to be
handled separately in gsl_linalg_complex_householder_hv().


I have attached a patch for linalg/householdercomplex.c which handles
the N=1 case.

To be patched against GSL 2.4; I have cloned the github repository a few
days ago. As that's my first patch, please let me know if I need to
provide anything else or if a different format would be better.

Christian

(file #42506)
    _______________________________________________________

Additional Item Attachment:

File name: patch_householdercomplex.c     Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52540>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


Reply via email to