@@ -6653,6 +6653,7 @@ julia> using LinearAlgebra ; matrix(GF(5), I(2))
66536653"""
66546654function matrix (R:: NCRing , arr:: AbstractMatrix{T} ) where {T}
66556655 Base. require_one_based_indexing (arr)
6656+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
66566657 if elem_type (R) === T && all (e -> parent (e) === R, arr)
66576658 z = Generic. MatSpaceElem {elem_type(R)} (R, arr)
66586659 return z
@@ -6664,6 +6665,7 @@ function matrix(R::NCRing, arr::AbstractMatrix{T}) where {T}
66646665end
66656666
66666667function matrix (R:: NCRing , arr:: MatElem )
6668+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
66676669 return map_entries (R, arr)
66686670end
66696671
@@ -6702,6 +6704,7 @@ Constructs the $r \times c$ matrix over $R$, where the entries are taken
67026704row-wise from `arr`.
67036705"""
67046706function matrix (R:: NCRing , r:: Int , c:: Int , arr:: AbstractVecOrMat{T} ) where T
6707+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
67056708 _check_dim (r, c, arr)
67066709 ndims (arr) == 2 && return matrix (R, arr)
67076710 if elem_type (R) === T && all (e -> parent (e) === R, arr)
@@ -7086,6 +7089,7 @@ the ring $R$.
70867089function matrix_space (R:: NCRing , r:: Int , c:: Int ; cached:: Bool = true )
70877090 # TODO : the 'cached' argument is ignored and mainly here for backwards compatibility
70887091 # (and perhaps future compatibility, in case we need it again)
7092+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
70897093 (r < 0 || c < 0 ) && error (" Dimensions must be non-negative" )
70907094 T = elem_type (R)
70917095 return MatSpace {T} (R, r, c)
0 commit comments