[ROOT-8182] TFormula does not handle missing parameters Created: 13/May/16  Updated: 16/Dec/16  Resolved: 16/Dec/16

Status: Closed
Project: ROOT
Component/s: Math Libraries
Affects Version/s: 6.06/04
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Gianluca Petrillo Assignee: Lorenzo Moneta
Resolution: Fixed Votes: 0
Labels: None

Plain ROOT 6.06/04, Scientific Linux Fermi 6.7, gcc 4.9.3.



ROOT 6's TFormula does not detect gaps in the numeration of the parameters:

TFormula F("FTest", "[1]");
F.SetParameters(0.5, 1.0);
std::cout << F.Eval(0.0) << std::endl;

This expression is arguably ill formed, since there is no mention of parameter #0 but there is a parameter #1.
The intuitive behaviour is that the first parameter value, 0.5 be assigned to the ghost parameter #0, and the second parameter value, 1.0, assigned to the parameter #1. The output would then be 1.0.
ROOT 5 output is in fact 1.0.
ROOT 6 output is instead 0.5.
No warning is printed in either case about the skipped parameter.

This is a backward incompatibility.
I would like it at least not to be silent.

Comment by Lorenzo Moneta [ 16/Dec/16 ]

This is now fixed in master and 6.08 patches.
The old behaviour is restored, and now Formula is backward compatible with the v5 version on this issue

Thank you for reporting this bug


Generated at Mon Feb 24 17:10:06 CET 2020 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.