Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctests and documentation patch #571

Merged
merged 9 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
GR_jll = "d2c73de3-f751-5644-a686-071e5b155ba9"
GenericLinearAlgebra = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

Expand Down
28 changes: 14 additions & 14 deletions docs/src/extending.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,24 +283,24 @@ We need to add in the vector-space operations:

```jldoctest new_container_type
julia> function Base.:+(p::AliasPolynomialType{B,T,X}, q::AliasPolynomialType{B,S,X}) where {B,S,T,X}
R = promote_type(T,S)
n = maximum(degree, (p,q))
cs = [p[i] + q[i] for i in 0:n]
AliasPolynomialType{B,R,X}(Val(false), cs) # save a copy
end
R = promote_type(T,S)
n = maximum(degree, (p,q))
cs = [p[i] + q[i] for i in 0:n]
AliasPolynomialType{B,R,X}(Val(false), cs) # save a copy
end

julia> function Base.:-(p::AliasPolynomialType{B,T,X}, q::AliasPolynomialType{B,S,X}) where {B,S,T,X}
R = promote_type(T,S)
n = maximum(degree, (p,q))
cs = [p[i] - q[i] for i in 0:n]
AliasPolynomialType{B,R,X}(Val(false), cs)
end
R = promote_type(T,S)
n = maximum(degree, (p,q))
cs = [p[i] - q[i] for i in 0:n]
AliasPolynomialType{B,R,X}(Val(false), cs)
end

julia> function Base.map(fn, p::P) where {B,T,X,P<:AliasPolynomialType{B,T,X}}
cs = map(fn, p.coeffs)
R = eltype(cs)
AliasPolynomialType{B,R,X}(Val(false), cs)
end
cs = map(fn, p.coeffs)
R = eltype(cs)
AliasPolynomialType{B,R,X}(Val(false), cs)
end

```

Expand Down
Loading
Loading