@@ -6633,6 +6633,7 @@ randmat_with_rank(S::MatSpace{T}, rank::Int, v...) where {T <: RingElement} =
6633
6633
Constructs the matrix over $R$ with entries as in `arr`.
6634
6634
"""
6635
6635
function matrix (R:: NCRing , arr:: AbstractMatrix{T} ) where {T}
6636
+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
6636
6637
if elem_type (R) === T && all (e -> parent (e) === R, arr)
6637
6638
z = Generic. MatSpaceElem {elem_type(R)} (R, arr)
6638
6639
return z
@@ -6643,6 +6644,7 @@ function matrix(R::NCRing, arr::AbstractMatrix{T}) where {T}
6643
6644
end
6644
6645
6645
6646
function matrix (R:: NCRing , arr:: MatElem )
6647
+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
6646
6648
return map_entries (R, arr)
6647
6649
end
6648
6650
@@ -6681,6 +6683,7 @@ Constructs the $r \times c$ matrix over $R$, where the entries are taken
6681
6683
row-wise from `arr`.
6682
6684
"""
6683
6685
function 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."
6684
6687
_check_dim (r, c, arr)
6685
6688
ndims (arr) == 2 && return matrix (R, arr)
6686
6689
if elem_type (R) === T && all (e -> parent (e) === R, arr)
@@ -7062,6 +7065,7 @@ the ring $R$.
7062
7065
function matrix_space (R:: NCRing , r:: Int , c:: Int ; cached:: Bool = true )
7063
7066
# TODO : the 'cached' argument is ignored and mainly here for backwards compatibility
7064
7067
# (and perhaps future compatibility, in case we need it again)
7068
+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
7065
7069
(r < 0 || c < 0 ) && error (" Dimensions must be non-negative" )
7066
7070
T = elem_type (R)
7067
7071
return MatSpace {T} (R, r, c)
0 commit comments