Skip to content

Commit

Permalink
update version (#485)
Browse files Browse the repository at this point in the history
* update version

* some missing ZZ and QQ casts
  • Loading branch information
tthsqe12 authored Aug 2, 2021
1 parent 0ba8740 commit d7d955c
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 30 deletions.
10 changes: 5 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Singular"
uuid = "bcd08a7b-43d2-5ff7-b6d4-c458787f915c"
version = "0.5.8"
version = "0.5.9"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Expand All @@ -17,13 +17,13 @@ lib4ti2_jll = "1493ae25-0f90-5c0e-a06c-8c5077d6d66f"
libsingular_julia_jll = "ae4fbd8f-ecdb-54f8-bbce-35570499b30e"

[compat]
AbstractAlgebra = "0.20.0"
AbstractAlgebra = "0.21.0"
CxxWrap = "0.11"
Nemo = "0.25.1"
Nemo = "0.26.0"
RandomExtensions = "0.4.2"
Singular_jll = "~402.000.102"
Singular_jll = "~402.100.100"
julia = "1.3"
libsingular_julia_jll = "~0.15.0"
libsingular_julia_jll = "~0.16.0"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
2 changes: 2 additions & 0 deletions src/number/NumberTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ mutable struct n_Z <: Nemo.RingElem
end
end

n_Z(n::n_Z) = n
n_Z(n::Integer = 0) = n_Z(libSingular.number_ptr(n, ZZ.ptr))
n_Z(n::Nemo.fmpz) = n_Z(libSingular.number_ptr(n, ZZ.ptr))

Expand Down Expand Up @@ -96,6 +97,7 @@ mutable struct n_Q <: Nemo.FieldElem
end
end

n_Q(n::n_Q) = n
n_Q(n::Integer = 0) = n_Q(libSingular.number_ptr(n, QQ.ptr))
n_Q(n::Nemo.fmpz) = n_Q(libSingular.number_ptr(n, QQ.ptr))
n_Q(n::n_Z) = n_Q(libSingular.nApplyMapFunc(n_Z_2_n_Q, n.ptr, ZZ.ptr, QQ.ptr))
Expand Down
2 changes: 1 addition & 1 deletion src/number/n_GF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function inv(x::n_GF)
return c(p)
end

function divexact(x::n_GF, y::n_GF)
function divexact(x::n_GF, y::n_GF; check::Bool=true)
c = parent(x)
p = GC.@preserve x y c libSingular.n_Div(x.ptr, y.ptr, c.ptr)
return c(p)
Expand Down
2 changes: 1 addition & 1 deletion src/number/n_Q.jl
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function inv(x::n_Q)
return c(p)
end

function divexact(x::n_Q, y::n_Q)
function divexact(x::n_Q, y::n_Q; check::Bool=true)
c = parent(x)
p = GC.@preserve x y c libSingular.n_Div(x.ptr, y.ptr, c.ptr)
return c(p)
Expand Down
2 changes: 1 addition & 1 deletion src/number/n_Z.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function div(x::n_Z, y::n_Z)
return c(p)
end

function divexact(x::n_Z, y::n_Z)
function divexact(x::n_Z, y::n_Z; check::Bool=true)
c = parent(x)
p = GC.@preserve x y c libSingular.n_ExactDiv(x.ptr, y.ptr, c.ptr)
return c(p)
Expand Down
2 changes: 1 addition & 1 deletion src/number/n_Zn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ end
#
###############################################################################

function divexact(x::n_Zn, y::n_Zn)
function divexact(x::n_Zn, y::n_Zn; check::Bool=true)
c = parent(x)
p = GC.@preserve x y c libSingular.n_ExactDiv(x.ptr, y.ptr, c.ptr)
return c(p)
Expand Down
2 changes: 1 addition & 1 deletion src/number/n_Zp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function inv(x::n_Zp)
return c(p)
end

function divexact(x::n_Zp, y::n_Zp)
function divexact(x::n_Zp, y::n_Zp; check::Bool=true)
c = parent(x)
p = GC.@preserve x y c libSingular.n_Div(x.ptr, y.ptr, c.ptr)
return c(p)
Expand Down
2 changes: 1 addition & 1 deletion src/number/n_algExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function inv(x::n_algExt)
return c(p)
end

function divexact(x::n_algExt, y::n_algExt)
function divexact(x::n_algExt, y::n_algExt; check::Bool=true)
check_parent(x, y)
c = parent(x)
p = GC.@preserve x y c libSingular.n_Div(x.ptr, y.ptr, c.ptr)
Expand Down
2 changes: 1 addition & 1 deletion src/number/n_transExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function inv(x::n_transExt)
return c(p)
end

function divexact(x::n_transExt, y::n_transExt)
function divexact(x::n_transExt, y::n_transExt; check::Bool=true)
c = parent(x)
p = GC.@preserve x y c libSingular.n_Div(x.ptr, y.ptr, c.ptr)
return c(p)
Expand Down
15 changes: 12 additions & 3 deletions src/number/n_unknown.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ end
#
###############################################################################

function divexact(a::n_unknown, b::n_unknown)
function divexact(a::n_unknown, b::n_unknown; check::Bool=true)
check_parent(a, b)
R = parent(a)
n = GC.@preserve a b R libSingular.n_ExactDiv(a.ptr, b.ptr, R.ptr)
Expand Down Expand Up @@ -419,7 +419,7 @@ for op in (:iszero, :isone)
end

# one input, one wrapped output
for op in (:-, :zero, :one)
for op in (:-, :zero, :one, :inv)
@eval begin
function ($op)(a::($rew){S, T}) where {S, T}
return ($rew){S, T}(($op)(a.data), a.parent)
Expand All @@ -437,14 +437,23 @@ for op in (:(==), )
end

# two inputs, one wrapped output
for op in (:+, :-, :*, :div, :divexact, :gcd)
for op in (:+, :-, :*, :div, :gcd)
@eval begin
function ($op)(a::($rew){S, T}, b::($rew){S, T}) where {S, T}
return ($rew){S, T}(($op)(a.data, b.data), a.parent)
end
end
end

# two inputs, checked, one wrapped output
for op in (:divexact, )
@eval begin
function ($op)(a::($rew){S, T}, b::($rew){S, T}; check::Bool=true) where {S, T}
return ($rew){S, T}(($op)(a.data, b.data, check=check), a.parent)
end
end
end

# two inputs, one non-wrapped and one wrapped output
for op in (:divides, )
@eval begin
Expand Down
30 changes: 15 additions & 15 deletions src/poly/poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ end
#
###############################################################################

function divexact(x::spoly, y::spoly)
function divexact(x::spoly, y::spoly; check::Bool=true)
check_parent(x, y)
R = parent(x)
GC.@preserve x y R begin
Expand All @@ -527,7 +527,7 @@ end
#
###############################################################################

function divexact(x::spoly{T}, y::T) where T <: Nemo.RingElem
function divexact(x::spoly{T}, y::T; check::Bool=true) where T <: Nemo.RingElem
R = parent(x)
base_ring(x) != parent(y) && error("Incompatible rings")
GC.@preserve x y R begin
Expand All @@ -537,7 +537,7 @@ function divexact(x::spoly{T}, y::T) where T <: Nemo.RingElem
end
end

function divexact(x::spoly, y::n_Z)
function divexact(x::spoly, y::n_Z; check::Bool=true)
y1 = base_ring(x)(y)
R = parent(x)
GC.@preserve x y1 R begin
Expand All @@ -547,7 +547,7 @@ function divexact(x::spoly, y::n_Z)
end
end

function divexact(x::spoly, y::n_Q)
function divexact(x::spoly, y::n_Q; check::Bool=true)
y1 = base_ring(x)(y)
R = parent(x)
GC.@preserve x y1 R begin
Expand All @@ -557,7 +557,7 @@ function divexact(x::spoly, y::n_Q)
end
end

function divexact(x::spoly, y::Int)
function divexact(x::spoly, y::Int; check::Bool=true)
R = base_ring(x)
S = parent(x)
GC.@preserve x R S begin
Expand All @@ -569,10 +569,10 @@ function divexact(x::spoly, y::Int)
end
end

divexact(x::spoly, y::Integer) = divexact(x, base_ring(x)(y))
divexact(x::spoly, y::Integer; check::Bool=true) = divexact(x, base_ring(x)(y), check=check)

function divexact(x::spoly, y::Rational)
return divexact(x, base_ring(x)(y))
function divexact(x::spoly, y::Rational; check::Bool=true)
return divexact(x, base_ring(x)(y), check=check)
end

################################################################################
Expand Down Expand Up @@ -600,8 +600,8 @@ function *(x::fmpq, y::spoly)
return parent(y)(x) * y
end

function divexact(x::spoly, y::fmpq)
return divexact(x, parent(x)(y))
function divexact(x::spoly, y::fmpq; check::Bool=true)
return divexact(x, parent(x)(y), check=check)
end

###############################################################################
Expand Down Expand Up @@ -1501,16 +1501,16 @@ ordering_a(w::Vector{Int}) = sordering([sorder_block(ringorder_a, 0, w)])
Represents a block of variables with a general matrix ordering.
The matrix `m` is expected to be invertible, and this is checked by default.
"""
function ordering_M(m::Matrix{Int}; checked::Bool = true)
function ordering_M(m::Matrix{Int}; check::Bool=true)
(nr, nc) = size(m)
nr > 0 && nr == nc || throw(ArgumentError("weight matrix must be square"))
!checked || !iszero(Nemo.det(Nemo.matrix(Nemo.ZZ, m))) || throw(ArgumentError("weight matrix must nonsingular"))
!check || !iszero(Nemo.det(Nemo.matrix(Nemo.ZZ, m))) || throw(ArgumentError("weight matrix must nonsingular"))
return sordering([sorder_block(ringorder_M, nr, vec(transpose(m)))])
end

function ordering_M(m::fmpz_mat, checked::Bool = true)
!checked || !iszero(Nemo.det(m)) || throw(ArgumentError("weight matrix must nonsingular"))
return ordering_M(Int.(m), checked = false)
function ordering_M(m::fmpz_mat, check::Bool=true)
!check || !iszero(Nemo.det(m)) || throw(ArgumentError("weight matrix must nonsingular"))
return ordering_M(Int.(m), check=false)
end

# C, c, and S can take a dummy int in singular, but they do nothing with it?
Expand Down

2 comments on commit d7d955c

@tthsqe12
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@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/42015

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.5.9 -m "<description of version>" d7d955cc7d032f65cf228dbfc88c5c7ef346712e
git push origin v0.5.9

Please sign in to comment.