Skip to content
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 4 additions & 9 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -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")
2 changes: 2 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/src/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
```@docs
LinearOperator
PreallocatedLinearOperator
TimedLinearOperator
BlockDiagonalOperator
opEye
opOnes
opZeros
Expand Down
5 changes: 5 additions & 0 deletions src/TimedOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions src/special-operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down