mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-07-30 06:05:31 +02:00
add divexact function
This commit is contained in:
parent
27e0b03b3c
commit
e92a5d72e8
@ -1,7 +1,7 @@
|
|||||||
module GroupRings
|
module GroupRings
|
||||||
|
|
||||||
using Nemo
|
using Nemo
|
||||||
import Nemo: Group, GroupElem, Ring, RingElem, parent, elem_type, parent_type, mul!, addeq!
|
import Nemo: Group, GroupElem, Ring, RingElem, parent, elem_type, parent_type, mul!, addeq!, divexact
|
||||||
|
|
||||||
import Base: convert, show, hash, ==, +, -, *, //, /, length, norm, rationalize, deepcopy_internal, getindex, setindex!, eltype, one, zero
|
import Base: convert, show, hash, ==, +, -, *, //, /, length, norm, rationalize, deepcopy_internal, getindex, setindex!, eltype, one, zero
|
||||||
|
|
||||||
@ -368,6 +368,16 @@ function *{T<:Number, S<:Number}(X::GroupRingElem{T}, Y::GroupRingElem{S})
|
|||||||
return GroupRingElem(result, RG)
|
return GroupRingElem(result, RG)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function divexact{T}(X::GroupRingElem{T}, Y::GroupRingElem{T})
|
||||||
|
if length(Y) != 1
|
||||||
|
throw("Can not divide by a non-primitive element $(Y)!")
|
||||||
|
else
|
||||||
|
idx = findfirst(Y)
|
||||||
|
c = Y[idx]
|
||||||
|
g = parent(Y).basis[idx]
|
||||||
|
return X*1//c*parent(Y)(inv(g))
|
||||||
|
end
|
||||||
|
end
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# *-involution
|
# *-involution
|
||||||
|
Loading…
Reference in New Issue
Block a user