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

Adjust to addeq! changes #1612

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ GAPExt = "GAP"
PolymakeExt = "Polymake"

[compat]
AbstractAlgebra = "^0.42.0"
AbstractAlgebra = "^0.43.1"
Dates = "1.6"
Distributed = "1.6"
GAP = "0.9.6, 0.10, 0.11"
Expand Down
15 changes: 0 additions & 15 deletions examples/Round2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,6 @@ function Hecke.add!(a::OrderElem, b::OrderElem, c::OrderElem)
return a
end

function Hecke.addeq!(a::OrderElem, b::OrderElem)
a.data = Hecke.addeq!(a.data, b.data)
return a
end

function Hecke.tr(a::OrderElem)
return parent(a).R(trace(a.data))
end
Expand Down Expand Up @@ -936,16 +931,6 @@ function Hecke.add!(a::HessQRElem, b::HessQRElem, c::HessQRElem)
return a
end

function Hecke.addeq!(a::HessQRElem, b::HessQRElem)
d = a+b
@assert parent(a.f) == parent(d.f)
@assert parent(a.g) == parent(d.g)
a.c = d.c
a.f = d.f
a.g = d.g
return a
end

function divrem(a::HessQRElem, b::HessQRElem)
check_parent(a, b)
if iszero(b)
Expand Down
4 changes: 2 additions & 2 deletions examples/Suri.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Suri
using Hecke
import Hecke: valuation, divexact, parent_type, elem_type, mul!, addeq!, parent
import Hecke: valuation, divexact, parent_type, elem_type, mul!, add!, parent
import Base: +, -, *, ^

