Skip to content

Bump Documenter version to v1+ #215

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 6 commits into from
Sep 27, 2023
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "LinearMaps"
uuid = "7a12625a-238d-50fd-b39a-03d52299707e"
version = "3.11.0"
version = "3.11.1"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"

[compat]
BenchmarkTools = "1"
Documenter = "0.25, 0.26, 0.27"
Documenter = "1"
Literate = "2"
5 changes: 3 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Literate.markdown(joinpath(@__DIR__, "src", "custom.jl"), joinpath(@__DIR__, "sr

makedocs(
sitename = "LinearMaps.jl",
format = Documenter.HTML(),
modules = [LinearMaps],
modules = [LinearMaps,
isdefined(Base, :get_extension) ? Base.get_extension(LinearMaps, :LinearMapsSparseArraysExt) :
LinearMaps.LinearMapsSparseArraysExt],
pages = Any[
"Home" => "index.md",
"Version history" => "history.md",
Expand Down
10 changes: 10 additions & 0 deletions docs/src/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Type for representing a scalar multiple of any `LinearMap` type. A
objects are multiplied by real or complex scalars from the left or from the
right.

```@docs
LinearMaps.ScaledMap
```

### `UniformScalingMap`

Type for representing a scalar multiple of the identity map (a.k.a. uniform
Expand Down Expand Up @@ -98,6 +102,12 @@ Base.hcat
Base.vcat
Base.hvcat
Base.cat
```

With `using SparseArrays`, yet another method is available for creating lazy block-diagonal
maps.

```@docs
SparseArrays.blockdiag
```

Expand Down
20 changes: 8 additions & 12 deletions src/LinearMaps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ Compute the action of the linear map `A` on the vector `x`.
julia> A=LinearMap([1.0 2.0; 3.0 4.0]); x=[1.0, 1.0];

julia> A*x
2-element Array{Float64,1}:
2-element Vector{Float64}:
3.0
7.0

julia> A(x)
2-element Array{Float64,1}:
2-element Vector{Float64}:
3.0
7.0
```
Expand All @@ -147,17 +147,13 @@ with either `A` or `B`.

## Examples
```jldoctest; setup=(using LinearAlgebra, LinearMaps)
julia> A=LinearMap([1.0 2.0; 3.0 4.0]); B=ones(2); Y = similar(B); mul!(Y, A, B);

julia> Y
2-element Array{Float64,1}:
julia> A = LinearMap([1.0 2.0; 3.0 4.0]); B = ones(2); Y = similar(B); mul!(Y, A, B)
2-element Vector{Float64}:
3.0
7.0

julia> A=LinearMap([1.0 2.0; 3.0 4.0]); B=ones(4,4); Y = similar(B); mul!(Y, A, B);

julia> Y
2×2 Array{Float64,2}:
julia> A = LinearMap([1.0 2.0; 3.0 4.0]); B = ones(2,2); Y = similar(B); mul!(Y, A, B)
2×2 Matrix{Float64}:
3.0 3.0
7.0 7.0
```
Expand Down Expand Up @@ -211,7 +207,7 @@ julia> mul!(C, A, B, 100.0, 10.0) === C
true

julia> C
2-element Array{Float64,1}:
2-element Vector{Float64}:
310.0
730.0

Expand All @@ -221,7 +217,7 @@ julia> mul!(C, A, B, 100.0, 10.0) === C
true

julia> C
2×2 Array{Float64,2}:
2×2 Matrix{Float64}:
310.0 320.0
730.0 740.0
```
Expand Down
18 changes: 9 additions & 9 deletions src/blockmap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ function _getranges(maps, dim, inds=1:length(maps))
return UnitRange.(starts, ends)
end

"""
rowcolranges(maps, rows)
# """
# rowcolranges(maps, rows)

Determines the range of rows for each block row and the range of columns for each
map in `maps`, according to its position in a virtual matrix representation of the
block linear map obtained from `hvcat(rows, maps...)`.
"""
# Determines the range of rows for each block row and the range of columns for each
# map in `maps`, according to its position in a virtual matrix representation of the
# block linear map obtained from `hvcat(rows, maps...)`.
# """
function rowcolranges(maps, rows)
# find indices of the row-wise first maps
firstmapinds = vcat(1, Base.front(rows)...)
Expand Down Expand Up @@ -75,7 +75,7 @@ julia> CS = LinearMap{Int}(cumsum, 3)::LinearMaps.FunctionMap;
julia> L = [CS LinearMap(ones(Int, 3, 3))]::LinearMaps.BlockMap;

julia> L * ones(Int, 6)
3-element Array{Int64,1}:
3-element Vector{Int64}:
4
5
6
Expand Down Expand Up @@ -110,7 +110,7 @@ julia> CS = LinearMap{Int}(cumsum, 3)::LinearMaps.FunctionMap;
julia> L = [CS; LinearMap(ones(Int, 3, 3))]::LinearMaps.BlockMap;

julia> L * ones(Int, 3)
6-element Array{Int64,1}:
6-element Vector{Int64}:
1
2
3
Expand Down Expand Up @@ -153,7 +153,7 @@ julia> L.rows
(2, 2)

julia> L * ones(Int, 6)
6-element Array{Int64,1}:
6-element Vector{Int64}:
2
4
6
Expand Down
2 changes: 1 addition & 1 deletion src/kronecker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ julia> E = spdiagm(-1 => trues(1)); D = E + E' - 2I;
julia> Δ = kron(D, J) + kron(J, D); # discrete 2D-Laplace operator

julia> Matrix(Δ)
4×4 Array{Int64,2}:
4×4 Matrix{Int64}:
-4 1 1 0
1 -4 0 1
1 0 -4 1
Expand Down
6 changes: 3 additions & 3 deletions src/left.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and return an adjoint vector.
## Examples
```jldoctest; setup=(using LinearAlgebra, LinearMaps)
julia> A=LinearMap([1.0 2.0; 3.0 4.0]); x=[1.0, 1.0]; x'A
1×2 Adjoint{Float64,Array{Float64,1}}:
1×2 adjoint(::Vector{Float64}) with eltype Float64:
4.0 6.0
```
"""
Expand All @@ -31,7 +31,7 @@ and return a transpose vector.
## Examples
```jldoctest; setup=(using LinearAlgebra, LinearMaps)
julia> A=LinearMap([1.0 2.0; 3.0 4.0]); x=[1.0, 1.0]; transpose(x)*A
1×2 Transpose{Float64,Array{Float64,1}}:
1×2 transpose(::Vector{Float64}) with eltype Float64:
4.0 6.0
```
"""
Expand All @@ -52,7 +52,7 @@ either `A` or `B`. The computation `C = A*B` is performed via `C' = B'A'`.
julia> A=[1.0 1.0; 1.0 1.0]; B=LinearMap([1.0 2.0; 3.0 4.0]); C = similar(A); mul!(C, A, B);

julia> C
2×2 Array{Float64,2}:
2×2 Matrix{Float64}:
4.0 6.0
4.0 6.0
```
Expand Down
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -17,6 +18,7 @@ Aqua = "0.5, 0.6, 0.7"
BlockArrays = "0.16"
ChainRulesCore = "1"
ChainRulesTestUtils = "1.9"
Documenter = "1"
Octonions = "0.1, 0.2"
Quaternions = "0.5, 0.6, 0.7"
julia = "1.6"
4 changes: 3 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Test, LinearMaps, Aqua
using Test, Documenter, LinearMaps, Aqua

@testset "code quality" begin
Aqua.test_all(LinearMaps, project_toml_formatting = VERSION≥v"1.7", piracy = (broken=true,))
end

doctest(LinearMaps)

include("linearmaps.jl")

include("transpose.jl")
Expand Down