Skip to content

Commit

Permalink
Bump MP to v0.4 (#23)
Browse files Browse the repository at this point in the history
* BuMP MP to v0.4

* Update to MP v0.4

* Fixes

* Bump MultivariatePolynomials
  • Loading branch information
blegat authored Nov 17, 2021
1 parent e55a5f3 commit 45bce00
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
10 changes: 7 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
name = "SemialgebraicSets"
uuid = "8e049039-38e8-557d-ae3a-bc521ccf6204"
repo = "https://github.com/JuliaAlgebra/SemialgebraicSets.jl.git"
version = "0.2.3"
version = "0.2.4"

[deps]
DynamicPolynomials = "7c1d4256-1411-5781-91ec-d7bc3513ac07"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MultivariatePolynomials = "102ac46a-7ee4-5c85-9060-abc95bfdeaa3"
MutableArithmetics = "d8a4904e-b15c-11e9-3269-09a3773c0cb0"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
TypedPolynomials = "afbbf031-7a57-5f58-a1b9-b774a0fad08d"

[compat]
MultivariatePolynomials = "0.3"
MultivariatePolynomials = "0.4.2"
julia = "1"

[extras]
DynamicPolynomials = "7c1d4256-1411-5781-91ec-d7bc3513ac07"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TypedPolynomials = "afbbf031-7a57-5f58-a1b9-b774a0fad08d"

[targets]
test = ["Test", "DynamicPolynomials"]
test = ["Test", "DynamicPolynomials", "TypedPolynomials"]
3 changes: 3 additions & 0 deletions src/SemialgebraicSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ module SemialgebraicSets

using Random

import MutableArithmetics
const MA = MutableArithmetics

using MultivariatePolynomials
const MP = MultivariatePolynomials

Expand Down
8 changes: 4 additions & 4 deletions src/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ end
function BasicSemialgebraicSet(V::AlgebraicSet{T, PT, A, S}, p::Vector{PT}) where {T, PT<:APL{T}, A, S<:AbstractAlgebraicSolver}
BasicSemialgebraicSet{T, PT, typeof(V)}(V, p)
end
function BasicSemialgebraicSet(V::AlgebraicSet{T, PT, A, ST}, p::Vector{PS}) where {T, PT<:APL{T}, S, PS<:APL{S}, A, ST<:AbstractAlgebraicSolver}
U = promote_type(T, S)
PU = promote_type(PT, PS)
BasicSemialgebraicSet(convert(AlgebraicSet{U, PU, A, ST}, V), Vector{PU}(p))
function BasicSemialgebraicSet(V::AlgebraicSet{T, PT, A, SO, U}, p::Vector{PS}) where {T, PT<:APL{T}, S, PS<:APL{S}, A, SO<:AbstractAlgebraicSolver, U}
ST = promote_type(T, S)
PST = promote_type(PT, PS)
BasicSemialgebraicSet(convert(AlgebraicSet{ST, PST, A, SO, U}, V), Vector{PST}(p))
end
#BasicSemialgebraicSet{T, PT<:APL{T}}(V::AlgebraicSet{T, PT}, p::Vector{PT}) = BasicSemialgebraicSet{T, PT}(V, p)
function basicsemialgebraicset(V, p)
Expand Down
10 changes: 9 additions & 1 deletion src/groebner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ where ``m = \\mathrm{lcm}(\\mathrm{\\mathsc{LM}}(p), \\mathrm{\\mathsc{LM}}(q))`
"""
function spolynomial(p::APL, q::APL)
m = lcm(leadingmonomial(p), leadingmonomial(q))
MultivariatePolynomials._div(m, leadingterm(p)) * p - MultivariatePolynomials._div(m, leadingterm(q)) * q
ltp = leadingterm(p)
# `MA.operate` ensures that the returned value can be mutated without
# affecting either `a` or `p`.
a = MA.operate(*, MP._div(m, monomial(ltp)), p)
ad = MA.operate!!(/, a, MP.coefficient(ltp))
ltq = leadingterm(q)
b = MA.operate(*, MP._div(m, monomial(ltq)), q)
bd = MA.operate!!(/, b, MP.coefficient(ltq))
return MA.operate!!(-, ad, bd)
end

function reducebasis!(F::AbstractVector{<:APL}; kwargs...)
Expand Down

2 comments on commit 45bce00

@blegat
Copy link
Member Author

@blegat blegat commented on 45bce00 Nov 17, 2021

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/48928

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 v0.2.4 -m "<description of version>" 45bce00d045cf205587b515dae14db50e236a01d
git push origin v0.2.4

Please sign in to comment.