#= follows Sebastian Posur's idea
Expand Down Expand Up @@ -293,7 +293,7 @@ divexact(a::RRSelem, b::RRSelem; check::Bool=true) = RRSelem(a.R, [mod(a.x[i]*in
(R::RRS)(a::Integer) = RRSelem(R, a)
(R::RRS)(a::RRSelem) = a

function addeq!(a::RRSelem, b::RRSelem)
function add!(a::RRSelem, b::RRSelem)
for i=1:length(a.x)
a.x[i] = mod(a.x[i] + b.x[i], a.R.p[i])
a.r = mod(a.r + b.r , a.R.r)
Expand Down
4 changes: 2 additions & 2 deletions ext/GAPExt/fields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ function Base.push!(G::AbstractAlgebra.Generic.geobucket{T}, p::T) where {T <: A
G.buckets[j] = zero(R)
end
end
G.buckets[i] = addeq!(G.buckets[i], p)
G.buckets[i] = add!(G.buckets[i], p)
while i <= G.len
if length(G.buckets[i]) >= 4^i
G.buckets[i + 1] = addeq!(G.buckets[i + 1], G.buckets[i])
G.buckets[i + 1] = add!(G.buckets[i + 1], G.buckets[i])
G.buckets[i] = R()
i += 1
end
Expand Down
6 changes: 3 additions & 3 deletions src/AlgAss/AbsAlgAss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ base_ring(A::AbstractAssociativeAlgebra)

Return the zero ring as an algebra over the field $K$.

The optional first argument determines the type of the algebra, and can be
The optional first argument determines the type of the algebra, and can be
`StructureConstantAlgebra` (default) or `MatrixAlgebra`.

# Examples
Expand Down Expand Up @@ -354,7 +354,7 @@ function _add_row_to_rref!(M::MatElem{T}, v::Vector{T}, pivot_rows::Vector{Int},
end

s = mul!(s, t, Mrj)
v[j] = addeq!(v[j], s)
v[j] = add!(v[j], s)
end
v[c] = zero!(v[c])
end
Expand Down Expand Up @@ -383,7 +383,7 @@ function _add_row_to_rref!(M::MatElem{T}, v::Vector{T}, pivot_rows::Vector{Int},
t = -Mrp
for c = pivot_col + 1:ncols(M)
s = mul!(s, t, v[c])
M[r, c] = addeq!(M[r, c], s)
M[r, c] = add!(M[r, c], s)
end
M[r, pivot_col] = zero(base_ring(M))
end
Expand Down
10 changes: 0 additions & 10 deletions src/AlgAss/AlgMatElem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,6 @@ function mul!(c::T, a::T, b::T) where {T <: MatAlgebraElem}
return c
end

function addeq!(b::T, a::T) where {T <: MatAlgebraElem}
parent(a) != parent(b) && error("Parents don't match.")
A = parent(a)

b.matrix = addeq!(b.matrix, a.matrix)
b.has_coeffs = false

return b
end

function mul!(c::MatAlgebraElem{T}, a::MatAlgebraElem{T}, b::T) where {T}
parent(c) !== parent(a) && error("Parents don't match.")
A = parent(a)
Expand Down
11 changes: 0 additions & 11 deletions src/AlgAss/Elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,6 @@ function add!(c::AbstractAssociativeAlgebraElem{T}, a::AbstractAssociativeAlgebr
return c
end

function addeq!(b::AbstractAssociativeAlgebraElem{T}, a::AbstractAssociativeAlgebraElem{T}) where {T}
parent(a) != parent(b) && error("Parents don't match.")
A = parent(a)

for i = 1:dim(A)
b.coeffs[i] = addeq!(coefficients(b, copy = false)[i], coefficients(a, copy = false)[i])
end

return b
end

function mul!(c::AbstractAssociativeAlgebraElem{T}, a::AbstractAssociativeAlgebraElem{T}, b::T) where {T}
parent(a) != parent(c) && error("Parents don't match.")

Expand Down
6 changes: 0 additions & 6 deletions src/AlgAssAbsOrd/Elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,6 @@ end
#
################################################################################

function addeq!(x::T, y::T) where { T <: Union{ AlgAssAbsOrdElem, AlgAssRelOrdElem } }
x.elem_in_algebra = addeq!(elem_in_algebra(x, copy = false), elem_in_algebra(y, copy = false))
x.has_coord = false
return x
end

function add!(z::T, x::T, y::T) where { T <: Union{ AlgAssAbsOrdElem, AlgAssRelOrdElem } }
z.elem_in_algebra = add!(elem_in_algebra(z, copy = false), elem_in_algebra(x, copy = false), elem_in_algebra(y, copy = false))
z.has_coord = false
Expand Down
2 changes: 1 addition & 1 deletion src/AlgAssAbsOrd/PicardGroup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ function _picard_group_non_maximal(O::AlgAssAbsOrd, prepare_ref_disc_log::Bool =
end

Q[i, j] = div(-C[i, j], R.snf[j]) + 1
C[i, j] = addeq!(C[i, j], R.snf[j]*Q[i, j])
C[i, j] = add!(C[i, j], R.snf[j]*Q[i, j])
end
end

Expand Down
4 changes: 0 additions & 4 deletions src/FunField/DegreeLocalization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ function mul!(a::KInftyElem{T}, b::KInftyElem{T}, c::KInftyElem{T}) where {T}
return b*c
end

function addeq!(a::KInftyElem{T}, b::KInftyElem{T}) where {T}
return a+b
end

###############################################################################
#
# Comparison
Expand Down
10 changes: 0 additions & 10 deletions src/FunField/HessQR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,6 @@ function Hecke.add!(a::HessQRElem, b::HessQRElem, c::HessQRElem)
return a
end

function Hecke.addeq!(a::HessQRElem, b::HessQRElem)
d = a+b
@assert parent(a.f) == parent(d.f)
@assert parent(a.g) == parent(d.g)
a.c = d.c
a.f = d.f
a.g = d.g
return a
end

function divrem(a::HessQRElem, b::HessQRElem)
check_parent(a, b)
if iszero(b)
Expand Down
5 changes: 0 additions & 5 deletions src/GenOrd/GenOrd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,6 @@ function add!(a::GenOrdElem, b::GenOrdElem, c::GenOrdElem)
return a
end

function addeq!(a::GenOrdElem, b::GenOrdElem)
a.data = Hecke.addeq!(a.data, b.data)
return a
end

################################################################################
#
# Trace and norm
Expand Down
7 changes: 0 additions & 7 deletions src/LocalField/Elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -617,13 +617,6 @@ function add!(c::LocalFieldElem{S, T}, a::LocalFieldElem{S, T}, b::LocalFieldEle
return c
end

function addeq!(c::LocalFieldElem{S, T}, a::LocalFieldElem{S, T}) where {S <: FieldElem, T <: LocalFieldParameter}
check_parent(a, c)
c.data = add!(c.data, c.data, a.data)
c.precision = min(a.precision, c.precision)
return c
end

function sub!(c::LocalFieldElem{S, T}, a::LocalFieldElem{S, T}, b::LocalFieldElem{S, T}) where {S <: FieldElem, T <: LocalFieldParameter}
check_parent(a, b)
c.parent = a.parent
Expand Down
5 changes: 0 additions & 5 deletions src/LocalField/PowerSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,6 @@ function add!(a::LaurentSeriesFieldValuationRingElem, b::LaurentSeriesFieldValua
return a
end

function addeq!(a::LaurentSeriesFieldValuationRingElem, b::LaurentSeriesFieldValuationRingElem)
a.a = addeq!(data(a), data(b))
return a
end

################################################################################
#
# Promotion
Expand Down
7 changes: 0 additions & 7 deletions src/LocalField/ResidueRing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,6 @@ function add!(c::LocalFieldValuationRingResidueRingElem, a::LocalFieldValuationR
return c
end

function addeq!(a::LocalFieldValuationRingResidueRingElem, b::LocalFieldValuationRingResidueRingElem)
@req parent(a) === parent(b) "Parents do not match"
a.a = addeq!(data(a), data(b))
a.a = setprecision!(a.a, _exponent(parent(a)))
return a
end

################################################################################
#
# Promotion
Expand Down
5 changes: 0 additions & 5 deletions src/LocalField/Ring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,6 @@ function add!(a::LocalFieldValuationRingElem, b::LocalFieldValuationRingElem, c:
return a
end

function addeq!(a::LocalFieldValuationRingElem, b::LocalFieldValuationRingElem)
a.x = addeq!(data(a), data(b))
return a
end

################################################################################
#
# Promotion
Expand Down
Loading
Loading