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.
This moves a lot of cpp-code to headers. It also introduces nonstd::pow.
The former will likely make some compile-times a lot slower. The latter expresses
std::pow(v, x)asstd::exp(x * std::log(v)), since logarithms and natural exponentials are built-in commands. All tests complete without issues and the numerical error in the cases I tested was actually 0, so I guess there is simply some logic involved and we end up calling that expression regardless.I ran some tests on all this. In the
lbl_temperature_Xtests, 10 million calls to the respective temperature models were done. The input is generated by RNG. There are four scenarios. The keyword "Original" means ARTS3 inlining today and "Inline" means the code is in the header. The other change, "using exp() and log() instead of pow()" means as above. Note that some methods below were already inlined as they are constexpr-able.The short of all this is that there is a 10x speed-up in the most commonly used line-shape function. This is the function call that I often refers to as "as slow as 1000 frequency points", so hopefully, the linear growth in time complexity with frequency will now start at 100 frequency points rather than 1000.
Original:
Original using exp() and log() instead of pow():
Inline:
Inline using exp() and log() instead of pow():
The above is all clang so I tested GCC for the original and best scenario.
Original:
Inline using exp() and log() instead of pow():