This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: linear system problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]