Skip to content

Commit c392ea8

Browse files
authored
define dot fallback error (#563)
* define dot fallback error * add file to clear typos
1 parent df35832 commit c392ea8

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "Polynomials"
22
uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
33
license = "MIT"
44
author = "JuliaMath"
5-
version = "4.0.7"
5+
version = "4.0.8"
66

77
[deps]
88
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

_typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[default.extend-words]
2+
Pn = "Pn"

src/common.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,3 +1310,7 @@ Base.isapprox(n::S,p1::AbstractPolynomial{T}; kwargs...) where {S,T} = isapprox(
13101310

13111311
Base.isapprox(::AbstractPolynomial{T}, ::Missing, args...; kwargs...) where T = missing
13121312
Base.isapprox(::Missing, ::AbstractPolynomial{T}, args...; kwargs...) where T = missing
1313+
1314+
function LinearAlgebra.dot(::AbstractPolynomial, ::AbstractPolynomial, args...; kwargs...)
1315+
throw(ArgumentError("No generic `dot` method is defined for polynomials."))
1316+
end

src/polynomials/ngcd.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,9 @@ function refine_uvw!(u::P, v::P, w::P,
534534
ρ₁ = residual_error(p, q, uv, uw)
535535
iszero(ρ₁) && return (ρ₁, NaN)
536536
# storage
537-
h, β = u, dot(u,u) # h = constant * u₀ is used
537+
h, β = u, dot(u.coeffs,u.coeffs) # h = constant * u₀ is used
538538
A = JF(h, u, v, w)
539-
Δfβ = Fmp(dot(h, u) - β, p, q, uv, uw)
539+
Δfβ = Fmp(dot(h.coeffs, u.coeffs) - β, p, q, uv, uw)
540540
Δz = ones(T, length(u) + length(v) + length(w))
541541
n = size(A, 2)
542542
R = UpperTriangular(Matrix{T}(undef, n, n))
@@ -568,7 +568,7 @@ function refine_uvw!(u::P, v::P, w::P,
568568
steps Maxᵢ && break
569569
# update A,b for next iteration
570570
JF!(A, h, u, v, w)
571-
Fmp!(Δfβ, dot(h, u) - β, p, q, uv, uw)
571+
Fmp!(Δfβ, dot(h.coeffs, u.coeffs) - β, p, q, uv, uw)
572572
else
573573
steps == 1 && copy!(R′, R)
574574
break

0 commit comments

Comments
 (0)