Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions src/Ideal.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
###############################################################################
#
# Ideal constructor
# Generic functionality for ideals
#
###############################################################################

###############################################################################
#
# Type and parent functions
#
###############################################################################

# fundamental interface
@doc raw"""
ideal_type(R)
ideal_type(::Type{T}) where T

Return the type of ideals over the given ring `R`, respectively over rings of type `T`.
"""
ideal_type(x) = ideal_type(typeof(x))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thofma I tried restricting this to Ring, but it seems Hecke needs ideal_type for NCRing -- namely for Hecke.AlgAssAbsOrd{StructureConstantAlgebra{QQFieldElem}, ZZRing}

ideal_type(T::DataType) = throw(MethodError(ideal_type, (T,)))

# We assume that the function
# ideal(R::T, xs::Vector{U})
# with U === elem_type(T) is implemented by anyone implementing ideals
Expand Down Expand Up @@ -41,7 +57,3 @@ end
iszero(I::Ideal) = all(iszero, gens(I))

base_ring_type(::Type{<:IdealSet{T}}) where T <: RingElement = parent_type(T)

# fundamental interface, to be documented
ideal_type(x) = ideal_type(typeof(x))
ideal_type(T::DataType) = throw(MethodError(ideal_type, (T,)))
2 changes: 2 additions & 0 deletions src/generic/imports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ import ..AbstractAlgebra: gen
import ..AbstractAlgebra: gens
import ..AbstractAlgebra: get_cached!
import ..AbstractAlgebra: hom
import ..AbstractAlgebra: ideal
import ..AbstractAlgebra: ideal_type
import ..AbstractAlgebra: identity_matrix
import ..AbstractAlgebra: image
import ..AbstractAlgebra: image_fn
Expand Down
Loading