-
Notifications
You must be signed in to change notification settings - Fork 42
use mutating versions of ops #288
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 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0595115
use mutating versions of ops
jverzani c2d3afd
typos; init constant
jverzani cde9b6f
save 1 alloc
jverzani 5dff1ba
allocations needs v1.9
jverzani 6871922
test on 1.6
jverzani e38e21e
Update src/types.jl
jverzani e137644
Update src/types.jl
jverzani 0c18a0d
Update src/types.jl
jverzani 8835cf7
shuffle to define types first
jverzani 67c80d8
Merge branch 'master' into mutate
jverzani 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
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,18 @@ | ||
| # test for allocations | ||
| @vars x y | ||
| a = Basic() | ||
| @testset "non-allocating(ish) methods" begin | ||
| sin(x), cos(x), abs(x) | ||
| x^x, x + x, x*x, x-x, x/x # warm up | ||
|
|
||
| @test (@allocations SymEngine.sin!(a,x)) == 0 | ||
| @test (@allocations SymEngine.cos!(a,x)) == 0 | ||
| @test (@allocations SymEngine.pow!(a,x,x)) == 0 | ||
|
|
||
| # still allocates 1 (or 2) | ||
| @test (@allocations SymEngine.add!(a,x,y)) < (@allocations x+y) | ||
| @test (@allocations SymEngine.sub!(a,x,y)) < (@allocations x-y) | ||
| @test (@allocations SymEngine.mul!(a,x,y)) < (@allocations x*y) | ||
| @test (@allocations SymEngine.div!(a,x,y)) < (@allocations x/y) | ||
| @test (@allocations SymEngine.abs2!(a,x)) < (@allocations abs2(x)) | ||
| end |
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.