Skip to content

Commit e67dd8f

Browse files
committed
fix lincomb mul with matrices
1 parent d9ca214 commit e67dd8f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/linearcombination.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ end
9595

9696
@inline muladd!(::FiveArg, y, A, x, α, _) = mul!(y, A, x, α, true)
9797
@inline function muladd!(::ThreeArg, y, A, x, α, z)
98-
# TODO: replace by mul!(z, A, x)
99-
A_mul_B!(z, A, x)
98+
mul!(z, A, x)
10099
if isone(α)
101100
y .+= z
102101
else

test/linearcombination.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ using Test, LinearMaps, LinearAlgebra, BenchmarkTools
1616
for α in (false, true, rand(ComplexF64)), β in (false, true, rand(ComplexF64))
1717
@test mul!(copy(u), L, v, α, β) Matrix(L)*v*α + u*β
1818
end
19+
V = rand(ComplexF64, 10, 3)
20+
U = similar(V)
21+
@test mul!(U, L, V) n*cumsum(V, dims=1)
22+
@test mul!(U, LinearMap(L), V) n*cumsum(V, dims=1)
1923

2024
A = 2 * rand(ComplexF64, (10, 10)) .- 1
2125
B = rand(ComplexF64, size(A)...)

0 commit comments

Comments
 (0)