Skip to content

Commit 1a2f518

Browse files
committed
overload mul!(y::DualMtx, m::FloatMtx, x::DualMtx)
1 parent 4014a91 commit 1a2f518

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/dual.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,10 @@ for MT in (StridedMatrix{<:LinearAlgebra.BlasFloat},
840840

841841
@eval Base.:*(m::$MT, x::StridedVector{<:Dual}) = mul!(similar(x, (size(m, 1),)), m, x)
842842

843-
@eval Base.:*(m::$MT, x::StridedMatrix{<:Dual}) =
844-
_map_dual_components!((y, x) -> mul!(y, m, x), (y, x, _) -> mul!(y, m, x),
845-
similar(x, (size(m, 1), size(x, 2))), x)
843+
@eval LinearAlgebra.mul!(y::StridedMatrix{T}, m::$MT, x::StridedMatrix{T}) where T <: Dual =
844+
_map_dual_components!((y, x) -> mul!(y, m, x), (y, x, _) -> mul!(y, m, x), y, x)
845+
846+
@eval Base.:*(m::$MT, x::StridedMatrix{<:Dual}) = mul!(similar(x, (size(m, 1), size(x, 2))), m, x)
846847
end
847848

848849
###################

0 commit comments

Comments
 (0)