root icon indicating copy to clipboard operation
root copied to clipboard

[Math] Move gradient methods to IBaseFunction classes

Open guitargeek opened this issue 6 months ago • 1 comments

Move the gradient-related methods from the IGradientFunctionMultiDimTempl to the IBaseFunctionMultiDimTempl base class, and the same for the 1D version.

This makes the IGradientFunction classes pure "indicator" classes that indicate whether the gradient is implemented by the user or not. The actual function interface is unified in the IBaseFunctions.

This fixes the problem that the override keywords could not be used consistently in I*Function-derived classes where the base class was templated to be either IBaseFunction or IGradientFunction.

Alternative to:

  • https://github.com/root-project/root/pull/19058

guitargeek avatar Jun 17 '25 13:06 guitargeek

Thanks for tackling this!

Besides the failing test, roofit/roofit/test/GaussFunction.h needs an override, too

ferdymercury avatar Jun 17 '25 19:06 ferdymercury

Test Results

    18 files      18 suites   3d 10h 49m 14s ⏱️  2 856 tests  2 856 ✅ 0 💤 0 ❌ 49 966 runs  49 966 ✅ 0 💤 0 ❌

Results for commit c657b8f5.

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

github-actions[bot] avatar Jun 18 '25 04:06 github-actions[bot]