Skip to content

Commit

Permalink
Add inverse of reverse (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
jariji authored Jul 10, 2023
1 parent 07ac8c9 commit b1195de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "InverseFunctions"
uuid = "3587e190-3f89-42d0-90ee-14403ec27112"
version = "0.1.10"
version = "0.1.11"

[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
2 changes: 2 additions & 0 deletions src/inverse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,5 @@ inverse(f::Base.Fix2{typeof(divrem)}) = Base.Fix2(invdivrem, f.x)
inverse(f::Base.Fix2{typeof(invdivrem)}) = Base.Fix2(divrem, f.x)
inverse(f::Base.Fix2{typeof(fldmod)}) = Base.Fix2(invfldmod, f.x)
inverse(f::Base.Fix2{typeof(invfldmod)}) = Base.Fix2(fldmod, f.x)

inverse(::typeof(reverse)) = reverse
1 change: 1 addition & 0 deletions test/test_inverse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ InverseFunctions.inverse(f::Bar) = Bar(inv(f.A))
InverseFunctions.test_inverse(f, -x)
end
InverseFunctions.test_inverse(conj, 2 - 3im)
InverseFunctions.test_inverse(reverse, [10, 20, 30])

x = rand(0:10)
for f in (Base.Fix2(divrem, rand([-5:-1; 1:5])), Base.Fix2(fldmod, rand([-5:-1; 1:5])), Base.Fix2(divrem, 0.123), Base.Fix2(fldmod, 0.123))
Expand Down

2 comments on commit b1195de

@oschulz
Copy link
Collaborator

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

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

Please sign in to comment.