Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Imports.jl #224

Merged
merged 3 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 1 addition & 3 deletions src/CharTable.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Base: getindex, eltype, length, iterate

abstract type Table end
abstract type AbstractGenericCharacter end

Expand Down Expand Up @@ -189,7 +187,7 @@ struct SimpleGenericCharacter{T} <: AbstractGenericCharacter
degree::T # Degree of the characters in this type
end

AbstractAlgebra.parent(c::AbstractGenericCharacter) = c.parent
parent(c::AbstractGenericCharacter) = c.parent
getindex(c::AbstractGenericCharacter, i::Integer) = c.values[i]

eltype(::Type{SimpleGenericCharacter{T}}) where T<:NfPoly = T
Expand Down
3 changes: 0 additions & 3 deletions src/GenericCharacter.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import Oscar: tensor_product, norm, scalar_product
import Base: *

# TODO deal with ParameterSubstitution when creating new characters, this is not done in the original implementation.

@doc raw"""
Expand Down
1 change: 1 addition & 0 deletions src/GenericCharacterTables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Oscar.AbstractAlgebra.Generic

const NfPoly = Union{PolyRingElem{QQFieldElem}, PolyRingElem{AbsSimpleNumFieldElem}}

include("Imports.jl")
include("GenericCyclotomics.jl")
include("ParameterExceptions.jl")
include("GenericCyclotomicFractions.jl")
Expand Down
2 changes: 0 additions & 2 deletions src/GenericConjugacyClasses.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Oscar: norm, scalar_product, class_multiplication_coefficient, order, number_of_conjugacy_classes

abstract type AbstractGenericConjugacyClass end

@doc raw"""
Expand Down
3 changes: 0 additions & 3 deletions src/GenericCyclotomicFractions.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import Oscar.AbstractAlgebra: evaluate
import Base: show, isone, iszero, one, zero, conj, inv, +, -, *, //, ==

# This models fractions of sums of cyclotomics.
# The simplification is currently only very basic.
# According to the original implementation
Expand Down
13 changes: 1 addition & 12 deletions src/GenericCyclotomics.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
using Oscar.Random: Random, SamplerTrivial, GLOBAL_RNG
using Oscar.RandomExtensions: RandomExtensions, Make2, AbstractRNG

import Oscar.AbstractAlgebra: parent_type, elem_type, base_ring, base_ring_type, parent, is_domain_type,
is_exact_type, canonical_unit, isequal, divexact, zero!, mul!, add!, get_cached!, is_unit,
characteristic, Ring, RingElem, expressify, evaluate, normal_form, divexact
import Oscar: pretty, Indent, Dedent
import Base: show, +, -, *, ^, ==, inv, isone, iszero, one, zero, rand, deepcopy_internal, hash, conj, promote_rule

import Compat

if Compat.pkgversion(Oscar.AbstractAlgebra) >= v"0.42.0"
if pkgversion(Oscar.AbstractAlgebra) >= v"0.42.0"
const ZZUPoly = Generic.UnivPoly{ZZRingElem}
const UPoly = Generic.UnivPoly{QQFieldElem}
const UPolyRing = Generic.UniversalPolyRing{QQFieldElem}
Expand Down
69 changes: 69 additions & 0 deletions src/Imports.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import Base:
*,
+,
-,
//,
==,
^,
conj,
deepcopy_internal,
eltype,
getindex,
hash,
inv,
isone,
iszero,
iterate,
length,
one,
promote_rule,
rand,
show,
zero

import Compat:
pkgversion

import Oscar.Random:
GLOBAL_RNG,
Random,
SamplerTrivial

import Oscar.RandomExtensions:
AbstractRNG,
RandomExtensions,
Make2

import Oscar:
add!,
base_ring,
base_ring_type,
canonical_unit,
characteristic,
class_multiplication_coefficient,
Dedent,
degree,
divexact,
elem_type,
evaluate,
expressify,
get_cached!,
Indent,
is_domain_type,
isequal,
is_exact_type,
is_unit,
mul!,
norm,
normal_form,
number_of_conjugacy_classes,
order,
parent,
parent_type,
pretty,
Ring,
RingElem,
scalar_product,
tensor_product,
zero!

2 changes: 0 additions & 2 deletions src/Parameter.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Base: show, getindex, eltype, length, iterate

@doc raw"""
Parameter

Expand Down
2 changes: 0 additions & 2 deletions src/ParameterExceptions.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Oscar.AbstractAlgebra: evaluate

@doc raw"""
is_integer(x::UPolyFrac)

Expand Down
3 changes: 0 additions & 3 deletions src/Show.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import Oscar: order, degree, number_of_conjugacy_classes, pretty, Indent, Dedent
import Base: show

# TODO PrintValPhi, PrintToTex?

@doc raw"""
Expand Down
2 changes: 0 additions & 2 deletions src/SumProc.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Oscar.AbstractAlgebra: evaluate

@doc raw"""
evaluate(a::Union{GenericCyclo,GenericCycloFrac}, vars::Vector{UPoly}, vals::Vector{<:RingElement})

Expand Down
Loading