@@ -14,6 +14,7 @@ using Test, LinearMaps, LinearAlgebra, SparseArrays
1414 M = @inferred 1 * LinearMap (A)
1515 N = @inferred LinearMap (B)
1616 v = rand (ComplexF64, 10 )
17+ α = rand (ComplexF64)
1718 @test FCM * v == F * v
1819 @test @inferred (F * F) * v == @inferred F * (F * v)
1920 @test @inferred (F * A) * v == @inferred F * (A * v)
@@ -52,17 +53,20 @@ using Test, LinearMaps, LinearAlgebra, SparseArrays
5253 R1 = rand (ComplexF64, 10 , 10 ); L1 = LinearMap (R1)
5354 R2 = rand (ComplexF64, 10 , 10 ); L2 = LinearMap (R2)
5455 R3 = rand (ComplexF64, 10 , 10 ); L3 = LinearMap (R3)
55- CompositeR = prod (LinearMap, [R1, R2, R3])
56- @test @inferred L1 * L2 * L3 == CompositeR
56+ CompositeR = * (R1, R2, R3)
57+ CompositeL = prod (LinearMap, [R1, R2, R3])
58+ @test @inferred L1 * L2 * L3 == CompositeL
5759 @test Matrix (L1 * L2) ≈ sparse (L1 * L2) ≈ R1 * R2
58- @test @inferred transpose (CompositeR) == transpose (L3) * transpose (L2) * transpose (L1)
59- @test @inferred adjoint (CompositeR) == L3' * L2' * L1'
60- @test @inferred adjoint (adjoint ((CompositeR))) == CompositeR
61- @test transpose (transpose ((CompositeR))) == CompositeR
62- Lt = @inferred transpose (LinearMap (CompositeR))
63- @test Lt * v ≈ transpose (R3) * transpose (R2) * transpose (R1) * v
64- Lc = @inferred adjoint (LinearMap (CompositeR))
65- @test Lc * v ≈ R3' * R2' * R1' * v
60+ @test Matrix (@inferred ((α * L1) * (L2 * L3)):: LinearMaps.ScaledMap ) ≈ α * CompositeR
61+ @test Matrix (@inferred ((L1 * L2) * (L3 * α)):: LinearMaps.ScaledMap ) ≈ α * CompositeR
62+ @test @inferred transpose (CompositeL) == transpose (L3) * transpose (L2) * transpose (L1)
63+ @test @inferred adjoint (CompositeL) == L3' * L2' * L1'
64+ @test @inferred adjoint (adjoint ((CompositeL))) == CompositeL
65+ @test transpose (transpose ((CompositeL))) == CompositeL
66+ Lt = @inferred transpose (LinearMap (CompositeL))
67+ @test Lt * v ≈ transpose (CompositeR) * v
68+ Lc = @inferred adjoint (LinearMap (CompositeL))
69+ @test Lc * v ≈ adjoint (CompositeR) * v
6670
6771 # convert to AbstractMatrix
6872 for A in (LinearMap (sprandn (10 , 10 , 0.3 )), LinearMap (rand ()* I, 10 ))
0 commit comments