Skip to content

Commit

Permalink
Revert matrix changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored and thofma committed Nov 14, 2024
1 parent f84179f commit 37b8a64
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 @@ -446,6 +446,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 @@ -6653,7 +6653,6 @@ julia> using LinearAlgebra ; matrix(GF(5), I(2))
"""
function matrix(R::NCRing, arr::AbstractMatrix{T}) where {T}
Base.require_one_based_indexing(arr)
@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 @@ -6665,7 +6664,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 @@ -6704,7 +6702,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 @@ -7089,7 +7086,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 37b8a64

Please sign in to comment.