Skip to content

Commit

Permalink
Revert matrix changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 11, 2024
1 parent 50eb266 commit 2b22d78
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 1 addition & 2 deletions src/MatRing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,5 @@ Return parent object corresponding to the ring of $n\times n$ matrices over
the ring $R$.
"""
function matrix_ring(R::NCRing, n::Int)
@req !is_trivial(R) "Zero rings are currently not supported as base ring."
return Generic.matrix_ring(R, n)
Generic.matrix_ring(R, n)
end
4 changes: 0 additions & 4 deletions src/Matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6633,7 +6633,6 @@ randmat_with_rank(S::MatSpace{T}, rank::Int, v...) where {T <: RingElement} =
Constructs the matrix over $R$ with entries as in `arr`.
"""
function matrix(R::NCRing, arr::AbstractMatrix{T}) where {T}
@req !is_trivial(R) "Zero rings are currently not supported as base ring."
if elem_type(R) === T && all(e -> parent(e) === R, arr)
z = Generic.MatSpaceElem{elem_type(R)}(R, arr)
return z
Expand All @@ -6644,7 +6643,6 @@ function matrix(R::NCRing, arr::AbstractMatrix{T}) where {T}
end

function matrix(R::NCRing, arr::MatElem)
@req !is_trivial(R) "Zero rings are currently not supported as base ring."
return map_entries(R, arr)
end

Expand Down Expand Up @@ -6683,7 +6681,6 @@ Constructs the $r \times c$ matrix over $R$, where the entries are taken
row-wise from `arr`.
"""
function matrix(R::NCRing, r::Int, c::Int, arr::AbstractVecOrMat{T}) where T
@req !is_trivial(R) "Zero rings are currently not supported as base ring."
_check_dim(r, c, arr)
ndims(arr) == 2 && return matrix(R, arr)
if elem_type(R) === T && all(e -> parent(e) === R, arr)
Expand Down Expand Up @@ -7065,7 +7062,6 @@ the ring $R$.
function matrix_space(R::NCRing, r::Int, c::Int; cached::Bool = true)
# TODO: the 'cached' argument is ignored and mainly here for backwards compatibility
# (and perhaps future compatibility, in case we need it again)
@req !is_trivial(R) "Zero rings are currently not supported as base ring."
(r < 0 || c < 0) && error("Dimensions must be non-negative")
T = elem_type(R)
return MatSpace{T}(R, r, c)
Expand Down

0 comments on commit 2b22d78

Please sign in to comment.