Difference between revisions of "Solving sparse systems"

From Medusa: Coordinate Free Mehless Method implementation
Jump to: navigation, search
Line 18: Line 18:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Header 1
+
! Matlab
! Header 2
+
! Mathematica
! Header 3
+
! Eigen
 
|-
 
|-
| row 1, cell 1
+
! Row header 1
 
| row 1, cell 2
 
| row 1, cell 2
 
| row 1, cell 3
 
| row 1, cell 3
 
|-
 
|-
| row 2, cell 1
+
! Row header 2
 
| row 2, cell 2
 
| row 2, cell 2
 
| row 2, cell 3
 
| row 2, cell 3
 
|}
 
|}

Revision as of 13:55, 15 March 2017

There are many methods available for solving sparse systems. We compare some of them here.

Mathematica has the following methods available (https://reference.wolfram.com/language/ref/LinearSolve.html#DetailsAndOptions)

  • direct: banded, cholesky, multifrontal (direct sparse LU)
  • iterative: Krylov

Matlab has the following methods:

Eigen has the following methods: (https://eigen.tuxfamily.org/dox-devel/group__TopicSparseSystems.html)

  • direct: sparse LU
  • iterative: bicgstab, cg

Solving a simple sparse system $A x = b$ with $A = \begin{bmatrix} 1 & 1 & \\ 1 & \ddots & \ddots \\ & \ddots & \end{bmatrix}$ and $b = \begin{bmatrix} 1 \\ \vdots \\ 1 \end{bmatrix}$ with dimension $n$ has the following timings:

Matlab Mathematica Eigen
Row header 1 row 1, cell 2 row 1, cell 3
Row header 2 row 2, cell 2 row 2, cell 3