Hi,
I’m wondering whether there is a way to check whether a TString contains a valid TFormula without throwing an error.
When trying e.g.
root [0] TFormula fml("","si(x)")
I get the error
input_line_35:2:65: error: use of undeclared identifier 'si'
Double_t TFormula____id3732792798741230608(Double_t *x){ return si(x[0]) ; }
^
input_line_36:2:65: error: use of undeclared identifier 'si'
Double_t TFormula____id3732792798741230608(Double_t *x){ return si(x[0]) ; }
^
Error in <prepareMethod>: Can't compile function TFormula____id3732792798741230608 prototype with arguments Double_t*
Error in <TFormula::InputFormulaIntoCling>: Error compiling formula expression in Cling
Error in <TFormula::ProcessFormula>: Formula "si(x)" is invalid !
(TFormula &) Name: Title: si(x)
and the exact same error for
TFormula fml("",""); fml.SetTitle("si(x)"); fml.Compile()
There is a method IsValid(), but this can only be called after Compile (throwing an error for an invalid formula anyways). The codes continues running, but I’d like to suppress this error output.
Best regards and thanks,
Klaus
ROOT Version: 6.28/04
Platform: Linux Debian 10.13
Compiler: Not Provided