Merged
Conversation
Contributor
rafuck
commented
Feb 18, 2017
- fix all warnings in g++ -Wall -Wextra
- fix bug in "inline double rho_pX" function
- replaced pow(somethig, 0,5) with sqrt
- replaced pow(somethig, 2) with something*something
- std::vector::push_back replaced with reserve + emplace_back
- some approaches to vectorize calculations in Region5::T_p(double p)
- added const modifier in constant methods
- some little optimizations
2) fix in "inline double rho_pX" function 3) replaced pow(somethig, 0,5) with sqrt 4) replaced pow(somethig, 2) with something*something 5) std::vector::push_back replaced with reserve + emplace_back 6) some approaches to vectorize calculations in Region5::T_p(double p) 7) added const modifier in constant methods 8) some little optimizations
Contributor
|
Nice! Thanks for taking the time to put together this PR |
Contributor
|
@rafuck @ibell OK, for my own edification:
|
Contributor
Author
|
About 3) - now this function works 10x faster than initial func on my system. |
Contributor
Author
|
Ok, about const:
About reserve+emplace vs push_back. It may be faster were size of vector is very big ( http://coliru.stacked-crooked.com/a/83d23c2d0dcee2ff ). But if the vector length is known in advance, why did not immediately allocate memory for it? |
Contributor
|
Excellent. Thanks. I'll read up! |
Contributor
|
@ibell Is CoolProp really off Python 2.7 now and can now use C++11 conventions? Is it worth putting the C++11 push_back code back in to add some speed? |
Contributor
|
@ibell - Bump. |
Contributor
|
I think that C++11 should be safe. In other projects I have moved to C++20. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.