Skip to content

Commit

Permalink
adjust compat; check typos; readme (#540)
Browse files Browse the repository at this point in the history
* adjust compat; check typos; readme

* fix typos

* adjust toml for Aqua test
  • Loading branch information
jverzani authored Nov 9, 2023
1 parent c0160d4 commit 2e2cb86
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 13 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Spell Check

on: [pull_request]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Polynomials"
uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
license = "MIT"
author = "JuliaMath"
version = "4.0.4"
version = "4.0.5"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -26,6 +26,7 @@ PolynomialsMutableArithmeticsExt = "MutableArithmetics"
[compat]
ChainRulesCore = "1"
FFTW = "1"
LinearAlgebra = "1.6"
MakieCore = "0.6"
MutableArithmetics = "1"
RecipesBase = "0.7, 0.8, 1"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ savefig("rational_function.svg"); nothing # hide

* [MultiPoly.jl](https://github.com/daviddelaat/MultiPoly.jl) for sparse multivariate polynomials

* [DynamicPolynomals.jl](https://github.com/JuliaAlgebra/DynamicPolynomials.jl) Multivariate polynomials implementation of commutative and non-commutative variables
* [DynamicPolynomials.jl](https://github.com/JuliaAlgebra/DynamicPolynomials.jl) Multivariate polynomials implementation of commutative and non-commutative variables

* [MultivariatePolynomials.jl](https://github.com/JuliaAlgebra/MultivariatePolynomials.jl) for multivariate polynomials and moments of commutative or non-commutative variables

Expand Down
5 changes: 5 additions & 0 deletions src/Polynomials.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Polynomials.jl
Basic arithmetic, integration, differentiation, evaluation, root finding, and fitting for [univariate polynomials](https://en.wikipedia.org/wiki/Polynomial) in [Julia](https://julialang.org/).
"""
module Polynomials

# using GenericLinearAlgebra ## remove for now. cf: https://github.com/JuliaLinearAlgebra/GenericLinearAlgebra.jl/pull/71#issuecomment-743928205
Expand Down
2 changes: 1 addition & 1 deletion src/abstract-polynomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ basis_symbol(::Type{AbstractUnivariatePolynomial{B,T,X}}) where {B,T,X} = "Χ($(

## idea is vector space stuff (scalar_add, scalar_mult, vector +/-, ^) goes here
## connection (convert, transform) is specific to a basis (storage)
## ⊗(p::P{T,X}, q::P{S,Y}) is specic to basis/storage
## ⊗(p::P{T,X}, q::P{S,Y}) is specific to basis/storage

# type of basis
basistype(p::AbstractUnivariatePolynomial{B,T,X}) where {B,T,X} = B
Expand Down
6 changes: 3 additions & 3 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ basis(p::P, k::Int, _var=indeterminate(p); var=_var) where {P<:AbstractPolynomia

#=
composition
cf. https://github.com/JuliaMath/Polynomials.jl/issues/511 for a paper with implentations
cf. https://github.com/JuliaMath/Polynomials.jl/issues/511 for a paper with implementations
=#
"""
Expand Down Expand Up @@ -1062,7 +1062,7 @@ Base.:+(p::P, c::T) where {T,X, P<:AbstractPolynomial{T,X}} = scalar_add(c, p)
Base.:+(p::P, c::S) where {T,X, P<:AbstractPolynomial{T,X}, S} = scalar_add(c,p)

## polynomial + polynomial when different types
## - each polynomial container type implents PB{B,T,X} + PB{B,S,X}
## - each polynomial container type implements PB{B,T,X} + PB{B,S,X}
## - this handles case X ≠ Y unless constant
## - when PB₁ ≠ PB₂ we promote both polynomials
function Base.:+(p::P, q::Q) where {T,X,P <: AbstractPolynomial{T,X}, S,Y,Q <: AbstractPolynomial{S,Y}}
Expand Down Expand Up @@ -1126,7 +1126,7 @@ Base.:^(p::AbstractPolynomial, n::Integer) = Base.power_by_squaring(p, n)



# Th ⊕ methd below is used in Special Polynomials, but not here, as it was removed for
# Th ⊕ method below is used in Special Polynomials, but not here, as it was removed for
# similar methods in the polynomial-basetypes
# addition of polynomials is just vector space addition, so can be done regardless
# of basis, as long as the same. These ⊕ methods try to find a performant means to add
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ImmutableDensePolynomial{B,T,X,N}(check::Type{Val{false}}, cs::NTuple{N,T}) wher
ImmutableDensePolynomial{B,T,X,N}(check::Type{Val{true}}, cs::NTuple{N,T}) where {B,N, T,X} =
ImmutableDensePolynomial{B,T,X,N}(cs)

# tuple with mis-matched size
# tuple with mismatched size
function ImmutableDensePolynomial{B,T,X,N}(xs::NTuple{M,S}) where {B,T,S,X,N,M}
p = ImmutableDensePolynomial{B,S,X,M}(xs)
convert(ImmutableDensePolynomial{B,T,X,N}, ImmutableDensePolynomial{B,T,X,M}(xs))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This polynomial type essentially uses an offset vector (`Vector{T}`,`order`) to store the coefficients of a polynomial relative to the basis `B` with indeterminate `X`.
The typical offset is to have `0` as the order, but, say, to accomodate Laurent polynomials, or more efficient storage of basis elements any order may be specified.
The typical offset is to have `0` as the order, but, say, to accommodate Laurent polynomials, or more efficient storage of basis elements any order may be specified.
This type trims trailing zeros and the leading zeros on construction.
Expand Down
2 changes: 1 addition & 1 deletion src/polynomials/standard-basis/immutable-polynomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ end

# julia> @time Base.power_by_squaring(p,15);
# 0.000145 seconds (7 allocations: 6.547 KiB)
# This is not inferrable, as `n` is not a compile time constant
# This is not inferable, as `n` is not a compile time constant
Base.:^(p::ImmutablePolynomial, n::Integer) = immutable_power(p, n)
function immutable_power(p::ImmutablePolynomial{T,X,N}, n::Integer) where {T,X,N}
iszero(p) && return p
Expand Down
8 changes: 4 additions & 4 deletions src/polynomials/standard-basis/standard-basis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,13 @@ function _gcd_noda_sasaki(a::Vector{T}, b::Vector{S};
tol = atol + rtol

# determine the degree of GCD as the nullity of the Sylvester matrix
# this computation can be replaced by simply setting nd = 1, in which case the Sylvester matrix is not formed
# this computation can be replaced by simply setting nᵣ = 1, in which case the Sylvester matrix is not formed

nd = na1 + nb1 - 2 - rank([NGCD.convmtx(a1,nb1-1) NGCD.convmtx(b1,na1-1)], atol = tol) # julia 1.1
nd == 0 && (return [one(R)])
nᵣ = na1 + nb1 - 2 - rank([NGCD.convmtx(a1,nb1-1) NGCD.convmtx(b1,na1-1)], atol = tol) # julia 1.1
nᵣ == 0 && (return [one(R)])

sc = one(R)
while na1 > nd
while na1 > nᵣ
na1 < nb1 && ((a1, b1, na1, nb1) = (b1, a1, nb1, na1))
@inbounds for i in na1:-1:nb1
s = -a1[i] / b1[nb1]
Expand Down

2 comments on commit 2e2cb86

@jverzani
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95061

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v4.0.5 -m "<description of version>" 2e2cb868218755a1c5c7f8576f88974bd930b3a9
git push origin v4.0.5

Please sign in to comment.