bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] gsl_linalg_complex_householder_hv() does not handle case N=1 (


From: Christian Krueger
Subject: [Bug-gsl] gsl_linalg_complex_householder_hv() does not handle case N=1 (patch attached)
Date: Mon, 27 Nov 2017 14:59:48 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

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

Attachment: patch_householdercomplex.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]