Skip to content

Commit c804b06

Browse files
authored
Minor clean-up (#170)
1 parent 0a85665 commit c804b06

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

Project.toml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
name = "LinearMaps"
22
uuid = "7a12625a-238d-50fd-b39a-03d52299707e"
3-
version = "3.5.1"
3+
version = "3.5.2"
44

55
[deps]
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
77
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
88

99
[compat]
1010
julia = "1.6"
11-
12-
[extras]
13-
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
14-
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
15-
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
16-
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
17-
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
18-
Quaternions = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0"
19-
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
20-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
21-
22-
[targets]
23-
test = ["Aqua", "BenchmarkTools", "BlockArrays", "InteractiveUtils", "LinearAlgebra", "Quaternions", "SparseArrays", "Test"]

src/blockmap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ end
496496
function _blockscaling!(y, A::BlockDiagonalMap, x, α, β)
497497
maps, yinds, xinds = A.maps, A.rowranges, A.colranges
498498
# TODO: think about multi-threading here
499-
@views for i in eachindex(yinds, maps, xinds)
499+
@inbounds for i in eachindex(yinds, maps, xinds)
500500
_unsafe_mul!(selectdim(y, 1, yinds[i]), maps[i], selectdim(x, 1, xinds[i]), α, β)
501501
end
502502
return y

src/composition.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function Base.:(*)(α::Number, A::CompositeMap)
6565
end
6666
end
6767
# needed for disambiguation
68-
function Base.:(*)(α::RealOrComplex, A::CompositeMap)
68+
function Base.:(*)(α::RealOrComplex, A::CompositeMap{<:RealOrComplex})
6969
T = Base.promote_op(*, typeof(α), eltype(A))
7070
return ScaledMap{T}(α, A)
7171
end
@@ -83,7 +83,7 @@ function Base.:(*)(A::CompositeMap, α::Number)
8383
end
8484
end
8585
# needed for disambiguation
86-
function Base.:(*)(A::CompositeMap, α::RealOrComplex)
86+
function Base.:(*)(A::CompositeMap{<:RealOrComplex}, α::RealOrComplex)
8787
T = Base.promote_op(*, typeof(α), eltype(A))
8888
return ScaledMap{T}(α, A)
8989
end

test/Project.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[deps]
2+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
4+
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
5+
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
6+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
7+
Quaternions = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0"
8+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
9+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
10+
11+
[compat]
12+
Aqua = "0.5"
13+
BenchmarkTools = "1"
14+
BlockArrays = "0.16"
15+
Quaternions = "0.5"
16+
julia = "1.6"

test/numbertypes.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
using Test, LinearMaps, LinearAlgebra, Quaternions
22

3-
# type piracy because Quaternions.jl doesn't have it right
4-
Base.:(*)(z::Complex, q::Quaternion) = quat(z) * q
5-
Base.:(*)(q::Quaternion, z::Complex) = q * quat(z)
6-
Base.:(+)(q::Quaternion, z::Complex) = q + quat(z)
7-
83
@testset "noncommutative number type" begin
94
x = Quaternion.(rand(10), rand(10), rand(10), rand(10))
105
v = rand(10)
116
A = Quaternion.(rand(10,10), rand(10,10), rand(10,10), rand(10,10))
127
B = rand(ComplexF64, 10, 10)
138
C = similar(A)
14-
γ = Quaternion.(rand(4)...) # "Number"
9+
γ = Quaternion(rand(4)...) # "Number"
1510
α = UniformScaling(γ)
1611
β = UniformScaling(Quaternion.(rand(4)...))
1712
λ = rand(ComplexF64)
@@ -46,6 +41,8 @@ Base.:(+)(q::Quaternion, z::Complex) = q + quat(z)
4641
@test λ*L isa LinearMaps.CompositeMap
4742
@test γ ** LinearMap(B)) isa LinearMaps.CompositeMap
4843
@test* LinearMap(B)) * γ isa LinearMaps.CompositeMap
44+
@test ((L*L)*λ) isa LinearMaps.CompositeMap
45+
@test*(L*L)) isa LinearMaps.CompositeMap
4946
@test λ*L * x λ*A * x
5047
@test λ*L' * x λ*A' * x
5148
@test α * (3L * x) γ * (3A * x)

0 commit comments

Comments
 (0)