Skip to content

Commit

Permalink
Merge pull request #31 from JuliaLinearAlgebra/an/docs
Browse files Browse the repository at this point in the history
Fix doctests
  • Loading branch information
andreasnoack authored May 18, 2021
2 parents 8745c05 + ce248c3 commit 34e85bc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 25 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ jobs:
Pkg.instantiate()'
- run: |
julia --project=docs -e '
using Documenter: doctest
using Documenter: doctest, DocMeta
using TSVD
DocMeta.setdocmeta!(
TSVD,
:DocTestSetup,
:(using TSVD, MatrixDepot; matrixdepot("LPnetlib/lp_osa_30"));
recursive=true)
doctest(TSVD)'
- run: julia --project=docs docs/make.jl
env:
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ MatrixDepot = "b51810bb-c9f3-55da-ae3c-350fc1fbce05"

[compat]
Documenter = "0.25"
MatrixDepot = "0.8"
MatrixDepot = "1"
8 changes: 6 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
push!(LOAD_PATH,"../src/")

using Documenter, TSVD

DocMeta.setdocmeta!(
TSVD,
:DocTestSetup,
:(using TSVD, MatrixDepot; matrixdepot("LPnetlib/lp_osa_30"));
recursive=true)

makedocs(sitename="TSVD Documentation")

deploydocs(
Expand Down
24 changes: 3 additions & 21 deletions src/svd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,31 +318,13 @@ The output of the procesure it the truple tuple `(U, s, V)`
```jldoctest
julia> A = matrixdepot("LPnetlib/lp_osa_30")
4350×104374 SparseArrays.SparseMatrixCSC{Float64,Int64} with 604488 stored entries:
[1 , 1] = 1.0
[2 , 2] = 1.0
[3 , 3] = 1.0
[4 , 4] = 1.0
[5 , 5] = 1.0
[6 , 6] = 1.0
[7 , 7] = 1.0
[8 , 8] = 1.0
[9 , 9] = 1.0
[4343 , 104373] = 1.0
[4348 , 104373] = 1.0
[4349 , 104373] = 4.5314
[4268 , 104374] = 1.0
[4285 , 104374] = 3.1707
[4319 , 104374] = 3.1707
[4340 , 104374] = 1.0
[4348 , 104374] = 1.0
[4349 , 104374] = 3.1707
4350×104374 SparseArrays.SparseMatrixCSC{Float64, Int64} with 604488 stored entries:
⠙⠮⠷⠶⠽⠶⠽⠶⠮⠷⠮⠷⠶⠽⠶⠽⠶⠬⠷⠮⠷⠦⠽⠶⠽⠶⠽⠶⠮⠷⠮⠷⠶⠽⠶⠽⠶⠭⠷⠦
julia> U, s, V = tsvd(A, 5);
julia> round.(s, digits=7)
5-element Array{Float64,1}:
5-element Vector{Float64}:
1365.8944098
1033.2125634
601.3524529
Expand Down

0 comments on commit 34e85bc

Please sign in to comment.