@@ -806,17 +806,16 @@ function _map_dual_components(fvalue!, fpartial!, x::AbstractArray{DT}) where DT
806806 return res
807807end
808808
809- Base.:\ (m:: Union {LowerTriangular{<: LinearAlgebra.BlasFloat },
810- UpperTriangular{<: LinearAlgebra.BlasFloat },
811- StridedMatrix{<: LinearAlgebra.BlasFloat }},
812- x:: StridedVecOrMat{<:Dual} ) =
813- _map_dual_components (Base. Fix1 (ldiv!, m), (x, _) -> ldiv! (m, x), x)
814-
815- Base.:* (m:: Union {LowerTriangular{<: LinearAlgebra.BlasFloat },
816- UpperTriangular{<: LinearAlgebra.BlasFloat },
817- StridedMatrix{<: LinearAlgebra.BlasFloat }},
818- x:: StridedVecOrMat{<:Dual} ) =
819- _map_dual_components (Base. Fix1 (lmul!, m), (x, _) -> lmul! (m, x), x)
809+ for MT in (StridedMatrix{<: LinearAlgebra.BlasFloat },
810+ LowerTriangular{<: LinearAlgebra.BlasFloat },
811+ UpperTriangular{<: LinearAlgebra.BlasFloat }),
812+ XT in (StridedMatrix{<: Dual }, StridedVector{<: Dual })
813+ @eval Base.:\ (m:: $MT , x:: $XT ) =
814+ _map_dual_components (Base. Fix1 (ldiv!, m), (x, _) -> ldiv! (m, x), x)
815+
816+ @eval Base.:* (m:: $MT , x:: $XT ) =
817+ _map_dual_components (Base. Fix1 (lmul!, m), (x, _) -> lmul! (m, x), x)
818+ end
820819
821820# ##################
822821# Pretty Printing #
0 commit comments