This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: linear system problem
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: <e70443 at estudiante dot uam dot es>
- Cc: gsl-discuss at sources dot redhat dot com
- Date: Thu, 29 Jan 2004 19:00:50 +0000
- Subject: Re: linear system problem
- References: <20040129151306.86F47E6A8D@mail.ukfsn.org>
e70443@estudiante.uam.es writes:
> I need to solve the linear system A x = b, where A is a rectangular
> M-by-N matrix, and M > N. Looking the functions of the library, I
> decided to use de QR descomposition. Before any calculation, I
> create the A matrix and b vector view, the 'x' and 'tau' vectors of
> N size, and the 'residual' vector of M size.
> First, I call the function gsl_linalg_QR_decomp() with the matrix
> A and the vector 'tau'. Then I call the gsl_linalg_QR_lssolve()
> function with the arguments A (with the QR descomposition created
> by the previous function), tau, b, x, and residual, to find the
> solution to the linear
> system. I´m almost sure that these equations are correct but the
> solution is not. What should I expect ? My question is; am I
> either using the right functions, or puting them in
> the right order?
> Shall I use another kind of descomposition?
Hi,
Using the method of QR decomposition with lssolve as you describe it
should work. See the program linalg/test.c for the lssolve example in
the test suite.
I would suggest printing out the matrices at each stage and checking
their values to see where the problem is occurring. You can check the
results in GNU Octave, for example.
If you can find a simple case where it fails please post the code as a
bug report to bug-gsl@gnu.org.
regards
--
Brian Gough