Skip to content

refactor: evaluate/subst for univariate polynomials #3944

refactor: evaluate/subst for univariate polynomials

refactor: evaluate/subst for univariate polynomials #3944

Triggered via pull request December 25, 2024 17:50
Status Failure
Total duration 19m 48s
Artifacts

CI.yml

on: pull_request
Matrix: test
Fit to window
Zoom out
Zoom in

Annotations

9 errors and 1 notice
test (1.10, macOS-latest)
Process completed with exit code 1.
test (1.6, ubuntu-latest)
Process completed with exit code 1.
test (1.10, ubuntu-latest)
Process completed with exit code 1.
Documentation: docs/src/polynomial.md#L783
doctest failure in src/polynomial.md:783-819 ```jldoctest julia> R, x = polynomial_ring(ZZ, :x) (Univariate polynomial ring in x over integers, x) julia> S, y = polynomial_ring(R, :y) (Univariate polynomial ring in y over R, y) julia> f = x*y^2 + (x + 1)*y + 3 x*y^2 + (x + 1)*y + 3 julia> g = (x + 1)*y + (x^3 + 2x + 2) (x + 1)*y + x^3 + 2*x + 2 julia> M = R[x + 1 2x; x - 3 2x - 1] [x + 1 2*x] [x - 3 2*x - 1] julia> k = evaluate(f, 3) 12*x + 6 julia> m = evaluate(f, x^2 + 2x + 1) x^5 + 4*x^4 + 7*x^3 + 7*x^2 + 4*x + 4 julia> n = compose(f, g; inner = :second) (x^3 + 2*x^2 + x)*y^2 + (2*x^5 + 2*x^4 + 4*x^3 + 9*x^2 + 6*x + 1)*y + x^7 + 4*x^5 + 5*x^4 + 5*x^3 + 10*x^2 + 8*x + 5 julia> p = subst(f, M) [3*x^3 - 3*x^2 + 3*x + 4 6*x^3 + 2*x^2 + 2*x] [3*x^3 - 8*x^2 - 2*x - 3 6*x^3 - 8*x^2 + 2*x + 2] julia> q = f(M) [3*x^3 - 3*x^2 + 3*x + 4 6*x^3 + 2*x^2 + 2*x] [3*x^3 - 8*x^2 - 2*x - 3 6*x^3 - 8*x^2 + 2*x + 2] julia> r = f(23) 552*x + 26 ``` Subexpression: p = subst(f, M) Evaluated output: ERROR: MethodError: no method matching evaluate_brent_kung(::AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{BigInt}}, ::AbstractAlgebra.Generic.MatSpaceElem{AbstractAlgebra.Generic.Poly{BigInt}}) Closest candidates are: evaluate_brent_kung(::PolyRingElem{T}, !Matched::U) where {T<:RingElement, U<:RingElement} @ AbstractAlgebra ~/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:2187 Stacktrace: [1] subst(f::AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{BigInt}}, a::AbstractAlgebra.Generic.MatSpaceElem{AbstractAlgebra.Generic.Poly{BigInt}}) @ AbstractAlgebra ~/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:3436 [2] top-level scope @ none:1 Expected output: [3*x^3 - 3*x^2 + 3*x + 4 6*x^3 + 2*x^2 + 2*x] [3*x^3 - 8*x^2 - 2*x - 3 6*x^3 - 8*x^2 + 2*x + 2] diff = Warning: Diff output requires color. [3*x^3 - 3*x^2 + 3*x + 4 6*x^3 + 2*x^2 + 2*x] [3*x^3 - 8*x^2 - 2*x - 3 6*x^3 - 8*x^2 + 2*x + 2]ERROR: MethodError: no method matching evaluate_brent_kung(::AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{BigInt}}, ::AbstractAlgebra.Generic.MatSpaceElem{AbstractAlgebra.Generic.Poly{BigInt}}) Closest candidates are: evaluate_brent_kung(::PolyRingElem{T}, !Matched::U) where {T<:RingElement, U<:RingElement} @ AbstractAlgebra ~/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:2187 Stacktrace: [1] subst(f::AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{BigInt}}, a::AbstractAlgebra.Generic.MatSpaceElem{AbstractAlgebra.Generic.Poly{BigInt}}) @ AbstractAlgebra ~/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:3436 [2] top-level scope @ none:1
Documentation: docs/src/polynomial.md#L783
doctest failure in src/polynomial.md:783-819 ```jldoctest julia> R, x = polynomial_ring(ZZ, :x) (Univariate polynomial ring in x over integers, x) julia> S, y = polynomial_ring(R, :y) (Univariate polynomial ring in y over R, y) julia> f = x*y^2 + (x + 1)*y + 3 x*y^2 + (x + 1)*y + 3 julia> g = (x + 1)*y + (x^3 + 2x + 2) (x + 1)*y + x^3 + 2*x + 2 julia> M = R[x + 1 2x; x - 3 2x - 1] [x + 1 2*x] [x - 3 2*x - 1] julia> k = evaluate(f, 3) 12*x + 6 julia> m = evaluate(f, x^2 + 2x + 1) x^5 + 4*x^4 + 7*x^3 + 7*x^2 + 4*x + 4 julia> n = compose(f, g; inner = :second) (x^3 + 2*x^2 + x)*y^2 + (2*x^5 + 2*x^4 + 4*x^3 + 9*x^2 + 6*x + 1)*y + x^7 + 4*x^5 + 5*x^4 + 5*x^3 + 10*x^2 + 8*x + 5 julia> p = subst(f, M) [3*x^3 - 3*x^2 + 3*x + 4 6*x^3 + 2*x^2 + 2*x] [3*x^3 - 8*x^2 - 2*x - 3 6*x^3 - 8*x^2 + 2*x + 2] julia> q = f(M) [3*x^3 - 3*x^2 + 3*x + 4 6*x^3 + 2*x^2 + 2*x] [3*x^3 - 8*x^2 - 2*x - 3 6*x^3 - 8*x^2 + 2*x + 2] julia> r = f(23) 552*x + 26 ``` Subexpression: q = f(M) Evaluated output: ERROR: MethodError: no method matching evaluate_brent_kung(::AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{BigInt}}, ::AbstractAlgebra.Generic.MatSpaceElem{AbstractAlgebra.Generic.Poly{BigInt}}) Closest candidates are: evaluate_brent_kung(::PolyRingElem{T}, !Matched::U) where {T<:RingElement, U<:RingElement} @ AbstractAlgebra ~/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:2187 Stacktrace: [1] subst(f::AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{BigInt}}, a::AbstractAlgebra.Generic.MatSpaceElem{AbstractAlgebra.Generic.Poly{BigInt}}) @ AbstractAlgebra ~/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:3436 [2] (::AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{BigInt}})(a::AbstractAlgebra.Generic.MatSpaceElem{AbstractAlgebra.Generic.Poly{BigInt}}) @ AbstractAlgebra ~/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:3409 [3] top-level scope @ none:1 Expected output: [3*x^3 - 3*x^2 + 3*x + 4 6*x^3 + 2*x^2 + 2*x] [3*x^3 - 8*x^2 - 2*x - 3 6*x^3 - 8*x^2 + 2*x + 2] diff = Warning: Diff output requires color. [3*x^3 - 3*x^2 + 3*x + 4 6*x^3 + 2*x^2 + 2*x] [3*x^3 - 8*x^2 - 2*x - 3 6*x^3 - 8*x^2 + 2*x + 2]ERROR: MethodError: no method matching evaluate_brent_kung(::AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{BigInt}}, ::AbstractAlgebra.Generic.MatSpaceElem{AbstractAlgebra.Generic.Poly{BigInt}}) Closest candidates are: evaluate_brent_kung(::PolyRingElem{T}, !Matched::U) where {T<:RingElement, U<:RingElement} @ AbstractAlgebra ~/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:2187 Stacktrace: [1] subst(f::AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{BigInt}}, a::AbstractAlgebra.Generic.MatSpaceElem{AbstractAlgebra.Generic.Poly{BigInt}}) @ AbstractAlgebra ~/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:3436 [2] (::AbstractAlgebra.Generic.Poly{AbstractAlgebra.Generic.Poly{BigInt}})(a::AbstractAlgebra.Generic.MatSpaceElem{AbstractAlgebra.Generic.Poly{BigInt}}) @ AbstractAlgebra ~/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:3409 [3] top-level scope @ none:1
Documentation
Process completed with exit code 1.
test (1.10, windows-latest)
Process completed with exit code 1.
test (nightly, ubuntu-latest)
Process completed with exit code 1.
test (1.11, ubuntu-latest)
Process completed with exit code 1.
test (1.6, ubuntu-latest)
[setup-julia] If you are testing 1.6 as a Long Term Support (lts) version, consider using the new "lts" version specifier instead of "1.6" explicitly, which will automatically resolve the current lts.