Skip to content

Commit 2e4c5d1

Browse files
authored
add WrappedMap tests
1 parent 461aee7 commit 2e4c5d1

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

test/runtests.jl

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,29 @@ W = rand(ComplexF64, 20, 3)
2929

3030
# test wrapped map for matrix
3131
M = LinearMap(A)
32-
@test M * v == A * v
33-
@test mul!(w, M, v) == A * v
34-
@test mul!(copy(W), M, V) A * V
32+
N = LinearMap(M)
33+
Av = A * v
34+
AV = A * V
35+
@test M * v == Av
36+
@test N * v == Av
37+
@test mul!(copy(w), M, v) == Av
38+
@test mul!(copy(w), N, v) == Av
39+
@test mul!(copy(W), M, V) AV
3540
@test typeof(M * V) <: LinearMap
36-
@test LinearMap(M) * v == A * v
3741

3842
# test of mul!
3943
@test mul!(copy(w), M, v, 0, 0) == zero(w)
4044
@test mul!(copy(w), M, v, 0, 1) == w
4145
@test mul!(copy(w), M, v, 0, β) == β * w
42-
@test mul!(copy(w), M, v, 1, 1) A * v + w
43-
@test mul!(copy(w), M, v, 1, β) A * v + β * w
44-
@test mul!(copy(w), M, v, α, 1) α * A * v + w
45-
@test mul!(copy(w), M, v, α, β) α * A * v + β * w
46-
@test mul!(copy(w), M, v, α) α * A * v
46+
@test mul!(copy(w), M, v, 1, 1) Av + w
47+
@test mul!(copy(w), M, v, 1, β) Av + β * w
48+
@test mul!(copy(w), M, v, α, 1) α * Av + w
49+
@test mul!(copy(w), M, v, α, β) α * Av + β * w
50+
@test mul!(copy(w), M, v, α) α * Av
4751

4852
# test matrix-mul!
49-
@test mul!(copy(W), M, V, α, β) α * A * V + β * W
50-
@test mul!(copy(W), M, V, α) α * A * V
53+
@test mul!(copy(W), M, V, α, β) α * AV + β * W
54+
@test mul!(copy(W), M, V, α) α * AV
5155

5256
# test transposition and Matrix
5357
@test M' * w == A' * w

0 commit comments

Comments
 (0)