Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Jan 10, 2025
1 parent ed9da5c commit 488431f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
10 changes: 8 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ using BlockSparseArrays: BlockSparseArrays
using Documenter: Documenter, DocMeta, deploydocs, makedocs

DocMeta.setdocmeta!(
BlockSparseArrays, :DocTestSetup, :(using BlockSparseArrays); recursive=true
BlockSparseArrays,
:DocTestSetup,
quote
using BlockSparseArrays
using LinearAlgebra: Diagonal
end;
recursive=true,
)

include("make_index.jl")
Expand All @@ -16,7 +22,7 @@ makedocs(;
edit_link="main",
assets=String[],
),
pages=["Home" => "index.md"],
pages=["Home" => "index.md", "Library" => "library.md"],
)

deploydocs(;
Expand Down
5 changes: 5 additions & 0 deletions docs/src/library.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Library

```@autodocs
Modules = [BlockSparseArrays]
```
24 changes: 12 additions & 12 deletions src/factorizations/svd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ julia> A = [1. 0. 0. 0. 2.; 0. 0. 3. 0. 0.; 0. 0. 0. 0. 0.; 0. 2. 0. 0. 0.]
0.0 0.0 0.0 0.0 0.0
0.0 2.0 0.0 0.0 0.0
julia> F = svd(A)
SVD{Float64, Float64, Matrix{Float64}, Vector{Float64}}
julia> F = BlockSparseArrays.svd(A)
BlockSparseArrays.SVD{Float64, Float64, Matrix{Float64}, Vector{Float64}, Matrix{Float64}}
U factor:
4×4 Matrix{Float64}:
0.0 1.0 0.0 0.0
1.0 0.0 0.0 0.0
0.0 0.0 0.0 1.0
0.0 0.0 -1.0 0.0
0.0 1.0 0.0 0.0
1.0 0.0 0.0 0.0
0.0 0.0 0.0 -1.0
0.0 0.0 1.0 0.0
singular values:
4-element Vector{Float64}:
3.0
Expand All @@ -49,10 +49,10 @@ singular values:
0.0
Vt factor:
4×5 Matrix{Float64}:
-0.0 0.0 1.0 -0.0 0.0
0.447214 0.0 0.0 0.0 0.894427
0.0 -1.0 0.0 0.0 0.0
0.0 0.0 0.0 1.0 0.0
-0.0 0.0 1.0 -0.0 0.0
0.447214 0.0 0.0 0.0 0.894427
-0.0 1.0 0.0 -0.0 0.0
0.0 0.0 0.0 1.0 0.0
julia> F.U * Diagonal(F.S) * F.Vt
4×5 Matrix{Float64}:
Expand Down Expand Up @@ -181,7 +181,7 @@ number of singular values.
```jldoctest
julia> A = rand(4,3);
julia> F = svd(A); # Store the Factorization Object
julia> F = BlockSparseArrays.svd(A); # Store the Factorization Object
julia> A ≈ F.U * Diagonal(F.S) * F.Vt
true
Expand All @@ -191,7 +191,7 @@ julia> U, S, V = F; # destructuring via iteration
julia> A ≈ U * Diagonal(S) * V'
true
julia> Uonly, = svd(A); # Store U only
julia> Uonly, = BlockSparseArrays.svd(A); # Store U only
julia> Uonly == U
true
Expand Down

0 comments on commit 488431f

Please sign in to comment.