[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
Environment:

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


Development:

 Description   

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.



 Comments   
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

Lorenzo

Generated at Sun Sep 22 01:46:41 CEST 2019 using Jira 7.13.1#713001-sha1:5e06076c2d215a6f699b7e5c90ab2fae7ba5a1ce.