Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8182

TFormula does not handle missing parameters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 6.06/04
    • Fix Version/s: None
    • Component/s: Math Libraries
    • Labels:
      None
    • Environment:

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

      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.

        Attachments

          Activity

            People

            • Assignee:
              moneta Lorenzo Moneta
              Reporter:
              f98957ffb41780c8d75c Gianluca Petrillo
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: