@@ -837,17 +837,16 @@ function _map_dual_components(fvalue!, fpartial!, x::AbstractArray{DT}) where DT
837837 return res
838838end
839839
840- Base.:\ (m:: Union {LowerTriangular{<: LinearAlgebra.BlasFloat },
841- UpperTriangular{<: LinearAlgebra.BlasFloat },
842- StridedMatrix{<: LinearAlgebra.BlasFloat }},
843- x:: StridedVecOrMat{<:Dual} ) =
844- _map_dual_components (Base. Fix1 (ldiv!, m), (x, _) -> ldiv! (m, x), x)
845-
846- Base.:* (m:: Union {LowerTriangular{<: LinearAlgebra.BlasFloat },
847- UpperTriangular{<: LinearAlgebra.BlasFloat },
848- StridedMatrix{<: LinearAlgebra.BlasFloat }},
849- x:: StridedVecOrMat{<:Dual} ) =
850- _map_dual_components (Base. Fix1 (lmul!, m), (x, _) -> lmul! (m, x), x)
840+ for MT in (StridedMatrix{<: LinearAlgebra.BlasFloat },
841+ LowerTriangular{<: LinearAlgebra.BlasFloat },
842+ UpperTriangular{<: LinearAlgebra.BlasFloat }),
843+ XT in (StridedMatrix{<: Dual }, StridedVector{<: Dual })
844+ @eval Base.:\ (m:: $MT , x:: $XT ) =
845+ _map_dual_components (Base. Fix1 (ldiv!, m), (x, _) -> ldiv! (m, x), x)
846+
847+ @eval Base.:* (m:: $MT , x:: $XT ) =
848+ _map_dual_components (Base. Fix1 (lmul!, m), (x, _) -> lmul! (m, x), x)
849+ end
851850
852851# ##################
853852# Pretty Printing #
0 commit comments