Skip to content

Fix doctests #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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