Skip to content

Commit

Permalink
Merge pull request #496 from oscar-system/bl/abs
Browse files Browse the repository at this point in the history
remove abs fallback + misc
  • Loading branch information
benlorenz authored Aug 14, 2024
2 parents b379d1d + 84981b6 commit f4dae70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Polymake"
uuid = "d720cf60-89b5-51f5-aff5-213f193123e7"
repo = "https://github.com/oscar-system/Polymake.jl.git"
version = "0.11.19"
version = "0.11.20"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Expand Down Expand Up @@ -44,6 +44,6 @@ SparseArrays = "^1.6"
TOPCOM_jll = "~0.17.8"
julia = "^1.6"
lib4ti2_jll = "^1.6.10"
libpolymake_julia_jll = "~0.12.0"
libpolymake_julia_jll = "~0.12.1"
polymake_jll = "^400.1200.0"
polymake_oscarnumber_jll = "~0.3.0"
polymake_oscarnumber_jll = "~0.3.1"
15 changes: 3 additions & 12 deletions src/oscarnumber.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Base.:/(x::OscarNumber, y::OscarNumber) = x // y
convert(::Type{<:OscarNumber}, on::OscarNumber) = on

function unwrap(on::OscarNumber)
if Polymake.isinf(on) != 0
if isinf(on)
error("cannot unwrap OscarNumber containing infinity")
elseif _uses_rational(on)
return _get_rational(on)
Expand Down Expand Up @@ -104,18 +104,9 @@ const _on_parent_by_id = Dict{Clong, Any}()
@cfunction(Base.:-, Ref{ArgT}, (Ref{ArgT},))
end

function _on_abs_fallback(e::ArgT)::ArgT where ArgT
return Base.cmp(e,0) < 0 ? -e : deepcopy(e)
end
@generated function _on_gen_abs(::Type{ArgT}) where ArgT
if hasmethod(abs, (ArgT,))
return quote
@cfunction(Base.abs, Ref{ArgT}, (Ref{ArgT},))
end
else
return quote
@cfunction(_on_abs_fallback, Ref{ArgT}, (Ref{ArgT},))
end
return quote
@cfunction(Base.abs, Ref{ArgT}, (Ref{ArgT},))
end
end

Expand Down

2 comments on commit f4dae70

@benlorenz
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 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/113116

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

Please sign in to comment.