I need to solve to solve a "large" symmetric sparse linear systems, with matrix size 8000?

I heard about HSL, ITPACK, but I don't know how to use them, and I am working in C language.

  • $\begingroup$ Welcome to SciComp.Exchange. If you want help it is better to explain more about your problem. What is the size of the matrix $8000\times8000$ or $80\times100$? What is the problem that origin this matrix? $\endgroup$ – nicoguaro Sep 28 '15 at 21:09
  • $\begingroup$ The matrix is symmetric sparse and the size is 8000X8000 .. i want to solve that linear system. in C language. $\endgroup$ – ahmed baba Sep 28 '15 at 22:15

You haven't told us whether your matrix is positive definite or not- this is a very important factor in selecting a solver. You also haven't told us whether the matrix is well conditioned or poorly conditioned. A third important question is whether you need a fairly accurate solution (e.g. accurate to 10 digits) or whether a less accurate solution (e.g. accurate to 4 or 5 digits) would be acceptable.

However, for matrices of this small size (8,000 by 8,000 is quite small by contemporary standards) you should probably be using a direct factorization method rather than an iterative method. Furthermore, unless you have a lot of these systems to solve it probably isn't worth the added programming effort to use a sparse direct factorization method. Thus I'd suggest storing the matrix in dense form and using LAPACK (and in particular because of its C language bindings the CLAPACK package) to solve your system of equations.

If you're willing to invest somewhat more time and effort in coding this, and if you're concerned about the performance of the dense matrix implementation then you might consider using the sparse direct factorization approach as implemented (for example) in the SuiteSparse package written by Timothy Davis.

  • $\begingroup$ Thank Professor Brian Borchers for your answer my matrix is sparse and it dificull to determine if it is positive definite or not, because its change every time,but the one goal is to solve the linear systems with fairly accurate solution or less accurate is also accepteble , i tried with small size lapack directly without saving the matrix in dense format and its okay but if i increase the size, or recalculate the solution manyy time the pc get almost blocked... chould i store the matrix befor cal lapack ??? $\endgroup$ – ahmed baba Sep 27 '15 at 15:43
  • $\begingroup$ @ahmedbaba, I don't see how you could have called LAPACK without storing the matrix. What exactly did you do? $\endgroup$ – Bill Barth Sep 27 '15 at 18:47
  • $\begingroup$ i mean that i didn't change the sparse matrix to dense format just write the matrix in fortran matrix storage and after that i call lapack routine directly to solve the system from C. $\endgroup$ – ahmed baba Sep 27 '15 at 18:52
  • $\begingroup$ If you need to solve many such systems with different entries in the matrix then you should probably consider using a sparse factorization routine. $\endgroup$ – Brian Borchers Sep 27 '15 at 19:18
  • $\begingroup$ okay and how can i storing the sparse matrix in dense form and using LAPACK ?? may that what i'm missing!!!!!! $\endgroup$ – ahmed baba Sep 27 '15 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.