Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for testing matrices/systems for iterative linear solver

I am currently working on a C++-based library for large, sparse linear algebra problems (yes, I know many such libraries exist, but I'm rolling my own mostly to learn about iterative solvers, sparse storage containers, etc..).

I am to the point where I am using my solvers within other programming projects of mine, and would like to test the solvers against problems that are not my own. Primarily, I am looking to test against symmetric sparse systems that are positive definite. I have found several sources for such system matrices such as:

Matrix Market UF Sparse Matrix Collection

That being said, I have not yet found any sources of good test matrices that include the entire system- system matrix and RHS. This would be great to have in order to check results. Any tips on where I can find such full systems, or alternatively, what I might do to generate a "good" RHS for the system matrices I can get online? I am currently just filling a matrix with random values, or all ones, but suspect that this is not necessarily the best way.

like image 703
MarkD Avatar asked Dec 01 '10 19:12

MarkD


1 Answers

I would suggest using a right-hand-side vector obtained from a predefined 'goal' solution x:

b = A*x

Then you have a goal solution, x, and a resulting solution, x, from the solver. This means you can compare the error (difference of the goal and resulting solutions) as well as the residuals (A*x - b).

Note that for careful evaluation of an iterative solver you'll also need to consider what to use for the initial x.

The online collections of matrices primarily contain the left-hand-side matrix, but some do include right-hand-sides and also some have solution vectors too.:

http://www.cise.ufl.edu/research/sparse/matrices/rhs.txt

By the way, for the UF sparse matrix collection I'd suggest this link instead:

http://www.cise.ufl.edu/research/sparse/matrices/

like image 93
Paul Thompson Avatar answered Oct 19 '22 19:10

Paul Thompson