Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a question regarding linear equation solvers. For a specific 9-diagonal matrix, every method I tried in C++ (Gaus, GCC, BICGTAB) didn't work (even though they worked for other matrices). But in Mathematica, LinearSolve gave a solution for this matrix.

What type of solver does Mathematica use in LinearSolve?

share|improve this question
It is not diagonal matrix how edit gpap but 9-diagonal matrix from FEM discretization. – user7489 Mar 13 '14 at 10:22
up vote 14 down vote accepted

From the Documentation on Numerical Implementation:

  • Machine-precision matrices are typically converted to a special internal representation for processing.
  • SparseArray with rules involving patterns uses cylindrical algebraic decomposition to find connected array components. Sparse arrays are stored internally using compressed sparse row formats, generalized for tensors of arbitrary rank.
  • For dense arrays, LAPACK algorithms extended for arbitrary precision are used when appropriate.
  • BLAS technology is used to optimize for particular machine architectures. LUDecomposition, Inverse, RowReduce, and Det use Gaussian elimination with partial pivoting. LinearSolve uses the same methods, together with adaptive iterative improvement for high-precision numbers.
  • For sparse arrays, LinearSolve uses UMFPACK multifrontal direct solver methods and with Method->"Krylov" uses Krylov iterative methods preconditioned by an incomplete LU factorization. For high-precision numbers, it uses adaptive iterative improvement methods. Eigenvalues and Eigenvectors use ARPACK Arnoldi methods.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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