@@ -814,17 +814,16 @@ function _map_dual_components(fvalue!, fpartial!, x::AbstractArray{DT}) where DT
814814 return res
815815end
816816
817- Base.:\ (m:: Union {LowerTriangular{<: LinearAlgebra.BlasFloat },
818- UpperTriangular{<: LinearAlgebra.BlasFloat },
819- StridedMatrix{<: LinearAlgebra.BlasFloat }},
820- x:: StridedVecOrMat{<:Dual} ) =
821- _map_dual_components (Base. Fix1 (ldiv!, m), (x, _) -> ldiv! (m, x), x)
822-
823- Base.:* (m:: Union {LowerTriangular{<: LinearAlgebra.BlasFloat },
824- UpperTriangular{<: LinearAlgebra.BlasFloat },
825- StridedMatrix{<: LinearAlgebra.BlasFloat }},
826- x:: StridedVecOrMat{<:Dual} ) =
827- _map_dual_components (Base. Fix1 (lmul!, m), (x, _) -> lmul! (m, x), x)
817+ for MT in (StridedMatrix{<: LinearAlgebra.BlasFloat },
818+ LowerTriangular{<: LinearAlgebra.BlasFloat },
819+ UpperTriangular{<: LinearAlgebra.BlasFloat }),
820+ XT in (StridedMatrix{<: Dual }, StridedVector{<: Dual })
821+ @eval Base.:\ (m:: $MT , x:: $XT ) =
822+ _map_dual_components (Base. Fix1 (ldiv!, m), (x, _) -> ldiv! (m, x), x)
823+
824+ @eval Base.:* (m:: $MT , x:: $XT ) =
825+ _map_dual_components (Base. Fix1 (lmul!, m), (x, _) -> lmul! (m, x), x)
826+ end
828827
829828# ##################
830829# Pretty Printing #
0 commit comments