Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more inverses #19

Merged
merged 1 commit into from
Jun 6, 2022
Merged

add more inverses #19

merged 1 commit into from
Jun 6, 2022

Conversation

aplavin
Copy link
Contributor

@aplavin aplavin commented Jun 5, 2022

Following #12.

As I understand, all functions other than ^ and log are complete inverses on the whole available domain. Power and log inverses are implemented with separate functions to preserve proper domains, same approach as sqrt <-> square.

@codecov
Copy link

codecov bot commented Jun 5, 2022

Codecov Report

Merging #19 (a413b4e) into master (9a52bfc) will increase coverage by 2.85%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           master       #19      +/-   ##
===========================================
+ Coverage   97.14%   100.00%   +2.85%     
===========================================
  Files           3         3              
  Lines          35        65      +30     
===========================================
+ Hits           34        65      +31     
+ Misses          1         0       -1     
Impacted Files Coverage Δ
src/functions.jl 100.00% <100.00%> (+25.00%) ⬆️
src/inverse.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a52bfc...a413b4e. Read the comment docs.

@oschulz
Copy link
Collaborator

oschulz commented Jun 5, 2022

I have been thinking about adding inverses like

inverse(f::Base.Fix1{typeof(*)}) = ...
...
inverse(f::Base.Fix2{typeof(+)}) = ...

myself, since they enable inverses of affine transformations. How do you see this @devmotion ?

src/inverse.jl Outdated Show resolved Hide resolved
@devmotion
Copy link
Member

I have been thinking about adding inverses like

Seems reasonable.

@oschulz oschulz merged commit 111325e into JuliaMath:master Jun 6, 2022
@oschulz oschulz self-assigned this Jun 6, 2022
@oschulz
Copy link
Collaborator

oschulz commented Jun 6, 2022

Thanks @aplavin !

@oschulz
Copy link
Collaborator

oschulz commented Jun 6, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants