root icon indicating copy to clipboard operation
root copied to clipboard

[Minuit2] Use `std::span` instead of `std::vector const&` for parameters

Open guitargeek opened this issue 1 year ago • 1 comments

Use std::span instead of std::vector const& for function parameters in Minuit2.

The motivation is that std::span is more general. If the function takes a std::vector const&, the inputs are forced to be allocated on the heap. So if one wants to call functions with constant size or even scalar input, that would cause a large overhead.

This overhead can be avoided when generalizing with std::span.

The standalone Minuit2 build files were also changed to consider the std::span backport to C++17 that is already in ROOT.

guitargeek avatar Mar 22 '24 16:03 guitargeek

Test Results

    13 files      13 suites   2d 21h 36m 58s :stopwatch:  3 027 tests  3 027 :white_check_mark: 0 :zzz: 0 :x: 33 832 runs  33 832 :white_check_mark: 0 :zzz: 0 :x:

Results for commit ac59f177.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Mar 22 '24 20:03 github-actions[bot]