-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
185 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#gh-pages-Branch | ||
|
||
name: DocPreviewCleanup | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
doc-preview-cleanup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout gh-pages branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: gh-pages | ||
- name: Delete preview and history + push changes | ||
run: | | ||
if [ -d "previews/PR$PRNUM" ]; then | ||
git config user.name "Documenter.jl" | ||
git config user.email "documenter@juliadocs.github.io" | ||
git rm -rf "previews/PR$PRNUM" | ||
git commit -m "delete preview" | ||
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) | ||
git push --force origin gh-pages-new:gh-pages | ||
fi | ||
env: | ||
PRNUM: ${{ github.event.number }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,134 @@ | ||
#--------------------------------------------------------- | ||
# # [SpecialMatrices overview](@id 1-overview) | ||
#--------------------------------------------------------- | ||
#= | ||
# [SpecialMatrices overview](@id 1-overview) | ||
# This page illustrates the Julia package | ||
# [`SpecialMatrices`](https://github.com/JuliaLinearAlgebra/SpecialMatrices.jl). | ||
This page illustrates the Julia package | ||
[`SpecialMatrices`](https://github.com/JuliaLinearAlgebra/SpecialMatrices.jl). | ||
This package extends the `LinearAlgebra` library | ||
with support for special matrices that are used in linear algebra. | ||
Every special matrix has its own type | ||
and is stored efficiently. | ||
Use `Matrix(A)` to access the full matrix if needed. | ||
## Related packages | ||
[ToeplitzMatrices.jl](https://github.com/JuliaLinearAlgebra/ToeplitzMatrices.jl) | ||
supports | ||
Toeplitz, Hankel, and circulant matrices. | ||
=# | ||
|
||
# ### Setup | ||
|
||
# Packages needed here. | ||
|
||
using SpecialMatrices | ||
using Polynomials | ||
|
||
|
||
# ## [`Cauchy` matrix](http://en.wikipedia.org/wiki/Cauchy_matrix) | ||
|
||
Cauchy(1:3, 2:4) | ||
|
||
# | ||
Cauchy((1., 2.), 1:3) | ||
|
||
# | ||
Cauchy(3) | ||
|
||
|
||
# ## [`Companion` matrix](http://en.wikipedia.org/wiki/Companion_matrix) | ||
|
||
Companion(1:3) | ||
|
||
# From a polynomial | ||
p = Polynomial(4:-1:1) | ||
|
||
# | ||
Companion(p) | ||
|
||
|
||
# ## [`Frobenius` matrix](http://en.wikipedia.org/wiki/Frobenius_matrix) | ||
|
||
F = Frobenius(3, 2:4) # Specify subdiagonals of column 3 | ||
|
||
# Special form of inverse: | ||
inv(F) | ||
|
||
# Special form preserved if the same column has the subdiagonals | ||
F * F | ||
|
||
# Otherwise it promotes to a `Matrix`: | ||
F * Frobenius(2, 2:5) | ||
|
||
# Efficient matrix-vector multiplication: | ||
F * (1:6) | ||
|
||
|
||
# ## [`Hilbert` matrix](http://en.wikipedia.org/wiki/Hilbert_matrix) | ||
|
||
H = Hilbert(5) | ||
|
||
# Inverses are also integer matrices: | ||
inv(H) | ||
|
||
|
||
#= | ||
## [`Kahan` matrix](http://math.nist.gov/MatrixMarket/data/MMDELI/kahan/kahan.html) | ||
See [N. J. Higham (1987)](https://doi.org/10.1137/1029112). | ||
=# | ||
|
||
|
||
Kahan(5, 5, 1, 35) | ||
|
||
# | ||
Kahan(5, 3, 0.5, 0) | ||
|
||
# | ||
Kahan(3, 5, 0.5, 1e-3) | ||
|
||
#= | ||
## `Riemann` matrix | ||
A Riemann matrix is defined as | ||
`A = B[2:N+1, 2:N+1]`, | ||
where | ||
`B[i,j] = i-1` if `i` divides `j`, and `-1` otherwise. | ||
The [Riemann hypothesis](http://en.wikipedia.org/wiki/Riemann_hypothesis) | ||
holds if and only if | ||
`det(A) = O( N! N^(-1/2+ϵ))` for every `ϵ > 0`. | ||
See | ||
[F. Roesler (1986)](https://doi.org/10.1016/0024-3795(86)90255-7). | ||
=# | ||
|
||
Riemann(5) | ||
|
||
|
||
#= | ||
## [`Strang` matrix](http://doi.org/10.1137/141000671) | ||
A special symmetric, tridiagonal, Toeplitz matrix named after Gilbert Strang. | ||
=# | ||
|
||
Strang(5) | ||
|
||
# ## [`Vandermonde` matrix](http://en.wikipedia.org/wiki/Vandermonde_matrix) | ||
|
||
a = 1:4 | ||
V = Vandermonde(a) | ||
|
||
# Adjoint Vandermonde: | ||
|
||
V' | ||
|
||
# ### Cauchy | ||
#= | ||
The backslash operator `\` is overloaded | ||
to solve Vandermonde and adjoint Vandermonde systems | ||
in ``O(n^2)`` time using the algorithm of | ||
[Björck & Pereyra (1970)](https://doi.org/10.2307/2004623). | ||
=# | ||
V \ a | ||
|
||
Cauchy(collect(1:3), collect(2:4)) | ||
# | ||
V' \ V[3,:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters