Skip to content

Commit

Permalink
fix integer pow for Julia 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
sjdaines committed Sep 19, 2022
1 parent 1833e73 commit 3954f38
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Manifest.toml
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SparsityTracing"
uuid = "06eadbd4-12ad-4cbc-ab6e-10f8370940a5"
authors = ["Stuart Daines <stuart.daines@gmail.com>"]
version = "0.2.4"
version = "0.2.5"

[deps]
DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b"
Expand Down
7 changes: 1 addition & 6 deletions src/SparsityTracing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,7 @@ gen_logical_rules()
# TODO fixups #
###############
# Errors Base.:^(d::ADval{T}, n::Integer) is ambiguous ?
# adding literal_pow apparently fixes this but might not be the right fix
Base.literal_pow(::typeof(^), d::ADval{T}, ::Val{0}) where {T} = one(d)
Base.literal_pow(::typeof(^), d::ADval{T}, ::Val{1}) where {T} = d
Base.literal_pow(::typeof(^), d::ADval{T}, ::Val{2}) where {T} = d*d
Base.literal_pow(::typeof(^), d::ADval{T}, ::Val{3}) where {T} = d*d*d
Base.literal_pow(::typeof(^), d::ADval{T}, ::Val{4}) where {T} = d*d*d*d

Base.:^(d::ADval{T}, p::Integer) where {T} = d^Float64(p)

end

6 comments on commit 3954f38

@sjdaines
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.

Error while trying to register: Changing package repo URL not allowed, please submit a pull request with the URL change to the target registry and retry.

@sjdaines
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.

Error while trying to register: Changing package repo URL not allowed, please submit a pull request with the URL change to the target registry and retry.

@sjdaines
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/68835

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.5 -m "<description of version>" 3954f38b88eae3b3572e0d6b25f7e21d1019e45d
git push origin v0.2.5

Please sign in to comment.