bug in vtkFunctionParser class
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
> Folks, > > I found a bug in vtkFunctionParser class. The attached example illustrates it - > when the Function string is not enclosed in parenthesis, the result of > computation is incorrect. > > Nick Gnedin > > ______________________________________________________________________ > > #include <vtkFunctionParser.h> > > > int main() > { > > vtkFunctionParser *p = vtkFunctionParser::New(); > p->SetScalarVariableValue("a",0.25); > > p->SetFunction("(1-sqrt(a))"); > double r1 = p->GetScalarResult(); > > p->SetFunction("1-sqrt(a)"); > double r2 = p->GetScalarResult(); > > p->Delete(); > > cout << r1 << " " << r2 << "\n"; > > return 1; > }