Recent deprecations

15 views
Skip to first unread message

Bill Hart

unread,
Mar 22, 2021, 5:57:57 AM3/22/21
to nemo-devel, osca...@mathematik.uni-kl.de
Hi all,

Recently we decided to deprecate the following:

lead -> leading_coefficient
trail -> trailing_coefficient (doesn't return the constant coefficient
but the last nonzero coeff)
lt -> leading_term
lm -> leading_monomial
lc -> leading_coefficient
coeffs -> coefficients

These changes have been made against all our repos and all of them
will have new releases with these changes shortly (most already do).

In addition, we decided to deprecate:

map_coeffs -> map_coefficients

These changes are available in PRs now and will presumably be merged
in new versions some time this week. The old names will continue to
work until the deprecations are removed, but I think it is better if
new PRs use the new names.

We have not yet made a decision on whether coeff(f, i) will be
deprecated for coefficient(f, i). This is a rather massive change and
we have other similar functions like polcoeff, setcoeff!,
taylor_get_coeffs. Some of these jibe to some degree with Julia's
getindex and setindex! which may be considered analogous.

There are other things like and Julia's setprecision vs our
set_precision! that still stand out as well. Perfect consistency is
probably not possible.

Bill.

Bill Hart

unread,
Mar 22, 2021, 6:42:49 AM3/22/21
to Wolfram Decker, nemo-devel, osca...@mathematik.uni-kl.de
I've opened tickets for this [1, 2].

[1] https://github.com/Nemocas/AbstractAlgebra.jl/issues/815
[2] https://github.com/oscar-system/Singular.jl/issues/397

On Mon, 22 Mar 2021 at 11:15, Wolfram Decker
<dec...@mathematik.uni-kl.de> wrote:
>
> Hi Bill,
>
> I think we should also have:
>
> tail : everything but the leading term.
>
> Best,
> Wolfram
> _______________________________________________
> Oscar-dev mailing list
> Osca...@mathematik.uni-kl.de
> https://mail.mathematik.uni-kl.de/mailman/listinfo/oscar-dev
>
>
> --
> Wolfram Decker | University of Kaiserslautern
> Professor | Department of Mathematics
> dec...@mathematik.uni-kl.de | Building 48 - Room 435
> P.O. Box 3049 | D-67653 Kaiserslautern
> phone +49 631 205-2253 | fax +49 631 205-4795
>

Bill Hart

unread,
Mar 22, 2021, 7:18:39 AM3/22/21
to Wolfram Decker, nemo-devel, osca...@mathematik.uni-kl.de
Although it is not exactly what you asked for, there is a way to get
the tail of any of our current iterators (coefficients,
exponent_vectors, monomials):

julia> using Base.Iterators

julia> using AbstractAlgebra

julia> R, (x, y) = PolynomialRing(ZZ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Integers,
AbstractAlgebra.Generic.MPoly{BigInt}[x, y])

julia> f = 3x^2*y^2 + 2x^2*y + x*y + y + 7
3*x^2*y^2 + 2*x^2*y + x*y + y + 7

julia> using Base.Iterators

julia> tail(f) = drop(coefficients(f), 1)
tail (generic function with 1 method)

julia> for c in tail(f)
println(c)
end
2
1
1
7

julia> trailing_terms(f) = drop(zip(coefficients(f), monomials(f)), 1)
trailing_terms (generic function with 1 method)

julia> collect(trailing_terms(f))
4-element Array{Tuple{Any,Any},1}:
(2, x^2*y)
(1, x*y)
(1, y)
(7, 1)
Reply all
Reply to author
Forward
0 new messages