|
2 | 2 |
|
3 | 3 | A linear system $$Au=b$$ is specified by defining an `AbstractMatrix` or `AbstractSciMLOperator`.
|
4 | 4 | For the sake of simplicity, this tutorial will start by only showcasing concrete matrices.
|
| 5 | +And specifically, we will start by using the basic Julia `Matrix` type. |
5 | 6 |
|
6 |
| -The following defines a matrix and a `LinearProblem` which is subsequently solved |
| 7 | +The following defines a `Matrix` and a `LinearProblem` which is subsequently solved |
7 | 8 | by the default linear solver.
|
8 | 9 |
|
9 | 10 | ```@example linsys1
|
@@ -57,15 +58,36 @@ sol = solve(prob, KrylovJL_GMRES()) # Choosing algorithms is done the same way
|
57 | 58 | sol.u
|
58 | 59 | ```
|
59 | 60 |
|
60 |
| -Similerly structure matrix types, like banded matrices, can be provided using special matrix |
| 61 | +Similarly structure matrix types, like banded matrices, can be provided using special matrix |
61 | 62 | types. While any `AbstractMatrix` type should be compatible via the general Julia interfaces,
|
62 | 63 | LinearSolve.jl specifically tests with the following cases:
|
63 | 64 |
|
64 |
| -* [BandedMatrices.jl](https://github.com/JuliaLinearAlgebra/BandedMatrices.jl) |
65 |
| -* [BlockDiagonals.jl](https://github.com/JuliaArrays/BlockDiagonals.jl) |
66 |
| -* [CUDA.jl](https://cuda.juliagpu.org/stable/) (CUDA GPU-based dense and sparse matrices) |
67 |
| -* [FastAlmostBandedMatrices.jl](https://github.com/SciML/FastAlmostBandedMatrices.jl) |
68 |
| -* [Metal.jl](https://metal.juliagpu.org/stable/) (Apple M-series GPU-based dense matrices) |
| 65 | + - [LinearAlgebra.jl](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/) |
| 66 | + |
| 67 | + + Symmetric |
| 68 | + + Hermitian |
| 69 | + + UpperTriangular |
| 70 | + + UnitUpperTriangular |
| 71 | + + LowerTriangular |
| 72 | + + UnitLowerTriangular |
| 73 | + + SymTridiagonal |
| 74 | + + Tridiagonal |
| 75 | + + Bidiagonal |
| 76 | + + Diagonal |
| 77 | + |
| 78 | + - [BandedMatrices.jl](https://github.com/JuliaLinearAlgebra/BandedMatrices.jl) `BandedMatrix` |
| 79 | + - [BlockDiagonals.jl](https://github.com/JuliaArrays/BlockDiagonals.jl) `BlockDiagonal` |
| 80 | + - [CUDA.jl](https://cuda.juliagpu.org/stable/) (CUDA GPU-based dense and sparse matrices) `CuArray` (`GPUArray`) |
| 81 | + - [FastAlmostBandedMatrices.jl](https://github.com/SciML/FastAlmostBandedMatrices.jl) `FastAlmostBandedMatrix` |
| 82 | + - [Metal.jl](https://metal.juliagpu.org/stable/) (Apple M-series GPU-based dense matrices) `MetalArray` |
| 83 | + |
| 84 | +!!! note |
| 85 | + |
| 86 | + |
| 87 | +Choosing the most specific matrix structure that matches your specific system will give you the most performance. |
| 88 | +Thus if your matrix is symmetric, specifically building with `Symmetric(A)` will be faster than simply using `A`, |
| 89 | +and will generally lead to better automatic linear solver choices. Note that you can also choose the type for `b`, |
| 90 | +but generally a dense vector will be the fastest here and many solvers will not support a sparse `b`. |
69 | 91 |
|
70 | 92 | ## Using Matrix-Free Operators
|
71 | 93 |
|
|
0 commit comments