@@ -6653,6 +6653,7 @@ julia> using LinearAlgebra ; matrix(GF(5), I(2))
6653
6653
"""
6654
6654
function matrix (R:: NCRing , arr:: AbstractMatrix{T} ) where {T}
6655
6655
Base. require_one_based_indexing (arr)
6656
+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
6656
6657
if elem_type (R) === T && all (e -> parent (e) === R, arr)
6657
6658
z = Generic. MatSpaceElem {elem_type(R)} (R, arr)
6658
6659
return z
@@ -6664,6 +6665,7 @@ function matrix(R::NCRing, arr::AbstractMatrix{T}) where {T}
6664
6665
end
6665
6666
6666
6667
function matrix (R:: NCRing , arr:: MatElem )
6668
+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
6667
6669
return map_entries (R, arr)
6668
6670
end
6669
6671
@@ -6702,6 +6704,7 @@ Constructs the $r \times c$ matrix over $R$, where the entries are taken
6702
6704
row-wise from `arr`.
6703
6705
"""
6704
6706
function 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."
6705
6708
_check_dim (r, c, arr)
6706
6709
ndims (arr) == 2 && return matrix (R, arr)
6707
6710
if elem_type (R) === T && all (e -> parent (e) === R, arr)
@@ -7086,6 +7089,7 @@ the ring $R$.
7086
7089
function matrix_space (R:: NCRing , r:: Int , c:: Int ; cached:: Bool = true )
7087
7090
# TODO : the 'cached' argument is ignored and mainly here for backwards compatibility
7088
7091
# (and perhaps future compatibility, in case we need it again)
7092
+ @req ! is_trivial (R) " Zero rings are currently not supported as base ring."
7089
7093
(r < 0 || c < 0 ) && error (" Dimensions must be non-negative" )
7090
7094
T = elem_type (R)
7091
7095
return MatSpace {T} (R, r, c)
0 commit comments