mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-12-29 11:00:28 +01:00
stylistic changes to mul!
This commit is contained in:
parent
bcb4f3ed30
commit
d044cc693b
@ -301,11 +301,11 @@ function mul(a::T, X::GroupRingElem{S}) where {T<:Number, S<:Number}
|
|||||||
return GroupRingElem(a.*X.coeffs, parent(X))
|
return GroupRingElem(a.*X.coeffs, parent(X))
|
||||||
end
|
end
|
||||||
|
|
||||||
(*)(a::Number, X::GroupRingElem) = mul(a,X)
|
(*)(a::Number, X::GroupRingElem) = mul(a, X)
|
||||||
(*)(X::GroupRingElem, a::Number) = 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)
|
||||||
|
|
||||||
(/)(X::GroupRingElem, a) = 1/a*X
|
(/)(X::GroupRingElem, a) = 1/a*X
|
||||||
(//)(X::GroupRingElem, a::Union{Integer, Rational}) = 1//a*X
|
(//)(X::GroupRingElem, a::Union{Integer, Rational}) = 1//a*X
|
||||||
@ -375,10 +375,8 @@ function fmac!(result::AbstractVector{T},
|
|||||||
end
|
end
|
||||||
|
|
||||||
@doc doc"""
|
@doc doc"""
|
||||||
GRmul!(result::AbstractVector{T},
|
GRmul!(result::AbstractVector{T}, X::AbstractVector, Y::AbstractVector,
|
||||||
X::AbstractVector,
|
pm::Matrix{<:Integer}) where {T<:Number}
|
||||||
Y::AbstractVector,
|
|
||||||
pm::Array{Int,2}) where {T<:Number}
|
|
||||||
> The most specialised multiplication for `X` and `Y` (intended for `coeffs` of
|
> The most specialised multiplication for `X` and `Y` (intended for `coeffs` of
|
||||||
> `GroupRingElems`), using multiplication table `pm`.
|
> `GroupRingElems`), using multiplication table `pm`.
|
||||||
> Notes:
|
> Notes:
|
||||||
@ -391,7 +389,7 @@ end
|
|||||||
function GRmul!(result::AbstractVector{T},
|
function GRmul!(result::AbstractVector{T},
|
||||||
X::AbstractVector,
|
X::AbstractVector,
|
||||||
Y::AbstractVector,
|
Y::AbstractVector,
|
||||||
pm::Array{Int,2}) where {T<:Number}
|
pm::AbstractMatrix{<:Integer}) where {T<:Number}
|
||||||
z = zero(T)
|
z = zero(T)
|
||||||
result .= z
|
result .= z
|
||||||
|
|
||||||
@ -399,9 +397,7 @@ function GRmul!(result::AbstractVector{T},
|
|||||||
end
|
end
|
||||||
|
|
||||||
@doc doc"""
|
@doc doc"""
|
||||||
mul!{T}(result::GroupRingElem{T},
|
mul!(result::GroupRingElem, X::GroupRingElem, Y::GroupRingElem)
|
||||||
X::GroupRingElem,
|
|
||||||
Y::GroupRingElem)
|
|
||||||
> In-place multiplication for `GroupRingElem`s `X` and `Y`.
|
> In-place multiplication for `GroupRingElem`s `X` and `Y`.
|
||||||
> `mul!` will make use the initialised entries of `pm` attribute of
|
> `mul!` will make use the initialised entries of `pm` attribute of
|
||||||
> `parent(X)::GroupRing` (if available), and will compute and store in `pm` the
|
> `parent(X)::GroupRing` (if available), and will compute and store in `pm` the
|
||||||
|
Loading…
Reference in New Issue
Block a user