From 48abb608330c7d8f06b2b98652196c98c52b9800 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Thu, 16 Apr 2020 16:38:08 -0400 Subject: [PATCH 1/2] Add BlockDiagonalOperator and TimedLinearOperator in the documentation --- README.md | 1 + docs/make.jl | 13 ++++--------- docs/src/index.md | 2 ++ docs/src/reference.md | 2 ++ src/TimedOperators.jl | 5 +++++ src/special-operators.jl | 10 ++++++++++ 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2142dd1b..8d288fc8 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Operator | Description `LinearOperator` | Base class. Useful to define operators from functions `PreallocatedLinearOperator` | Linear operator with preallocated storage for products `TimedLinearOperator` | Linear operator instrumented with timers from [`TimerOutputs`](https://github.com/KristofferC/TimerOutputs.jl) +`BlockDiagonalOperator`| Block-diagonal linear operator `opEye` | Identity operator `opOnes` | All ones operator `opZeros` | All zeros operator diff --git a/docs/make.jl b/docs/make.jl index 5d532fdb..2f8724ef 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,20 +1,15 @@ -using Documenter -using LinearOperators +using Documenter, LinearOperators makedocs( modules = [LinearOperators], doctest = true, + linkcheck = true, strict = true, - assets = ["assets/style.css"], - format = Documenter.HTML(), + format = Documenter.HTML(assets = ["assets/style.css"], prettyurls = get(ENV, "CI", nothing) == "true"), sitename = "LinearOperators.jl", pages = Any["Home" => "index.md", "Tutorial" => "tutorial.md", "Reference" => "reference.md"] ) -deploydocs(deps = nothing, make = nothing, - repo = "github.com/JuliaSmoothOptimizers/LinearOperators.jl.git", - target = "build", - devbranch = "master" -) +deploydocs(repo = "github.com/JuliaSmoothOptimizers/LinearOperators.jl.git") diff --git a/docs/src/index.md b/docs/src/index.md index b486d54f..baa55f3d 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -21,6 +21,8 @@ Operator | Description -----------------------------|------------ `LinearOperator` | Base class. Useful to define operators from functions `PreallocatedLinearOperator` | Define operators with preallocation for efficient use of memory +`TimedLinearOperator` | Linear operator instrumented with timers from [`TimerOutputs`](https://github.com/KristofferC/TimerOutputs.jl) +`BlockDiagonalOperator` | Block-diagonal linear operator `opEye` | Identity operator `opOnes` | All ones operator `opZeros` | All zeros operator diff --git a/docs/src/reference.md b/docs/src/reference.md index b35f7118..b9de96b2 100644 --- a/docs/src/reference.md +++ b/docs/src/reference.md @@ -3,6 +3,8 @@ ```@docs LinearOperator PreallocatedLinearOperator +TimedLinearOperator +BlockDiagonalOperator opEye opOnes opZeros diff --git a/src/TimedOperators.jl b/src/TimedOperators.jl index 3b4ec174..c7d48e8c 100644 --- a/src/TimedOperators.jl +++ b/src/TimedOperators.jl @@ -10,6 +10,11 @@ mutable struct TimedLinearOperator{T} <: AbstractLinearOperator{T} ctprod end +""" + TimedLinearOperator(op) + +Creates a linear operator instrumented with timers from TimerOutputs. +""" function TimedLinearOperator(op::AbstractLinearOperator{T}) where T timer = TimerOutput() prod(x) = @timeit timer "prod" op.prod(x) diff --git a/src/special-operators.jl b/src/special-operators.jl index 7f1eb2da..f7a0c973 100644 --- a/src/special-operators.jl +++ b/src/special-operators.jl @@ -186,6 +186,16 @@ end eltypeof(op::AbstractLinearOperator) = eltype(op) # need this for promote_eltypeof +""" + BlockDiagonalOperator(M1, M2, ..., Mn) + +Creates a block-diagonal linear operator: + + [ M1 ] + [ M2 ] + [ ... ] + [ Mn ] +""" function BlockDiagonalOperator(ops...) nrow = ncol = 0 for op ∈ ops From 06d1956e501ccaa43d281e5295d3f69431a25d4f Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Thu, 16 Apr 2020 18:24:28 -0400 Subject: [PATCH 2/2] Remove linkcheck --- docs/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index 2f8724ef..0bfcb93c 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -3,7 +3,7 @@ using Documenter, LinearOperators makedocs( modules = [LinearOperators], doctest = true, - linkcheck = true, + # linkcheck = true, strict = true, format = Documenter.HTML(assets = ["assets/style.css"], prettyurls = get(ENV, "CI", nothing) == "true"), sitename = "LinearOperators.jl",