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..0bfcb93c 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