diff --git a/examples/Round2.jl b/examples/Round2.jl index 5f1ffaa3c1..f61457729e 100644 --- a/examples/Round2.jl +++ b/examples/Round2.jl @@ -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 @@ -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) diff --git a/examples/Suri.jl b/examples/Suri.jl index 64861f310a..9cfce70392 100644 --- a/examples/Suri.jl +++ b/examples/Suri.jl @@ -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 @@ -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) diff --git a/ext/GAPExt/fields.jl b/ext/GAPExt/fields.jl index 410a5b4184..2c22098fcb 100644 --- a/ext/GAPExt/fields.jl +++ b/ext/GAPExt/fields.jl @@ -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 diff --git a/src/AlgAss/AbsAlgAss.jl b/src/AlgAss/AbsAlgAss.jl index 550354f0b0..00d854684b 100644 --- a/src/AlgAss/AbsAlgAss.jl +++ b/src/AlgAss/AbsAlgAss.jl @@ -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 @@ -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 @@ -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 diff --git a/src/AlgAss/AlgMatElem.jl b/src/AlgAss/AlgMatElem.jl index 7da76f1540..4d6800d87d 100644 --- a/src/AlgAss/AlgMatElem.jl +++ b/src/AlgAss/AlgMatElem.jl @@ -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) diff --git a/src/AlgAss/Elem.jl b/src/AlgAss/Elem.jl index d26f167d72..8347287191 100644 --- a/src/AlgAss/Elem.jl +++ b/src/AlgAss/Elem.jl @@ -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.") diff --git a/src/AlgAssAbsOrd/Elem.jl b/src/AlgAssAbsOrd/Elem.jl index f5110fb4f2..35943ae90e 100644 --- a/src/AlgAssAbsOrd/Elem.jl +++ b/src/AlgAssAbsOrd/Elem.jl @@ -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 diff --git a/src/AlgAssAbsOrd/PicardGroup.jl b/src/AlgAssAbsOrd/PicardGroup.jl index 179a82f8b1..e391eb7558 100644 --- a/src/AlgAssAbsOrd/PicardGroup.jl +++ b/src/AlgAssAbsOrd/PicardGroup.jl @@ -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 diff --git a/src/FunField/DegreeLocalization.jl b/src/FunField/DegreeLocalization.jl index 8e5fa2c27c..58283ff8cf 100644 --- a/src/FunField/DegreeLocalization.jl +++ b/src/FunField/DegreeLocalization.jl @@ -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 diff --git a/src/FunField/HessQR.jl b/src/FunField/HessQR.jl index b603d756a1..360e617d36 100644 --- a/src/FunField/HessQR.jl +++ b/src/FunField/HessQR.jl @@ -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) diff --git a/src/GenOrd/GenOrd.jl b/src/GenOrd/GenOrd.jl index 9cf13a6790..1eae41895e 100644 --- a/src/GenOrd/GenOrd.jl +++ b/src/GenOrd/GenOrd.jl @@ -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 diff --git a/src/LocalField/Elem.jl b/src/LocalField/Elem.jl index 15d6b5038f..2d71b034fa 100644 --- a/src/LocalField/Elem.jl +++ b/src/LocalField/Elem.jl @@ -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 diff --git a/src/LocalField/PowerSeries.jl b/src/LocalField/PowerSeries.jl index 59e6624d8a..6dd16244e6 100644 --- a/src/LocalField/PowerSeries.jl +++ b/src/LocalField/PowerSeries.jl @@ -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 diff --git a/src/LocalField/ResidueRing.jl b/src/LocalField/ResidueRing.jl index 9dd99de547..efc28832f8 100644 --- a/src/LocalField/ResidueRing.jl +++ b/src/LocalField/ResidueRing.jl @@ -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 diff --git a/src/LocalField/Ring.jl b/src/LocalField/Ring.jl index 513949ba18..ee2873978c 100644 --- a/src/LocalField/Ring.jl +++ b/src/LocalField/Ring.jl @@ -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 diff --git a/src/Misc/HNFstorjohann.jl b/src/Misc/HNFstorjohann.jl index b41adbd065..fdbfe39121 100644 --- a/src/Misc/HNFstorjohann.jl +++ b/src/Misc/HNFstorjohann.jl @@ -32,8 +32,8 @@ function conditioning_with_transform!(T::MatElem{S}, N::MatElem{S}, CC::Array{S} N[2, 2] = deepcopy(T[row1, col2]) # Make sure the rows row and row1 are linearly independent if i != row1 - N[2, 1] = addeq!(N[2, 1], T[i, col1]) - N[2, 2] = addeq!(N[2, 2], T[i, col2]) + N[2, 1] = add!(N[2, 1], T[i, col1]) + N[2, 2] = add!(N[2, 2], T[i, col2]) s = i end break @@ -54,12 +54,12 @@ function conditioning_with_transform!(T::MatElem{S}, N::MatElem{S}, CC::Array{S} end q1, r1 = divrem(divexact(N[2, 1], g), N[1, 1]) if r1 < 0 - addeq!(r1, N[1, 1]) + add!(r1, N[1, 1]) q1 = q1 - 1 end q2, r2 = divrem(divexact(T[l, col1], g), N[1, 1]) if r2 < 0 - addeq!(r2, N[1, 1]) + add!(r2, N[1, 1]) q2 = q2 - 1 end t1 = mul!(t1, N[1, 1], T[l, col2]) @@ -78,7 +78,7 @@ function conditioning_with_transform!(T::MatElem{S}, N::MatElem{S}, CC::Array{S} t1 = zero!(t1) t2 = deepcopy(r1) while gcd(t2, N[1, 1]) != 1 - t2 = addeq!(t2, r2) + t2 = add!(t2, r2) t1 += 1 end if !iszero(t1) @@ -88,9 +88,9 @@ function conditioning_with_transform!(T::MatElem{S}, N::MatElem{S}, CC::Array{S} CC[l] = deepcopy(t1) zero_cols[l] = false t = mul!(t, T[l, col1], t1) - N[2, 1] = addeq!(N[2, 1], t) + N[2, 1] = add!(N[2, 1], t) t = mul!(t, T[l, col2], t1) - N[2, 2] = addeq!(N[2, 2], t) + N[2, 2] = add!(N[2, 2], t) end end if s > row1 @@ -153,7 +153,7 @@ function column_reduction_with_transform!(T::MatElem{S}, N::MatElem{S}, QC::MatE q = -fdiv(t, N[2, 2]) for c = row:row1 t1 = mul!(t1, q, QC[row1, c]) - QC[i, c] = addeq!(QC[i, c], t1) + QC[i, c] = add!(QC[i, c], t1) end end end @@ -163,7 +163,7 @@ function column_reduction_with_transform!(T::MatElem{S}, N::MatElem{S}, QC::MatE if i != row && (T[i, col1] < 0 || T[i, col1] >= N[1, 1]) q = -fdiv(T[i, col1], N[1, 1]) t1 = mul!(t1, q, N[1, 2]) - t = addeq!(t, t1) # this would be T[i, col2] + t = add!(t, t1) # this would be T[i, col2] for c = row:row1 QC[i, c] = mul!(QC[i, c], q, QC[row, c]) end @@ -177,7 +177,7 @@ function column_reduction_with_transform!(T::MatElem{S}, N::MatElem{S}, QC::MatE q = -fdiv(t, N[2, 2]) for c = row:row1 t1 = mul!(t1, q, QC[row1, c]) - QC[i, c] = addeq!(QC[i, c], t1) + QC[i, c] = add!(QC[i, c], t1) end end end @@ -271,7 +271,7 @@ function hnf_storjohann_with_transform(A::MatElem{S}) where S <: Nemo.RingElemen continue end t = mul!(t, CC[i], C[i, j]) - C[row1, j] = addeq!(C[row1, j], t) + C[row1, j] = add!(C[row1, j], t) push!(non_zero_entries[j], row1) end end @@ -303,16 +303,16 @@ function hnf_storjohann_with_transform(A::MatElem{S}) where S <: Nemo.RingElemen end for l = row:n if zero_cols[l] - temp[l] = addeq!(temp[l], Q[l, j]) + temp[l] = add!(temp[l], Q[l, j]) continue end for i = 1:row - 1 t = mul!(t, QC[i, l], Q[l, j]) - Q[i, j] = addeq!(Q[i, j], t) + Q[i, j] = add!(Q[i, j], t) end for i = row:n t = mul!(t, QC[i, l], Q[l, j]) - temp[i] = addeq!(temp[i], t) + temp[i] = add!(temp[i], t) end end for i = row:n @@ -326,16 +326,16 @@ function hnf_storjohann_with_transform(A::MatElem{S}) where S <: Nemo.RingElemen end for l = row:n if zero_cols[l] - temp[l] = addeq!(temp[l], T[l, j]) + temp[l] = add!(temp[l], T[l, j]) continue end for i = 1:row - 1 t = mul!(t, QC[i, l], T[l, j]) - T[i, j] = addeq!(T[i, j], t) + T[i, j] = add!(T[i, j], t) end for i = row:n t = mul!(t, QC[i, l], T[l, j]) - temp[i] = addeq!(temp[i], t) + temp[i] = add!(temp[i], t) end end for i = row:n @@ -354,7 +354,7 @@ function hnf_storjohann_with_transform(A::MatElem{S}) where S <: Nemo.RingElemen for i = 1:n for l in non_zero_entries[j] t = mul!(t, Q[i, l], C[l, j]) - U[i, j] = addeq!(U[i, j], t) + U[i, j] = add!(U[i, j], t) end end end @@ -386,7 +386,7 @@ function conditioning!(T::MatElem{S}, row::Int, col1::Int) where S <: Nemo.RingE # Make sure the rows row and row1 are linearly independent if i != row1 for j = col1:ncols(T) - T[row1, j] = addeq!(T[row1, j], T[i, j]) + T[row1, j] = add!(T[row1, j], T[i, j]) end end break @@ -407,12 +407,12 @@ function conditioning!(T::MatElem{S}, row::Int, col1::Int) where S <: Nemo.RingE end q1, r1 = divrem(divexact(T[row1, col1], g), T[row, col1]) if r1 < 0 - addeq!(r1, T[row, col1]) + add!(r1, T[row, col1]) q1 = q1 - 1 end q2, r2 = divrem(divexact(T[l, col1], g), T[row, col1]) if r2 < 0 - addeq!(r2, T[row, col1]) + add!(r2, T[row, col1]) q2 = q2 - 1 end t1 = mul!(t1, T[row, col1], T[l, col2]) @@ -431,7 +431,7 @@ function conditioning!(T::MatElem{S}, row::Int, col1::Int) where S <: Nemo.RingE t1 = zero!(t1) t2 = deepcopy(r1) while gcd(t2, T[row, col1]) != 1 - t2 = addeq!(t2, r2) + t2 = add!(t2, r2) t1 += 1 end if !iszero(t1) @@ -440,7 +440,7 @@ function conditioning!(T::MatElem{S}, row::Int, col1::Int) where S <: Nemo.RingE end for j = col1:(ncols(T) - 1) t = mul!(t, T[l, j], t1) - T[row1, j] = addeq!(T[row1, j], t) + T[row1, j] = add!(T[row1, j], t) end end end @@ -490,7 +490,7 @@ function column_reduction!(T::MatElem{S}, row::Int, col1::Int, col2::Int) where q = -fdiv(T[i, col2], T[row1, col2]) for j = col11:n t = mul!(t, q, T[row1, j]) - T[i, j] = addeq!(T[i, j], t) + T[i, j] = add!(T[i, j], t) end end end @@ -500,7 +500,7 @@ function column_reduction!(T::MatElem{S}, row::Int, col1::Int, col2::Int) where q = -fdiv(T[i, col1], T[row, col1]) for j = col1:n t = mul!(t, q, T[row, j]) - T[i, j] = addeq!(T[i, j], t) + T[i, j] = add!(T[i, j], t) end end end @@ -510,7 +510,7 @@ function column_reduction!(T::MatElem{S}, row::Int, col1::Int, col2::Int) where q = -fdiv(T[i, col2], T[row1, col2]) for j = col11:n t = mul!(t, q, T[row1, j]) - T[i, j] = addeq!(T[i, j], t) + T[i, j] = add!(T[i, j], t) end end end diff --git a/src/Misc/OrdLocalization.jl b/src/Misc/OrdLocalization.jl index 6bc7bfb101..70b693317c 100644 --- a/src/Misc/OrdLocalization.jl +++ b/src/Misc/OrdLocalization.jl @@ -88,8 +88,6 @@ add!(c::OrdLocElem, a::OrdLocElem, b::OrdLocElem) = a + b mul!(c::OrdLocElem, a::OrdLocElem, b::OrdLocElem) = a * b -addeq!(a::OrdLocElem, b::OrdLocElem) = a + b - ############################################################################### # # Data type and parent object methods diff --git a/src/Misc/RelFiniteField.jl b/src/Misc/RelFiniteField.jl index 03e2225da2..2c030a6177 100644 --- a/src/Misc/RelFiniteField.jl +++ b/src/Misc/RelFiniteField.jl @@ -285,13 +285,6 @@ function sub!(z::RelFinFieldElem{S, T}, x::RelFinFieldElem{S, T}, y::RelFinField return z end - -function addeq!(z::RelFinFieldElem{S, T}, x::RelFinFieldElem{S, T}) where {S, T} - z.data = add!(z.data, z.data, x.data) - z.data = rem!(z.data, z.data, defining_polynomial(parent(z))) - return z -end - function Base.div(x::RelFinFieldElem{S, T}, y::RelFinFieldElem{S, T}) where {S, T} return x*inv(y) end diff --git a/src/NumField/NfAbs/ConjugatesNS.jl b/src/NumField/NfAbs/ConjugatesNS.jl index 9dd6bb18cb..e0b8a84e20 100644 --- a/src/NumField/NfAbs/ConjugatesNS.jl +++ b/src/NumField/NfAbs/ConjugatesNS.jl @@ -166,13 +166,13 @@ function _evaluate(f::QQMPolyRingElem, vals::Vector{AcbFieldElem}) j = i = i + 1 while iseven(j) && length(r) > 1 top = pop!(r) - r[end] = addeq!(r[end], top) + r[end] = add!(r[end], top) j >>>= 1 end end while length(r) > 1 top = pop!(r) - r[end] = addeq!(r[end], top) + r[end] = add!(r[end], top) end return r[1] end diff --git a/src/NumField/NfAbs/NonSimple.jl b/src/NumField/NfAbs/NonSimple.jl index e371c4823f..114c722fc9 100644 --- a/src/NumField/NfAbs/NonSimple.jl +++ b/src/NumField/NfAbs/NonSimple.jl @@ -372,13 +372,6 @@ function Nemo.add!(c::AbsNonSimpleNumFieldElem, a::AbsNonSimpleNumFieldElem, b:: return c end -function Nemo.addeq!(b::AbsNonSimpleNumFieldElem, a::AbsNonSimpleNumFieldElem) - addeq!(b.data, a.data) - b = reduce!(b) - return b -end - - function Nemo.mul!(c::AbsNonSimpleNumFieldElem, a::AbsNonSimpleNumFieldElem, b::ZZRingElem) mul!(c.data, a.data, b) return c diff --git a/src/NumField/NfRel/NfRel.jl b/src/NumField/NfRel/NfRel.jl index 42df95b126..44e77b59c7 100644 --- a/src/NumField/NfRel/NfRel.jl +++ b/src/NumField/NfRel/NfRel.jl @@ -419,12 +419,6 @@ function mul!(c::RelSimpleNumFieldElem{T}, a::RelSimpleNumFieldElem{T}, b::T) wh return c end -function addeq!(b::RelSimpleNumFieldElem{T}, a::RelSimpleNumFieldElem{T}) where {T} - addeq!(b.data, a.data) - b = reduce!(b) - return b -end - function add!(c::RelSimpleNumFieldElem{T}, a::RelSimpleNumFieldElem{T}, b::RelSimpleNumFieldElem{T}) where {T} add!(c.data, a.data, b.data) c = reduce!(c) diff --git a/src/NumField/NfRel/NfRelNS.jl b/src/NumField/NfRel/NfRelNS.jl index 6a27d7cf4b..951cfc65e6 100644 --- a/src/NumField/NfRel/NfRelNS.jl +++ b/src/NumField/NfRel/NfRelNS.jl @@ -344,11 +344,6 @@ function Nemo.mul!(c::RelNonSimpleNumFieldElem{T}, a::RelNonSimpleNumFieldElem{T return a*b end -function Nemo.addeq!(b::RelNonSimpleNumFieldElem{T}, a::RelNonSimpleNumFieldElem{T}) where {T} - addeq!(b.data, a.data) - return b -end - function Nemo.add!(c::RelNonSimpleNumFieldElem{T}, a::RelNonSimpleNumFieldElem{T}, b::RelNonSimpleNumFieldElem{T}) where {T} c.data = add!(c.data, a.data, b.data) return c diff --git a/src/NumFieldOrd/NfOrd/LinearAlgebra.jl b/src/NumFieldOrd/NfOrd/LinearAlgebra.jl index 9a9692f5d0..b8d04df08d 100644 --- a/src/NumFieldOrd/NfOrd/LinearAlgebra.jl +++ b/src/NumFieldOrd/NfOrd/LinearAlgebra.jl @@ -734,7 +734,7 @@ function pseudo_hnf_mod(P::PMat, m, shape::Symbol = :upperright, strategy = :spl q = q - res.matrix[i, j] for c = j:ncols(res) mul!(t, q, res.matrix[j, c]) - addeq!(res.matrix[i, c], t) + add!(res.matrix[i, c], t) end end end @@ -750,7 +750,7 @@ function pseudo_hnf_mod(P::PMat, m, shape::Symbol = :upperright, strategy = :spl q = q - res.matrix[i, j] for c = 1:j mul!(t, q, res.matrix[j + shift, c]) - addeq!(res.matrix[i, c], t) + add!(res.matrix[i, c], t) end end end @@ -1059,7 +1059,7 @@ function pseudo_hnf_cohen!(H::PMat, U::Generic.Mat{T}, with_transform::Bool = fa for c = i:n t = deepcopy(A[j, c]) mul!(t1, A[k, c], -Aji) - addeq!(A[j, c], t1) + add!(A[j, c], t1) mul!(t1, t, u) mul!(t2, A[k, c], v) add!(A[k, c], t1, t2) @@ -1068,7 +1068,7 @@ function pseudo_hnf_cohen!(H::PMat, U::Generic.Mat{T}, with_transform::Bool = fa for c = 1:m t = deepcopy(U[j, c]) mul!(t1, U[k, c], -Aji) - addeq!(U[j, c], t1) + add!(U[j, c], t1) mul!(t1, t, u) mul!(t2, U[k, c], v) add!(U[k, c], t1, t2) @@ -1091,12 +1091,12 @@ function pseudo_hnf_cohen!(H::PMat, U::Generic.Mat{T}, with_transform::Bool = fa q = q - A[j, k] for c = k:n mul!(t, q, A[k, c]) - addeq!(A[j, c], t) + add!(A[j, c], t) end if with_transform for c = 1:m mul!(t, q, U[k, c]) - addeq!(U[j, c], t) + add!(U[j, c], t) end end end @@ -1123,7 +1123,7 @@ function _in_span(v::Vector{AbsSimpleNumFieldElem}, P::PMat) s = K() for j = 1:k-1 mul!(t, P.matrix[j, i], x[j]) - addeq!(s, t) + add!(s, t) end s = v[i] - s if iszero(P.matrix[k, i]) @@ -1213,12 +1213,12 @@ function kb_reduce_row!(H::PMat{T, S}, U::Generic.Mat{T}, pivot::Vector{Int}, c: q = q - A[r, i] for j = i:ncols(A) mul!(t, q, A[p,j]) - addeq!(A[r,j], t) + add!(A[r,j], t) end if with_transform for j = 1:ncols(U) mul!(t, q, U[p,j]) - addeq!(U[r,j], t) + add!(U[r,j], t) end end end @@ -1242,12 +1242,12 @@ function kb_reduce_column!(H::PMat{T, S}, U::Generic.Mat{T}, pivot::Vector{Int}, q = q - A[p, c] for j = c:ncols(A) mul!(t, q, A[r,j]) - addeq!(A[p,j], t) + add!(A[p,j], t) end if with_transform for j = 1:ncols(U) mul!(t, q, U[r,j]) - addeq!(U[p,j], t) + add!(U[p,j], t) end end end @@ -1361,8 +1361,8 @@ function pseudo_hnf_kb!(H::PMat{T, S}, U::Generic.Mat{T}, with_transform::Bool = t = deepcopy(A[i, c]) #t1 = mul!(t1, A[p, c], -Aij) mul!(t1, A[p, c], -Aij) - #A[i, c] = addeq!(A[i, c], t1) - addeq!(A[i, c], t1) + #A[i, c] = add!(A[i, c], t1) + add!(A[i, c], t1) #t1 = mul!(t1, t, u) mul!(t1, t, u) #t2 = mul!(t2, A[p, c], v) @@ -1375,8 +1375,8 @@ function pseudo_hnf_kb!(H::PMat{T, S}, U::Generic.Mat{T}, with_transform::Bool = t = deepcopy(U[i, c]) #t1 = mul!(t1, U[p, c], -Aij) mul!(t1, U[p, c], -Aij) - #U[i, c] = addeq!(U[i, c], t1) - addeq!(U[i, c], t1) + #U[i, c] = add!(U[i, c], t1) + add!(U[i, c], t1) #t1 = mul!(t1, t, u) mul!(t1, t, u) #t2 = mul!(t2, U[p, c], v) @@ -1526,7 +1526,7 @@ function kb_clear_row!(S::PMat2, K::Generic.Mat{AbsSimpleNumFieldElem}, i::Int, for r = i:m t = deepcopy(A[r, j]) mul!(t1, A[r, i], -Aij) - addeq!(A[r,j], t1) + add!(A[r,j], t1) mul!(t1, t, u) mul!(t2, A[r, i], v) add!(A[r, i], t1, t2) @@ -1535,7 +1535,7 @@ function kb_clear_row!(S::PMat2, K::Generic.Mat{AbsSimpleNumFieldElem}, i::Int, for r = 1:n t = deepcopy(K[r, j]) mul!(t1, K[r, i], -Aij) - addeq!(K[r,j], t1) + add!(K[r,j], t1) mul!(t1, t, u) mul!(t2, K[r, i], v) add!(K[r, i], t1, t2) diff --git a/src/NumFieldOrd/NfOrd/ResidueRing.jl b/src/NumFieldOrd/NfOrd/ResidueRing.jl index 1ef0a2bb94..2006cd71e4 100644 --- a/src/NumFieldOrd/NfOrd/ResidueRing.jl +++ b/src/NumFieldOrd/NfOrd/ResidueRing.jl @@ -272,8 +272,6 @@ function add!(z::AbsOrdQuoRingElem, x::AbsOrdQuoRingElem, y::AbsOrdQuoRingElem) return _easy_mod(z) end -addeq!(x::AbsOrdQuoRingElem, y::AbsOrdQuoRingElem) = add!(x, x, y) - function sub!(z::AbsOrdQuoRingElem, x::AbsOrdQuoRingElem, y::AbsOrdQuoRingElem) z.elem = sub!(z.elem, x.elem, y.elem) z.isreduced = false diff --git a/src/NumFieldOrd/NumFieldOrdElem.jl b/src/NumFieldOrd/NumFieldOrdElem.jl index ee166a68be..ccf98b08ad 100644 --- a/src/NumFieldOrd/NumFieldOrdElem.jl +++ b/src/NumFieldOrd/NumFieldOrdElem.jl @@ -232,16 +232,6 @@ end return z end -function addeq!(z::AbsNumFieldOrderElem, x::AbsNumFieldOrderElem) - addeq!(z.elem_in_nf, x.elem_in_nf) - if x.has_coord && z.has_coord - for i in 1:degree(parent(z)) - add!(z.coordinates[i], z.coordinates[i], x.coordinates[i]) - end - end - return z -end - ################################################################################ # # Unsafe ad hoc operations diff --git a/src/QuadForm/Morphism.jl b/src/QuadForm/Morphism.jl index bf2cd6f79f..f236031698 100644 --- a/src/QuadForm/Morphism.jl +++ b/src/QuadForm/Morphism.jl @@ -551,7 +551,7 @@ function vs_scalar_products(C::ZLatAutoCtx{S, T, V}, dep::Int) where {S, T, V} if k > 0 if !is0 if S <: ZZRingElem - addeq!(vector_sums[I][k], ww) + add!(vector_sums[I][k], ww) else @inbounds for l in 1:dim(C) vector_sums[I][k][l] += ww[l] @@ -2126,7 +2126,7 @@ function _dot_product_with_column!(t::ZZRingElem, v::ZZMatrix, A::ZZMatrix, k::I getindex!(tmp2, v, 1, i) getindex!(tmp3, A, i, k) mul!(tmp1, tmp2, tmp3) - addeq!(t, tmp1) + add!(t, tmp1) end return t end @@ -2151,7 +2151,7 @@ function _dot_product_with_row!(t::ZZRingElem, v::ZZMatrix, A::ZZMatrix, k::Int, getindex!(tmp2, v, 1, i) getindex!(tmp3, A, k, i) mul!(tmp1, tmp2, tmp3) - addeq!(t, tmp1) + add!(t, tmp1) end return t end diff --git a/src/QuadForm/Quad/ZGenus.jl b/src/QuadForm/Quad/ZGenus.jl index a7e9fcdeeb..581f1a4789 100644 --- a/src/QuadForm/Quad/ZGenus.jl +++ b/src/QuadForm/Quad/ZGenus.jl @@ -2236,7 +2236,7 @@ function _mass_squared(G::ZZLocalGenus) # f_2q that are both of type I (odd) for k in 1:r-1 if sym[k][4] == sym[k+1][4] == 1 && sym[k][1] + 1 == sym[k+1][1] - addeq!(nI_I, ZZ(1)) + add!(nI_I, ZZ(1)) end end mul!(m_p, m_p, QQ(2)^(2*(nI_I - nII))) @@ -2349,7 +2349,7 @@ function _gamma_exact(_n) while n != 1//2 if n < 0 mul!(a, a, inv(n)) - addeq!(n, QQ(1)) + add!(n, QQ(1)) elseif n > 0 sub!(n, n, QQ(1)) mul!(a, a, n) diff --git a/src/Sparse/Row.jl b/src/Sparse/Row.jl index f05a0d4594..447324be6f 100644 --- a/src/Sparse/Row.jl +++ b/src/Sparse/Row.jl @@ -385,7 +385,7 @@ function dot(A::SRow{T}, B::SRow{T}) where T return v end if B.pos[b] == A.pos[a] - v += A.values[a] * B.values[b] + v += A.values[a] * B.values[b] end end return v @@ -450,8 +450,8 @@ end @doc raw""" scale_row!(a::SRow, b::NCRingElem) -> SRow -Returns the (left) product of $b \times a$ and reassigns the value of $a$ to this product. -For rows, the standard multiplication is from the left. +Returns the (left) product of $b \times a$ and reassigns the value of $a$ to this product. +For rows, the standard multiplication is from the left. """ function scale_row!(a::SRow{T}, b::T) where T @assert !iszero(b) @@ -709,7 +709,7 @@ function add_scaled_row!(a::SRow{T}, b::SRow{T}, c::T) where T j += 1 else t = mul!(t, c, a.values[i]) - b.values[j] = addeq!(b.values[j], t) + b.values[j] = add!(b.values[j], t) if iszero(b.values[j]) deleteat!(b.values, j) @@ -731,7 +731,7 @@ function add_scaled_row!(a::SRow{T}, b::SRow{T}, c::T) where T return b end -add_scaled_row!(a::SRow{T}, b::SRow{T}, c::T, tmp::SRow{T}) where T = add_scaled_row!(a, b, c) +add_scaled_row!(a::SRow{T}, b::SRow{T}, c::T, tmp::SRow{T}) where T = add_scaled_row!(a, b, c) add_right_scaled_row(a::SRow{T}, b::SRow{T}, c::T) where {T} = add_right_scaled_row!(a, deepcopy(b), c) @@ -756,7 +756,7 @@ function add_right_scaled_row!(a::SRow{T}, b::SRow{T}, c::T) where T j += 1 else t = mul!(t, a.values[i], c) - b.values[j] = addeq!(b.values[j], t) + b.values[j] = add!(b.values[j], t) if iszero(b.values[j]) deleteat!(b.values, j) diff --git a/test/AlgAss/Elem.jl b/test/AlgAss/Elem.jl index 3634e9ed05..b08b5eb9af 100644 --- a/test/AlgAss/Elem.jl +++ b/test/AlgAss/Elem.jl @@ -82,7 +82,7 @@ let A = matrix_algebra(QQ, 2) b = A(matrix(QQ, [3 4; 5 6])) - Hecke.addeq!(b,b) + Hecke.add!(b,b) @test b == A(matrix(QQ, [6 8; 10 12])) end end diff --git a/test/NfOrd/Elem.jl b/test/NfOrd/Elem.jl index ce669aa61f..e13f7a060f 100644 --- a/test/NfOrd/Elem.jl +++ b/test/NfOrd/Elem.jl @@ -117,7 +117,7 @@ c = @inferred add!(c, c, O1(a1^2)) @test b == c c = O1(a1) - c = @inferred addeq!(c, O1(a1^2)) + c = @inferred add!(c, O1(a1^2)) @test b == c @test b == O1(a1 + a1^2)