mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-12-29 11:00:28 +01:00
Merge pull request #8 from kalmarek/fix/mul_broadcasting
fix broadcasting intervals over GroupRingElem
This commit is contained in:
commit
b601b882fa
@ -295,10 +295,10 @@ function mul!(a::T, X::GroupRingElem{T}) where T
|
|||||||
return X
|
return X
|
||||||
end
|
end
|
||||||
|
|
||||||
_mul(a::Number, X::GroupRingElem) = GroupRingElem(a*X.coeffs, parent(X))
|
_mul(a::Number, X::GroupRingElem) = GroupRingElem(a.*X.coeffs, parent(X))
|
||||||
|
|
||||||
Base.:*(a::Number, X::GroupRingElem) = _mul(a, X)
|
Base.:*(a::Number, X::GroupRingElem) = _mul(a, X)
|
||||||
Base.:*(X::GroupRingElem, a::Number) = a*X
|
Base.:*(X::GroupRingElem, a::Number) = _mul(a, X)
|
||||||
|
|
||||||
# disallow Rings to hijack *(::, ::GroupRingElem)
|
# disallow Rings to hijack *(::, ::GroupRingElem)
|
||||||
*(a::Union{AbstractFloat, Integer, RingElem, Rational}, X::GroupRingElem) = _mul(a, X)
|
*(a::Union{AbstractFloat, Integer, RingElem, Rational}, X::GroupRingElem) = _mul(a, X)
|
||||||
@ -446,7 +446,7 @@ function *(X::GroupRingElem{T}, Y::GroupRingElem{S}, check::Bool=true) where {T,
|
|||||||
result = mul!(result, X, Y)
|
result = mul!(result, X, Y)
|
||||||
else
|
else
|
||||||
result = similar(X.coeffs, TT)
|
result = similar(X.coeffs, TT)
|
||||||
result = RGmul!(result, X.coeffs, Y.coeffs, parent(X).pm)
|
result = GRmul!(result, X.coeffs, Y.coeffs, parent(X).pm)
|
||||||
result = GroupRingElem(result, parent(X))
|
result = GroupRingElem(result, parent(X))
|
||||||
end
|
end
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user