|
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,33 @@ 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 | | -LinearSolve.jl specifically tests with the following cases: |
63 | | - |
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) |
| 63 | +LinearSolve.jl specifically tests with the following cases: |
| 64 | + |
| 65 | +* [LinearAlgebra.jl](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/) |
| 66 | + * Symmetric |
| 67 | + * Hermitian |
| 68 | + * UpperTriangular |
| 69 | + * UnitUpperTriangular |
| 70 | + * LowerTriangular |
| 71 | + * UnitLowerTriangular |
| 72 | + * SymTridiagonal |
| 73 | + * Tridiagonal |
| 74 | + * Bidiagonal |
| 75 | + * Diagonal |
| 76 | +* [BandedMatrices.jl](https://github.com/JuliaLinearAlgebra/BandedMatrices.jl) `BandedMatrix` |
| 77 | +* [BlockDiagonals.jl](https://github.com/JuliaArrays/BlockDiagonals.jl) `BlockDiagonal` |
| 78 | +* [CUDA.jl](https://cuda.juliagpu.org/stable/) (CUDA GPU-based dense and sparse matrices) `CuArray` (`GPUArray`) |
| 79 | +* [FastAlmostBandedMatrices.jl](https://github.com/SciML/FastAlmostBandedMatrices.jl) `FastAlmostBandedMatrix` |
| 80 | +* [Metal.jl](https://metal.juliagpu.org/stable/) (Apple M-series GPU-based dense matrices) `MetalArray` |
| 81 | + |
| 82 | +!!! note |
| 83 | + |
| 84 | + Choosing the most specific matrix structure that matches your specific system will give you the most performance. |
| 85 | + Thus if your matrix is symmetric, specifically building with `Symmetric(A)` will be faster than simply using `A`, |
| 86 | + and will generally lead to better automatic linear solver choices. Note that you can also choose the type for `b`, |
| 87 | + but generally a dense vector will be the fastest here and many solvers will not support a sparse `b`. |
69 | 88 |
|
70 | 89 | ## Using Matrix-Free Operators |
71 | 90 |
|
|
0 commit comments