-
Notifications
You must be signed in to change notification settings - Fork 53
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
Further allocation reduction in power computations #361
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
dbdbcc1
working version with oop sqr!
PerezHz a34ce7b
Update Project.toml
PerezHz c04d9f8
Update src/TaylorSeries.jl
PerezHz 5d3d57d
Update `zero(x)`; add in-place mul! for TaylorN
PerezHz a9c770b
Get rid of most allocations in pow! for Taylor1{TaylorN{T}; add power…
PerezHz 5bcccf4
Remove extra empty line
PerezHz 6cce90a
Add power_by_squaring methods to avoid method ambiguities (detected b…
PerezHz a205dcd
Remove duplicated return
PerezHz e44811c
Add inbounds
PerezHz 2e4e60a
Address review by @lbenet
PerezHz f581b21
Add extra arg to pow!
PerezHz 27c3d0e
Update TaylorSeries IA extension
PerezHz dc6a68c
Update pow! and add fix suggested by @lbenet
PerezHz 364faf7
Middle-of-the-road approach to suggestion by @lbenet
PerezHz 99e3061
Handle pow! cases by dispatch-by-value
PerezHz efa02a1
Remove unneeded deepcopy in setindex! method
PerezHz d9af8ca
Add `power_by_squaring(x, ::Val{3})` methods and add tests
PerezHz 68bf845
Update comments
PerezHz 8610e21
Bump patch version
PerezHz ba30e7a
Switch back from dispatch-by-value to if/else for pow!
PerezHz ea15252
Revert change in setindex! overload for Taylor1
PerezHz 21c876b
Add test for nested Taylor1s setindex! method
PerezHz 702fbac
De-bump patch version
PerezHz 6264eae
Another approach to suggestion by @lbenet
PerezHz 4f613d6
Fix typo
PerezHz ad18057
Fix another typo
PerezHz 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 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 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 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 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 |
---|---|---|
|
@@ -156,7 +156,7 @@ struct TaylorN{T<:Number} <: AbstractSeries{T} | |
order :: Int | ||
|
||
function TaylorN{T}(v::Array{HomogeneousPolynomial{T},1}, order::Int) where T<:Number | ||
coeffs = zeros(HomogeneousPolynomial{T}, order) | ||
coeffs = isempty(v) ? zeros(HomogeneousPolynomial{T}, order) : zeros(v[1], order) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we would need similar fixes in |
||
@inbounds for i in eachindex(v) | ||
ord = v[i].order | ||
if ord ≤ order | ||
|
This file contains 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 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 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An equivalent method
mul!(a::Taylor1{T}, b::Taylor1{T}) where {T<:Number})
could be useful for the extension ofpow!
forTaylor1{TaylorN{T}}
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would indeed by useful, I've added the corresponding method, thanks!