mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2025-01-01 03:40:29 +01:00
Merge branch 'master' into enh/pmfree_mul
This commit is contained in:
commit
14e9a8505c
@ -417,9 +417,6 @@ function *{T<:Number, S<:Number}(X::GroupRingElem{T}, Y::GroupRingElem{S}, check
|
|||||||
TT = typeof(first(X.coeffs)*first(Y.coeffs))
|
TT = typeof(first(X.coeffs)*first(Y.coeffs))
|
||||||
warn("Multiplying elements with different base rings! Promoting the result to $TT.")
|
warn("Multiplying elements with different base rings! Promoting the result to $TT.")
|
||||||
|
|
||||||
result = mul!(result, X, Y)
|
|
||||||
return result
|
|
||||||
|
|
||||||
if isdefined(parent(X), :basis)
|
if isdefined(parent(X), :basis)
|
||||||
result = parent(X)(similar(X.coeffs))
|
result = parent(X)(similar(X.coeffs))
|
||||||
result = convert(TT, result)
|
result = convert(TT, result)
|
||||||
@ -436,11 +433,11 @@ end
|
|||||||
|
|
||||||
function divexact{T}(X::GroupRingElem{T}, Y::GroupRingElem{T})
|
function divexact{T}(X::GroupRingElem{T}, Y::GroupRingElem{T})
|
||||||
if length(Y) != 1
|
if length(Y) != 1
|
||||||
throw("Can not divide by a non-primitive element $(Y)!")
|
throw("Can not divide by a non-primitive element: $(Y)!")
|
||||||
else
|
else
|
||||||
idx = findfirst(Y)
|
idx = findfirst(Y)
|
||||||
c = Y[idx]
|
c = Y[idx]
|
||||||
c == 0 || throw("Can not invert")
|
c != 0 || throw("Can not invert: $c not found in $Y")
|
||||||
g = parent(Y).basis[idx]
|
g = parent(Y).basis[idx]
|
||||||
return X*1//c*parent(Y)(inv(g))
|
return X*1//c*parent(Y)(inv(g))
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user