add perm action from the right (by inverse) on MatElems
This commit is contained in:
parent
7257c02820
commit
45d8d85189
@ -87,6 +87,24 @@ function (g::WreathProductElem)(A::MatElem)
|
||||
return Nemo.mul!(res, M(G), res)
|
||||
end
|
||||
|
||||
import Base.*
|
||||
|
||||
doc"""
|
||||
*(x::AbstractAlgebra.MatElem, P::Generic.perm)
|
||||
> Apply the pemutation $P$ to the rows of the matrix $x$ and return the result.
|
||||
"""
|
||||
function *(x::AbstractAlgebra.MatElem, P::Generic.perm)
|
||||
z = similar(x)
|
||||
m = rows(x)
|
||||
n = cols(x)
|
||||
for i = 1:m
|
||||
for j = 1:n
|
||||
z[i, j] = x[i, P[j]]
|
||||
end
|
||||
end
|
||||
return z
|
||||
end
|
||||
|
||||
function (p::perm)(A::MatElem)
|
||||
length(p.d) == A.r == A.c || throw("Can't act via $p on matrix of size ($(A.r), $(A.c))")
|
||||
return p*A*inv(p)
|
||||
|
Loading…
Reference in New Issue
Block a user