Skip to content

Commit

Permalink
Merge pull request #1351 from fingolfin/mh/misc-groups
Browse files Browse the repository at this point in the history
Miscellaneous changes to the groups code
  • Loading branch information
fieker committed May 23, 2022
2 parents b9cf59d + 9c753ac commit cf5009a
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/Groups/matrices/MatGrp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ end

# embedding an element of type MatElem into a group G
# if check=false, there are no checks on the condition `x in G`
function (G::MatrixGroup)(x::MatElem; check=true)
function (G::MatrixGroup)(x::MatElem; check::Bool=true)
if check
_is_true, x_gap = lies_in(x,G,nothing)
_is_true || throw(ArgumentError("Element not in the group"))
Expand All @@ -362,7 +362,7 @@ end

# embedding an element of type MatrixGroupElem into a group G
# if check=false, there are no checks on the condition `x in G`
function (G::MatrixGroup)(x::MatrixGroupElem; check=true)
function (G::MatrixGroup)(x::MatrixGroupElem; check::Bool=true)
if !check
z = x
z.parent = G
Expand All @@ -386,8 +386,8 @@ function (G::MatrixGroup)(x::MatrixGroupElem; check=true)
end
end

# embedding a nxn array into a group G
function (G::MatrixGroup)(L::AbstractVecOrMat; check=true)
# embedding a n x n array into a group G
function (G::MatrixGroup)(L::AbstractVecOrMat; check::Bool=true)
x = matrix(G.ring, G.deg, G.deg, L)
return G(x; check=check)
end
Expand Down Expand Up @@ -453,14 +453,14 @@ comm(x::MatrixGroupElem, y::MatrixGroupElem) = inv(x)*conj(x,y)
"""
det(x::MatrixGroupElem)
Return the determinant of `x`.
Return the determinant of the underlying matrix of `x`.
"""
det(x::MatrixGroupElem) = det(x.elm)
det(x::MatrixGroupElem) = det(matrix(x))

"""
base_ring(x::MatrixGroupElem)
Return the base ring of `x`.
Return the base ring of the underlying matrix of `x`.
"""
base_ring(x::MatrixGroupElem) = x.parent.ring

Expand All @@ -469,7 +469,7 @@ parent(x::MatrixGroupElem) = x.parent
"""
matrix(x::MatrixGroupElem)
Return the underlying `AbstractAlgebra` matrix of `x`.
Return the underlying matrix of `x`.
"""
matrix(x::MatrixGroupElem) = x.elm

Expand All @@ -478,9 +478,17 @@ Base.getindex(x::MatrixGroupElem, i::Int, j::Int) = x.elm[i,j]
"""
nrows(x::MatrixGroupElem)
Return the number of rows of the given matrix.
Return the number of rows of the underlying matrix of `x`.
"""
nrows(x::MatrixGroupElem) = x.parent.deg
nrows(x::MatrixGroupElem) = nrows(matrix(x))

"""
ncols(x::MatrixGroupElem)
Return the number of columns of the underlying matrix of `x`.
"""
ncols(x::MatrixGroupElem) = ncols(matrix(x))


"""
trace(x::MatrixGroupElem)
Expand Down

0 comments on commit cf5009a

Please sign in to comment.