scalar*Vector needs .* on julia-1.0
This commit is contained in:
parent
01071414f7
commit
b8779b44cc
|
@ -297,12 +297,13 @@ end
|
||||||
mul(a::T, X::GroupRingElem{T}) where {T<:Number} = GroupRingElem(a*X.coeffs, parent(X))
|
mul(a::T, X::GroupRingElem{T}) where {T<:Number} = GroupRingElem(a*X.coeffs, parent(X))
|
||||||
|
|
||||||
function mul(a::T, X::GroupRingElem{S}) where {T<:Number, S<:Number}
|
function mul(a::T, X::GroupRingElem{S}) where {T<:Number, S<:Number}
|
||||||
promote_type(T,S) == S || @warn("Scalar and coeffs are in different rings! Promoting result to $(promote_type(T,S))")
|
TT = promote_type(T,S)
|
||||||
return GroupRingElem(a*X.coeffs, parent(X))
|
TT == S || @warn("Scalar and coeffs are in different rings! Promoting result to $(TT)")
|
||||||
|
return GroupRingElem(a.*X.coeffs, parent(X))
|
||||||
end
|
end
|
||||||
|
|
||||||
(*)(a, X::GroupRingElem) = mul(a,X)
|
(*)(a::Number, X::GroupRingElem) = mul(a,X)
|
||||||
(*)(X::GroupRingElem, a) = mul(a,X)
|
(*)(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)
|
||||||
|
|
Loading…
Reference in New Issue