-
Notifications
You must be signed in to change notification settings - Fork 96
Add missing complex tests and rules #216
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
90a369d
Fix indentation
sethaxen a49187b
Test \ on complex inputs
sethaxen aa26f04
Test ^ on complex inputs
sethaxen e47afd2
Test identity on complex inputs
sethaxen beaae0c
Test muladd on complex inputs
sethaxen b89b588
Test binary functions on complex inputs
sethaxen 4738c48
Test functions on complex inputs
sethaxen 0f34193
Release type constraint on exp
sethaxen 0dd4023
Add _realconjtimes
sethaxen d737cdf
Use _realconjtimes in abs/abs2 rules
sethaxen e5276e6
Add complex rule for hypot
sethaxen ac58495
Add generic rule for adjoint
sethaxen 7f6c709
Add generic rule for real
sethaxen b5fef9e
Add generic rule for imag
sethaxen 45ba9b7
Add complex rule for hypot
sethaxen 5971f4f
Add rules/tests for Complex
sethaxen 45b2edc
Test frule for identity
sethaxen c678197
Add missing angle test
sethaxen 3b3d11d
Make inline just in case
sethaxen f6f7c8a
Unify abs rules
sethaxen 16f8307
Introduce _imagconjtimes utility function
sethaxen 86dac82
Unify angle rules
sethaxen 071b658
Unify sign rules
sethaxen 3ff0457
Merge branch 'master' into complextests
sethaxen e0dd0d3
Multiply by correct variable
sethaxen 2ce61d4
Fix argument order
sethaxen 70f6d70
Merge branch 'complextests' of https://github.com/sethaxen/ChainRules…
sethaxen 1c97506
Bump ChainRulesTestUtils version number
sethaxen c286f41
Restrict to Complex
sethaxen 980c413
Use muladd
sethaxen 34419ce
Update src/rulesets/Base/fastmath_able.jl
sethaxen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # real(conj(x) * y) avoiding computing the imaginary part if possible | ||
| @inline _realconjtimes(x, y) = real(conj(x) * y) | ||
| @inline _realconjtimes(x::Complex, y::Complex) = muladd(real(x), real(y), imag(x) * imag(y)) | ||
| @inline _realconjtimes(x::Real, y::Complex) = x * real(y) | ||
| @inline _realconjtimes(x::Complex, y::Real) = real(x) * y | ||
| @inline _realconjtimes(x::Real, y::Real) = x * y | ||
|
|
||
| # imag(conj(x) * y) avoiding computing the real part if possible | ||
| @inline _imagconjtimes(x, y) = imag(conj(x) * y) | ||
| @inline function _imagconjtimes(x::Complex, y::Complex) | ||
| return muladd(-imag(x), real(y), real(x) * imag(y)) | ||
| end | ||
| @inline _imagconjtimes(x::Real, y::Complex) = x * imag(y) | ||
| @inline _imagconjtimes(x::Complex, y::Real) = -imag(x) * y | ||
| @inline _imagconjtimes(x::Real, y::Real) = Zero() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.