@@ -6633,6 +6633,7 @@ randmat_with_rank(S::MatSpace{T}, rank::Int, v...) where {T <: RingElement} =
66336633Constructs the matrix over $R$ with entries as in `arr`.
66346634"""
66356635function matrix (R:: NCRing , arr:: AbstractMatrix{T} ) where {T}
6636+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
66366637 if elem_type (R) === T && all (e -> parent (e) === R, arr)
66376638 z = Generic. MatSpaceElem {elem_type(R)} (R, arr)
66386639 return z
@@ -6643,6 +6644,7 @@ function matrix(R::NCRing, arr::AbstractMatrix{T}) where {T}
66436644end
66446645
66456646function matrix (R:: NCRing , arr:: MatElem )
6647+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
66466648 return map_entries (R, arr)
66476649end
66486650
@@ -6681,6 +6683,7 @@ Constructs the $r \times c$ matrix over $R$, where the entries are taken
66816683row-wise from `arr`.
66826684"""
66836685function matrix (R:: NCRing , r:: Int , c:: Int , arr:: AbstractVecOrMat{T} ) where T
6686+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
66846687 _check_dim (r, c, arr)
66856688 ndims (arr) == 2 && return matrix (R, arr)
66866689 if elem_type (R) === T && all (e -> parent (e) === R, arr)
@@ -7062,6 +7065,7 @@ the ring $R$.
70627065function matrix_space (R:: NCRing , r:: Int , c:: Int ; cached:: Bool = true )
70637066 # TODO : the 'cached' argument is ignored and mainly here for backwards compatibility
70647067 # (and perhaps future compatibility, in case we need it again)
7068+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
70657069 (r < 0 || c < 0 ) && error (" Dimensions must be non-negative" )
70667070 T = elem_type (R)
70677071 return MatSpace {T} (R, r, c)
0 commit comments