Skip to content

Commit 835a136

Browse files
authored
get docs to build again (#619)
* get docs to build again * avoid floating point differences * typo * avoid floating point differences in tests
1 parent 445724a commit 835a136

File tree

7 files changed

+15
-19
lines changed

7 files changed

+15
-19
lines changed

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ makedocs(
2323
"Extending" => "extending.md",
2424
],
2525
warnonly = [:cross_references, :missing_docs],
26+
checkdocs=:exports,
2627
)
2728

2829
deploydocs(repo = "github.com/JuliaMath/Polynomials.jl.git")

docs/src/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,7 @@ internally when converting to the `FactoredPolynomial` type:
575575
julia> p = Polynomial([24, -50, 35, -10, 1])
576576
Polynomial(24 - 50*x + 35*x^2 - 10*x^3 + x^4)
577577
578-
julia> q = convert(FactoredPolynomial, p) # noisy form of `factor`:
579-
FactoredPolynomial((x - 4.0000000000000036) * (x - 1.0000000000000002) * (x - 2.9999999999999942) * (x - 2.0000000000000018))
578+
julia> q = convert(FactoredPolynomial, p); # noisy form of `factor` subject to floating point vagaries
580579
581580
julia> map(x -> round(x, digits=10), q)
582581
FactoredPolynomial((x - 4.0) * (x - 2.0) * (x - 3.0) * (x - 1.0))

docs/src/reference.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,12 @@ gcd
9898
derivative
9999
integrate
100100
roots
101+
residues
102+
poles
101103
companion
102104
fit
103105
vander
106+
ArnoldiFit
104107
```
105108

106109
## Plotting

ext/PolynomialsRecipesBaseExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ end
6262

6363
xlims = get(plotattributes, :xlims, (nothing, nothing))
6464
ylims = get(plotattributes, :ylims, (nothing, nothing))
65-
rational_function_trim(pq, a, b, xlims, ylims)
65+
rational_function_trim(pq, a, b, xlims, ylims)
6666

6767
end
6868

@@ -84,10 +84,10 @@ function rational_function_trim(pq, a, b, xlims, ylims)
8484
dpq = derivative(p//q)
8585
p′,q′ = lowest_terms(dpq)
8686

87-
λs = Multroot.multroot(q).values
87+
λs = Polynomials.Multroot.multroot(q).values
8888
λs = isempty(λs) ? λs : real.(filter(isapproxreal, λs))
8989

90-
cps = Multroot.multroot(p′).values
90+
cps = Polynomials.Multroot.multroot(p′).values
9191
cps = isempty(cps) ? cps : real.(filter(isapproxreal, cps))
9292
cps = isempty(cps) ? cps : filter(!toobig(pq), cps)
9393

src/common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ isconstant(p::AbstractPolynomial) = degree(p) <= 0 && firstindex(p) == 0
704704
coeffs(::AbstractLaurentUnivariatePolynomial)
705705
706706
For a dense, univariate polynomial return the coefficients ``(a_0, a_1, \\dots, a_n)``
707-
as an interable. This may be a vector or tuple, and may alias the
707+
as an iterable. This may be a vector or tuple, and may alias the
708708
polynomials coefficients.
709709
710710
For a Laurent type polynomial (e.g. `LaurentPolynomial`, `SparsePolynomial`) return the coefficients ``(a_i, a_{i+1}, \\dots, a_j)`` where

src/polynomials/factored_polynomial.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ FactoredPolynomial(x * (x - 3) * (x - 1))
3030
julia> p = Polynomial([24, -50, 35, -10, 1])
3131
Polynomial(24 - 50*x + 35*x^2 - 10*x^3 + x^4)
3232
33-
julia> q = convert(FactoredPolynomial, p) # noisy form of `factor`:
34-
FactoredPolynomial((x - 4.0000000000000036) * (x - 1.0000000000000002) * (x - 2.9999999999999942) * (x - 2.0000000000000018))
33+
julia> q = convert(FactoredPolynomial, p); # noisy form of `factor`, subject to floating point issues
3534
3635
julia> map(x->round(x, digits=12), q) # map works over factors and leading coefficient -- not coefficients in the standard basis
3736
FactoredPolynomial((x - 4.0) * (x - 2.0) * (x - 3.0) * (x - 1.0))

src/polynomials/multroot.jl

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,14 @@ julia> using Polynomials
3333
julia> p = fromroots([sqrt(2), sqrt(2), sqrt(2), 1, 1])
3434
Polynomial(-2.8284271247461907 + 11.656854249492383*x - 19.07106781186548*x^2 + 15.485281374238573*x^3 - 6.242640687119286*x^4 + 1.0*x^5)
3535
36-
julia> roots(p)
37-
5-element Vector{ComplexF64}:
38-
0.999999677417768 + 0.0im
39-
1.0000003225831504 + 0.0im
40-
1.4141705716005881 + 0.0im
41-
1.4142350577588914 - 3.722737728087131e-5im
42-
1.4142350577588914 + 3.722737728087131e-5im
36+
julia> roots(p) |> unique |> length # all are distinct
37+
5
4338
4439
julia> m = Polynomials.Multroot.multroot(p);
4540
46-
julia> Dict(m.values .=> m.multiplicities)
47-
Dict{Float64, Int64} with 2 entries:
48-
1.41421 => 3
49-
1.0 => 2
41+
julia> ind = sortperm(m.values); ks = round.(m.values[ind];digits=6); vs = m.multiplicities[ind]; [ks .=> vs]
42+
1-element Vector{Vector{Pair{Float64, Int64}}}:
43+
[1.0 => 2, 1.414214 => 3]
5044
```
5145
5246
## Extended help

0 commit comments

Comments
 (0)