From f01229d75bd176f6a0b5c26bc0e530ec2f474fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Tue, 30 Apr 2024 15:10:01 +0200 Subject: [PATCH 1/4] chore: Bump version to 0.31.0-DEV --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index f37490a6fb..8aae25a6c2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Hecke" uuid = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" -version = "0.30.11" +version = "0.31.0-DEV" [deps] AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" From 392b061bf499aed37cafa27912a52142f3397613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Tue, 30 Apr 2024 15:10:13 +0200 Subject: [PATCH 2/4] chore: Bump compat of AA and Nemo --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 8aae25a6c2..360eb4afeb 100644 --- a/Project.toml +++ b/Project.toml @@ -28,7 +28,7 @@ GAPExt = "GAP" PolymakeExt = "Polymake" [compat] -AbstractAlgebra = "^0.40.9" +AbstractAlgebra = "^0.41.0" Dates = "1.6" Distributed = "1.6" GAP = "0.9.6, 0.10, 0.11" @@ -37,7 +37,7 @@ LazyArtifacts = "1.6" Libdl = "1.6" LinearAlgebra = "1.6" Markdown = "1.6" -Nemo = "^0.43.3" +Nemo = "^0.44.0" Pkg = "1.6" Polymake = "0.10, 0.11" Printf = "1.6" From 004a31c933628d3bfea76dc2fe77e6540d9c749e Mon Sep 17 00:00:00 2001 From: Johannes Schmitt Date: Thu, 25 Apr 2024 13:18:29 +0200 Subject: [PATCH 3/4] Adjust to expected AbstractAlgebra changes (cherry picked from commit df28de9552bc4a6d98f5bf20b2eacfac8b2f7644) --- src/LocalField/map.jl | 2 +- src/Map/NumField.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LocalField/map.jl b/src/LocalField/map.jl index 423fd91775..2e6c6e7044 100644 --- a/src/LocalField/map.jl +++ b/src/LocalField/map.jl @@ -10,7 +10,7 @@ mutable struct LocalFieldMor{S, T, U, V, W} <: Map{S, T, HeckeMap, LocalFieldMor inverse_data::V absolute_basis::Vector{W} absolute_basis_matrix_image::Generic.MatSpaceElem{PadicFieldElem} - solve_context::Solve.SolveCtx{PadicFieldElem, Generic.MatSpaceElem{PadicFieldElem}, Solve.LazyTransposeMatElem{PadicFieldElem, Generic.MatSpaceElem{PadicFieldElem}}} + solve_context::Solve.SolveCtx{PadicFieldElem, Generic.MatSpaceElem{PadicFieldElem}, Generic.MatSpaceElem{PadicFieldElem}, Solve.LazyTransposeMatElem{PadicFieldElem, Generic.MatSpaceElem{PadicFieldElem}}} function LocalFieldMor{S, T, U, V}() where {S, T, U, V} z = new{S, T, U, V, elem_type(S)}() diff --git a/src/Map/NumField.jl b/src/Map/NumField.jl index 387614de7e..b686944644 100644 --- a/src/Map/NumField.jl +++ b/src/Map/NumField.jl @@ -109,7 +109,7 @@ mutable struct NumFieldHom{S, T, U, V, W} <: Map{S, T, HeckeMap, NumFieldHom} inverse_data::V absolute_basis::Vector{W} absolute_basis_matrix_image::QQMatrix - solve_context::Solve.SolveCtx{QQFieldElem, QQMatrix, QQMatrix} + solve_context::Solve.SolveCtx{QQFieldElem, QQMatrix, QQMatrix, QQMatrix} function NumFieldHom{S, T, U, V}() where {S, T, U, V} z = new{S, T, U, V, elem_type(S)}() From 3061bbbb04c714b9a219d2005f75534bb67a96e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Tue, 30 Apr 2024 20:59:21 +0200 Subject: [PATCH 4/4] Add many `base_ring_type` methods --- src/AlgAss/AlgAss.jl | 2 ++ src/AlgAss/AlgGrp.jl | 6 ++++-- src/AlgAss/AlgMat.jl | 2 ++ src/AlgAss/AlgQuat.jl | 2 ++ src/AlgAssAbsOrd/Order.jl | 2 ++ src/AlgAssAbsOrd/PicardGroup.jl | 2 -- src/AlgAssRelOrd/Order.jl | 2 ++ src/GenOrd/GenOrd.jl | 2 ++ src/GrpAb/ChainComplex.jl | 2 ++ src/GrpAb/stable_sub.jl | 4 ++++ src/Misc/FactoredElem.jl | 2 ++ src/Misc/PIDIdeal.jl | 2 ++ src/Misc/PseudoPolynomial.jl | 2 ++ src/NumField/Embedded.jl | 8 ++++++-- src/NumField/NfAbs/NonSimple.jl | 2 ++ src/NumFieldOrd/NfOrd/LinearAlgebra.jl | 4 ++++ src/NumFieldOrd/NfOrd/NfOrd.jl | 4 +++- src/NumFieldOrd/NfOrd/ResidueRing.jl | 2 ++ src/NumFieldOrd/NfRelOrd/NfRelOrd.jl | 2 ++ src/NumFieldOrd/NfRelOrd/ResidueRing.jl | 2 ++ src/QuadForm/Quad/Spaces.jl | 3 +++ src/QuadForm/Quad/ZLattices.jl | 2 ++ src/QuadForm/QuadBin.jl | 2 ++ src/RCF/class_fields.jl | 2 ++ src/Sparse/Matrix.jl | 2 ++ src/Sparse/Row.jl | 2 ++ 26 files changed, 62 insertions(+), 7 deletions(-) diff --git a/src/AlgAss/AlgAss.jl b/src/AlgAss/AlgAss.jl index e7e2366cfb..9b7b2fd142 100644 --- a/src/AlgAss/AlgAss.jl +++ b/src/AlgAss/AlgAss.jl @@ -24,6 +24,8 @@ end base_ring(A::StructureConstantAlgebra{T}) where {T} = A.base_ring::parent_type(T) +base_ring_type(::Type{StructureConstantAlgebra{T}}) where {T} = parent_type(T) + has_one(A::StructureConstantAlgebra) = A.has_one iszero(A::StructureConstantAlgebra) = A.iszero diff --git a/src/AlgAss/AlgGrp.jl b/src/AlgAss/AlgGrp.jl index fb49094a74..a04cc9c531 100644 --- a/src/AlgAss/AlgGrp.jl +++ b/src/AlgAss/AlgGrp.jl @@ -8,6 +8,8 @@ denominator_of_multiplication_table(A::GroupAlgebra{QQFieldElem}) = one(ZZ) base_ring(A::GroupAlgebra{T}) where {T} = A.base_ring::parent_type(T) +base_ring_type(::Type{GroupAlgebra{T}}) where {T} = parent_type(T) + Generic.dim(A::GroupAlgebra) = size(multiplication_table(A, copy = false), 1) elem_type(::Type{GroupAlgebra{T, S, R}}) where {T, S, R} = GroupAlgebraElem{T, GroupAlgebra{T, S, R}} @@ -16,8 +18,8 @@ order_type(::GroupAlgebra{QQFieldElem, S, R}) where { S, R } = AlgAssAbsOrd{Grou order_type(::Type{GroupAlgebra{QQFieldElem, S, R}}) where { S, R } = AlgAssAbsOrd{GroupAlgebra{QQFieldElem, S, R}, elem_type(GroupAlgebra{QQFieldElem, S, R})} -order_type(::GroupAlgebra{T, S, R}) where { T <: NumFieldElem, S, R } = AlgAssRelOrd{T, fractional_ideal_type(order_type(parent_type(T)))} -order_type(::Type{GroupAlgebra{T, S, R}}) where { T <: NumFieldElem, S, R } = AlgAssRelOrd{T, fractional_ideal_type(order_type(parent_type(T)))} +order_type(::GroupAlgebra{T, S, R}) where { T <: NumFieldElem, S, R } = AlgAssRelOrd{T, fractional_ideal_type(order_type(parent_type(T))), GroupAlgebra{T, S, R}} +order_type(::Type{GroupAlgebra{T, S, R}}) where { T <: NumFieldElem, S, R } = AlgAssRelOrd{T, fractional_ideal_type(order_type(parent_type(T))), GroupAlgebra{T, S, R}} @doc raw""" group(A::GroupAlgebra) -> Group diff --git a/src/AlgAss/AlgMat.jl b/src/AlgAss/AlgMat.jl index f43fad763e..b3190cfec9 100644 --- a/src/AlgAss/AlgMat.jl +++ b/src/AlgAss/AlgMat.jl @@ -10,6 +10,8 @@ dim(A::MatAlgebra) = A.dim base_ring(A::MatAlgebra{T, S}) where {T, S} = A.base_ring::parent_type(T) +base_ring_type(::Type{MatAlgebra{T, S}}) where {T, S} = parent_type(T) + coefficient_ring(A::MatAlgebra) = A.coefficient_ring basis(A::MatAlgebra) = A.basis diff --git a/src/AlgAss/AlgQuat.jl b/src/AlgAss/AlgQuat.jl index 99d9510295..2b4c50a40c 100644 --- a/src/AlgAss/AlgQuat.jl +++ b/src/AlgAss/AlgQuat.jl @@ -47,6 +47,8 @@ dim(A::QuaternionAlgebra) = 4 base_ring(A::QuaternionAlgebra{T}) where {T} = A.base_ring::parent_type(T) +base_ring_type(::Type{QuaternionAlgebra{T}}) where {T} = parent_type(T) + multiplication_table(A::QuaternionAlgebra; copy = false) = A.mult_table standard_form(A::QuaternionAlgebra) = A.std diff --git a/src/AlgAssAbsOrd/Order.jl b/src/AlgAssAbsOrd/Order.jl index 1b28d81da8..d204c42794 100644 --- a/src/AlgAssAbsOrd/Order.jl +++ b/src/AlgAssAbsOrd/Order.jl @@ -23,6 +23,8 @@ _algebra(O::AlgAssAbsOrd) = algebra(O) base_ring(O::AlgAssAbsOrd) = FlintZZ +base_ring_type(::Type{AlgAssAbsOrd}) = ZZRing + @doc raw""" is_commutative(O::AlgAssAbsOrd) -> Bool diff --git a/src/AlgAssAbsOrd/PicardGroup.jl b/src/AlgAssAbsOrd/PicardGroup.jl index 0c5dca7167..bd83502486 100644 --- a/src/AlgAssAbsOrd/PicardGroup.jl +++ b/src/AlgAssAbsOrd/PicardGroup.jl @@ -19,8 +19,6 @@ function modulus(f::MapRayClassGroupAlg{S, T}) where {S, T} return f.modulus::elem_type(base_ring_type(T)) end -base_ring_type(::Type{FacElemMon{S}}) where {S} = S - mutable struct MapPicardGrp{S, T} <: Map{S, T, HeckeMap, MapPicardGrp} header::MapHeader{S, T} diff --git a/src/AlgAssRelOrd/Order.jl b/src/AlgAssRelOrd/Order.jl index 476e1a5634..8ab83877d5 100644 --- a/src/AlgAssRelOrd/Order.jl +++ b/src/AlgAssRelOrd/Order.jl @@ -20,6 +20,8 @@ Returns an order $R$ in the base ring of the algebra of $O$, such that $O$ is an """ base_ring(O::AlgAssRelOrd) = order(basis_pmatrix(O, copy = false).coeffs[1]) +base_ring_type(::Type{<:AlgAssRelOrd{S, T, U}}) where {S, T, U} = order_type(base_ring_type(U)) + @doc raw""" is_commutative(O::AlgAssRelOrd) -> Bool diff --git a/src/GenOrd/GenOrd.jl b/src/GenOrd/GenOrd.jl index 3bfe589e25..d423cec820 100644 --- a/src/GenOrd/GenOrd.jl +++ b/src/GenOrd/GenOrd.jl @@ -76,6 +76,8 @@ end base_ring(O::GenOrd) = O.R +base_ring_type(::Type{GenOrd{S, T}}) where {S, T} = T + coefficient_ring(O::GenOrd) = O.R field(O::GenOrd) = O.F diff --git a/src/GrpAb/ChainComplex.jl b/src/GrpAb/ChainComplex.jl index 49b35a3895..53142ddd97 100644 --- a/src/GrpAb/ChainComplex.jl +++ b/src/GrpAb/ChainComplex.jl @@ -325,6 +325,8 @@ map_type(C::ComplexOfMorphisms) = valtype(C.maps) Hecke.base_ring(::FinGenAbGroup) = ZZ +Hecke.base_ring_type(::Type{FinGenAbGroup}) = ZZRing + function pres_show(io::IO, C::ComplexOfMorphisms) name_mod = String[] rank_mod = Int[] diff --git a/src/GrpAb/stable_sub.jl b/src/GrpAb/stable_sub.jl index 008fe55089..df0481c440 100644 --- a/src/GrpAb/stable_sub.jl +++ b/src/GrpAb/stable_sub.jl @@ -11,6 +11,10 @@ function base_ring(M::ZpnGModule) return M.R end +function base_ring_type(::Type{ZpnGModule}) + return Nemo.zzModRing +end + function show(io::IO, M::ZpnGModule) print(io, "Module over Z/", M.R.n, "Z with structure ", M.V) end diff --git a/src/Misc/FactoredElem.jl b/src/Misc/FactoredElem.jl index c9cabf103a..4c699a4755 100644 --- a/src/Misc/FactoredElem.jl +++ b/src/Misc/FactoredElem.jl @@ -178,6 +178,8 @@ parent(x::FacElem) = x.parent base_ring(x::FacElemMon) = x.base_ring +base_ring_type(::Type{FacElemMon{S}}) where {S} = S + base_ring(x::FacElem) = base_ring(parent(x)) base(x::FacElem) = keys(x.fac) diff --git a/src/Misc/PIDIdeal.jl b/src/Misc/PIDIdeal.jl index d80c74e9d8..f2b837ac06 100644 --- a/src/Misc/PIDIdeal.jl +++ b/src/Misc/PIDIdeal.jl @@ -7,6 +7,8 @@ end base_ring(x::PIDIdeal) = parent(x.gen) +base_ring_type(::Type{PIDIdeal{T}}) where {T} = parent_type(T) + _can_canonicalize(::Type{ZZRingElem}) = true _can_canonicalize(::Type{<:PolyRingElem{T}}) where {T <: FieldElem} = true diff --git a/src/Misc/PseudoPolynomial.jl b/src/Misc/PseudoPolynomial.jl index 0b0fb875e4..00213d2c06 100644 --- a/src/Misc/PseudoPolynomial.jl +++ b/src/Misc/PseudoPolynomial.jl @@ -15,6 +15,8 @@ iszero(f::PseudoPoly) = iszero(polynomial(f)) base_ring(f::PseudoPoly) = parent(polynomial(f)) +base_ring_type(::Type{PseudoPoly{S, T}}) where {S, T} = parent_type(S) + pseudo_polynomial(f, A) = PseudoPoly(f, A) polynomial(f::PseudoPoly) = f.poly diff --git a/src/NumField/Embedded.jl b/src/NumField/Embedded.jl index e13d0c15fa..9b34f2618b 100644 --- a/src/NumField/Embedded.jl +++ b/src/NumField/Embedded.jl @@ -59,6 +59,10 @@ elem_type(::Type{EmbeddedNumField{S, E}}) where {S, E} = EmbeddedNumFieldElem{el parent_type(::Type{EmbeddedNumFieldElem{T}}) where {T} = EmbeddedNumField{parent_type(T), embedding_type(parent_type(T))} +base_ring(::EmbeddedNumField) = FlintQQ + +base_ring_type(::Type{<:EmbeddedNumField}) = QQField + data(x::EmbeddedNumFieldElem) = x.element function embedded_field(K::SimpleNumField, i::NumFieldEmb) @@ -213,8 +217,8 @@ is_negative(x::EmbeddedNumFieldElem) = x < 0 # ################################################################################ -function sign(x::EmbeddedNumFieldElem) - if is_zero(x) +function sign(x::EmbeddedNumFieldElem) + if is_zero(x) return x end if x > 0 diff --git a/src/NumField/NfAbs/NonSimple.jl b/src/NumField/NfAbs/NonSimple.jl index 8e93d69385..d6a12d9c85 100644 --- a/src/NumField/NfAbs/NonSimple.jl +++ b/src/NumField/NfAbs/NonSimple.jl @@ -34,6 +34,8 @@ @inline base_ring(K::AbsNonSimpleNumField) = FlintQQ +@inline base_ring_type(K::AbsNonSimpleNumField) = QQField + @inline base_field(K::AbsNonSimpleNumField) = FlintQQ @inline degree(K::AbsNonSimpleNumField) = K.degree diff --git a/src/NumFieldOrd/NfOrd/LinearAlgebra.jl b/src/NumFieldOrd/NfOrd/LinearAlgebra.jl index bda14e58db..04b9a31c0a 100644 --- a/src/NumFieldOrd/NfOrd/LinearAlgebra.jl +++ b/src/NumFieldOrd/NfOrd/LinearAlgebra.jl @@ -268,6 +268,8 @@ This function returns the $R$ that was used to defined $M$. """ base_ring(M::PMat{T, S}) where {T, S} = nrows(M) >= 1 ? order(M.coeffs[1]) : M.base_ring::order_type(parent_type(T)) +base_ring_type(::Type{PMat{T, S}}) where {T, S} = order_type(parent_type(T)) + function pseudo_matrix(m::AbstractAlgebra.MatElem{T}, c::Vector{S}) where {T, S} # sanity checks @assert nrows(m) == length(c) @@ -1577,6 +1579,8 @@ end base_ring(M::ModDed) = M.base_ring +base_ring_type(::Type{ModDed}) = AbsSimpleNumFieldOrder + function show(io::IO, M::ModDed) print(io, "Module over $(M.base_ring) with defining pseudo-matrix") for i in 1:nrows(M.pmatrix.matrix) diff --git a/src/NumFieldOrd/NfOrd/NfOrd.jl b/src/NumFieldOrd/NfOrd/NfOrd.jl index 5659d2c7aa..ebf4ed4ea7 100644 --- a/src/NumFieldOrd/NfOrd/NfOrd.jl +++ b/src/NumFieldOrd/NfOrd/NfOrd.jl @@ -50,7 +50,9 @@ fractional_ideal_type(::AbsNumFieldOrder{S, T}) where {S, T} = AbsSimpleNumField fractional_ideal_type(::Type{AbsNumFieldOrder{S, T}}) where {S, T} = AbsSimpleNumFieldOrderFractionalIdeal -Nemo.base_ring(::AbsNumFieldOrder) = FlintZZ +base_ring(::AbsNumFieldOrder) = FlintZZ + +base_ring_type(::Type{<:AbsNumFieldOrder}) = ZZRing @doc raw""" parent(O::AbsNumFieldOrder) -> AbsNumFieldOrderSet diff --git a/src/NumFieldOrd/NfOrd/ResidueRing.jl b/src/NumFieldOrd/NfOrd/ResidueRing.jl index 1de1f59bf1..fd89a92f39 100644 --- a/src/NumFieldOrd/NfOrd/ResidueRing.jl +++ b/src/NumFieldOrd/NfOrd/ResidueRing.jl @@ -53,6 +53,8 @@ end base_ring(Q::AbsOrdQuoRing) = Q.base_ring +base_ring_type(::Type{AbsOrdQuoRing{S, T}}) where {S, T} = S + ideal(Q::AbsOrdQuoRing) = Q.ideal basis_matrix(Q::AbsOrdQuoRing) = Q.basis_matrix diff --git a/src/NumFieldOrd/NfRelOrd/NfRelOrd.jl b/src/NumFieldOrd/NfRelOrd/NfRelOrd.jl index b8b13a93ae..2be655f22a 100644 --- a/src/NumFieldOrd/NfRelOrd/NfRelOrd.jl +++ b/src/NumFieldOrd/NfRelOrd/NfRelOrd.jl @@ -20,6 +20,8 @@ parent(O::RelNumFieldOrder) = O.parent base_ring(O::RelNumFieldOrder) = order(pseudo_basis(O, copy = false)[1][2]) +base_ring_type(::Type{RelNumFieldOrder{T, S, U}}) where {T, S, U} = order_type(base_ring_type(NumField{T})) + elem_type(::Type{RelNumFieldOrder{T, S, U}}) where {T, S, U} = RelNumFieldOrderElem{T, U} ideal_type(::RelNumFieldOrder{T, S, U}) where {T, S, U} = RelNumFieldOrderIdeal{T, S, U} diff --git a/src/NumFieldOrd/NfRelOrd/ResidueRing.jl b/src/NumFieldOrd/NfRelOrd/ResidueRing.jl index 5facd851dd..9b4d3afd35 100644 --- a/src/NumFieldOrd/NfRelOrd/ResidueRing.jl +++ b/src/NumFieldOrd/NfRelOrd/ResidueRing.jl @@ -11,6 +11,8 @@ end base_ring(Q::RelOrdQuoRing) = Q.base_ring +base_ring_type(::Type{RelOrdQuoRing{T1, T2, T3}}) where {T1, T2, T3} = T1 + ideal(Q::RelOrdQuoRing) = Q.ideal basis_pmatrix(Q::RelOrdQuoRing) = Q.basis_pmatrix diff --git a/src/QuadForm/Quad/Spaces.jl b/src/QuadForm/Quad/Spaces.jl index 155f7fe42c..dd1668dde0 100644 --- a/src/QuadForm/Quad/Spaces.jl +++ b/src/QuadForm/Quad/Spaces.jl @@ -2068,6 +2068,7 @@ end local_quad_space_class(K, prime::IntegerUnion, n, d, hasse_inv, k)=local_quad_space_class(K,ideal(ZZ,prime),n,d,hasse_inv,k) base_ring(G::LocalQuadSpaceCls) = G.K +base_ring_type(::Type{LocalQuadSpaceCls{S, T, U}}) where {S, T, U} = S prime(G::LocalQuadSpaceCls) = G.p @doc raw""" @@ -2406,6 +2407,8 @@ det_ndeg(g::QuadSpaceCls) = det_nondegenerate_part(g) base_ring(g::QuadSpaceCls) = g.K +base_ring_type(::Type{QuadSpaceCls{S, T, U, V}}) where {S, T, U, V} = S + @doc raw""" dim_radical(g::QuadSpaceCls) -> Int diff --git a/src/QuadForm/Quad/ZLattices.jl b/src/QuadForm/Quad/ZLattices.jl index 5793418dfd..9d120a6b99 100644 --- a/src/QuadForm/Quad/ZLattices.jl +++ b/src/QuadForm/Quad/ZLattices.jl @@ -13,6 +13,8 @@ ambient_space(L::ZZLat) = L.space base_ring(L::ZZLat) = FlintZZ +base_ring_type(::Type{ZZLat}) = ZZRing + base_field(L::ZZLat) = base_ring(gram_matrix(ambient_space(L))) ################################################################################ diff --git a/src/QuadForm/QuadBin.jl b/src/QuadForm/QuadBin.jl index 657ffc2707..650c2069b8 100644 --- a/src/QuadForm/QuadBin.jl +++ b/src/QuadForm/QuadBin.jl @@ -92,6 +92,8 @@ end base_ring(f::QuadBin{T}) where {T} = f.base_ring::parent_type(T) +base_ring_type(::Type{QuadBin{T}}) where {T} = parent_type(T) + ############################################################################### # # Coefficients diff --git a/src/RCF/class_fields.jl b/src/RCF/class_fields.jl index d112a60464..8e2206b2c2 100644 --- a/src/RCF/class_fields.jl +++ b/src/RCF/class_fields.jl @@ -62,6 +62,8 @@ function base_ring(A::ClassField) return order(codomain(A.rayclassgroupmap)) end +base_ring_type(A::ClassField) = AbsNumFieldOrder{AbsSimpleNumField, AbsSimpleNumFieldElem} + @doc raw""" base_field(A::ClassField) diff --git a/src/Sparse/Matrix.jl b/src/Sparse/Matrix.jl index ed56fdb869..e9fd695946 100644 --- a/src/Sparse/Matrix.jl +++ b/src/Sparse/Matrix.jl @@ -17,6 +17,8 @@ end base_ring(A::SMatSpace{T}) where {T} = A.base_ring::parent_type(T) +base_ring_type(::Type{SMatSpace{T}}) where {T} = parent_type(T) + parent(A::SMat) = SMatSpace(base_ring(A), A.r, A.c) base_ring(A::SMat{T}) where {T} = A.base_ring::parent_type(T) diff --git a/src/Sparse/Row.jl b/src/Sparse/Row.jl index f08709cf10..26756935e0 100644 --- a/src/Sparse/Row.jl +++ b/src/Sparse/Row.jl @@ -25,6 +25,8 @@ function base_ring(A::SRow{T}) where {T} end end +base_ring_type(::Type{SRow{T}}) where {T} = parent_type(T) + ==(x::SRow{T}, y::SRow{T}) where {T} = (x.pos == y.pos) && (x.values == y.values) ################################################################################