Skip to content

Commit

Permalink
Prepare deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 8, 2024
1 parent ba531d4 commit 6a728b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/Generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,7 @@ Base.@deprecate_binding ResidueRingElem EuclideanRingResidueRingElem
@deprecate hom(M::DirectSumModule{T}, N::DirectSumModule{T}, mp::Vector{ModuleHomomorphism{T}}) where T hom_direct_sum(M, N, mp)
@deprecate hom(A::DirectSumModule{T}, B::DirectSumModule{T}, M::Matrix{<:Map{<:AbstractAlgebra.FPModule{T}, <:AbstractAlgebra.FPModule{T}}}) where {T} hom_direct_sum(A, B, M)

# Deprecated for 0.44
#Base.@deprecate_binding MatSpace AbstractAlgebra.MatSpace false

end # generic
14 changes: 7 additions & 7 deletions test/generic/Matrix-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ AbstractAlgebra.divexact(x::F2Elem, y::F2Elem) = y.x ? x : throw(DivideError())
Random.rand(rng::AbstractRNG, sp::Random.SamplerTrivial{F2}) = F2Elem(rand(rng, Bool))
Random.gentype(::Type{F2}) = F2Elem

const F2MatSpace = AbstractAlgebra.Generic.MatSpace{F2Elem}
const F2MatSpace = MatSpace{F2Elem}

(S::F2MatSpace)() = zero_matrix(F2(), S.nrows, S.ncols)

Expand Down Expand Up @@ -120,16 +120,16 @@ end
@test S === matrix_space(R, 3, 3)

@test elem_type(S) == Generic.MatSpaceElem{elem_type(R)}
@test elem_type(Generic.MatSpace{elem_type(R)}) == Generic.MatSpaceElem{elem_type(R)}
@test parent_type(Generic.MatSpaceElem{elem_type(R)}) == Generic.MatSpace{elem_type(R)}
@test base_ring_type(Generic.MatSpace{elem_type(R)}) == typeof(R)
@test elem_type(MatSpace{elem_type(R)}) == Generic.MatSpaceElem{elem_type(R)}
@test parent_type(Generic.MatSpaceElem{elem_type(R)}) == MatSpace{elem_type(R)}
@test base_ring_type(MatSpace{elem_type(R)}) == typeof(R)
@test base_ring_type(Generic.MatSpaceElem{elem_type(R)}) == typeof(R)
@test base_ring_type(S) == typeof(R)
@test base_ring(S) == R
@test nrows(S) == 3
@test ncols(S) == 3

@test typeof(S) <: Generic.MatSpace
@test typeof(S) <: MatSpace

f = S(t^2 + 1)

Expand Down Expand Up @@ -353,8 +353,8 @@ end
@test base_ring(S) == R

@test elem_type(S) == Generic.MatSpaceElem{elem_type(R)}
@test elem_type(Generic.MatSpace{elem_type(R)}) == Generic.MatSpaceElem{elem_type(R)}
@test parent_type(Generic.MatSpaceElem{elem_type(R)}) == Generic.MatSpace{elem_type(R)}
@test elem_type(MatSpace{elem_type(R)}) == Generic.MatSpaceElem{elem_type(R)}
@test parent_type(Generic.MatSpaceElem{elem_type(R)}) == MatSpace{elem_type(R)}

@test dense_matrix_type(R) == elem_type(S)
@test dense_matrix_type(R(1)) == elem_type(S)
Expand Down

0 comments on commit 6a728b5

Please sign in to comment.