If I open a scidavid project containing fits I get the error message found in the attachment and the fitted curves disappear from my graphs, I have to refit them all. I also receive the same error if I try to manipulate a fit: e.g. I have a data set ranging from x=0 to x=50, I do a linear fit to the region x=[25,40] and later through edit function I want to make the fitted line to be displayed from x=[10,40] instead of drawing the line longer I am greeted with the same "undefined token" message. Same behaviour on kubuntu 11.04 and recent mageia (mandriva). As I have been using scidavis 2.4 without any problems in mandriva 2010.1 I think this is a problem with some newer qt library scidavis depends on. Same error messages in recent qtiplot too. If anybody with knowledge about scidavis program internals points me in the right direction I would be glad to help hunting down the cause.
Thanks!
The problem when opening projects with fits occurs only if you are using muParser 1.34. If possible, downgrade your muParser to version 1.32. I think that only SciDAVis and QtiPlot depends on muParser in Mageia and (K/X) Ubuntu, then a downgrade will not cause other problems.
Information that was missing: SciDAVis must be recompiled with muParser 1.32 to work properly.
Hi fellype!
Thank you! That solved it. I rebuilt the mageia rpm with muparser 1.32 and the error is gone. Just out of curiosity do we know the exact culprit? Is this a muparser bug, or has to do something with these changes?
"Changes:
The prefix needed for parsing hex values is now "0x" and no longer "$".
AddValIdent reintroduced into the DLL interface."
Hi blas88!
Sorry, but I'm not the right man to answer your question. I discovered the origin of the problem because I know that muparser is the default parsing tool used by scidavis' internal functions, and all them were working with version 1.32.
I have the same problem here on archlinux. Just posting to get upgrade/news...
View and moderate all "scidavis-bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "SciDAVis Bugs"
I tried to rebuild scidavis after downgrading libmuparser0 1.34-1 to 1.32-1, but then I get the error:
scidavis: undefined symbol: _ZN2mu10ParserBase10DefineOprtERKSsPFdddEjNS_18EOprtAssociativityEb
and the program crashes upon start. I had to upgrade back to 1.34-1 to get the program working again. What is the correct procedure to downgrade and recompile scidavis? I'm using Kubuntu Natty (11.04).
Verified, with error message
PolyFit1:0
Undefined token "; a1=-0.00579127080471151; a2=6.11422720269446e-05; a0+a1x+a2x^2 " found at position 20.
I have the same problem, and, sometimes a lost my plots
"No LinealAjustar1:0
Unexpected token "; b=0.0833495478230434; a*x^b " found at position 19."
I'm confirming, the bug is still there. I get it whenever I try to load project with at least one linear line fitted. Very frustraiting - have to refit the curves every time I load a project.
Jacek
If downgrading muParser does not work (e.g. using SciDAVis from a Linux distro), you can also fix the project file using a simple text editor. Search for the <formula> elements. Typically you find something like (example for a linear fit):
Replace it by inserting the coefficients into the function:
Annotation: You can also right-click on the graphic, select Add/Remove Curve and then Edit Function in the Graph contents box.
Last edit: Robert Bienert 2014-08-19
This bug is still valid for version 1.D8. It is also not possible to create a function with parameters, using the same syntax of custom functions obtained through the function "fit wizard".
Last edit: Emmanuel Favre-Nicolin 2014-09-25
As Fellype noticed, this seems to be a problem with muParser.
In FunctionCurve::LoadData, the input function "B=???\nA=???\n\nAx+B\n" is translated into "B=???;A=???;Ax+B;" somewhere. I couldn't see the change happening within scidavis code, so I assume it is within MuParser. Then MuParser does not know what to do with the semicolons, even though ; has been defined as a statement separator.
At this point, we need to build a debug version of muparser, and debug our way through the muparser code to figure out what is going on.
I tracked the problem down to a bug in muParser. The real problem is that muParser incorrectly uses the term "infix operator" to refer to prefix operators, and because of this usage, someone mistakenly validated against ValidInfixOprtChars() instead of ValidOprtChars().
I have attached a patch, which works against the latest muParser (v2.2.3).
The question is how quickly this patch can be integrated into the muParser baseline.
I have committed a workaround to the muparser bug to the scidavis SVN repository.
I have checked that this seems to solve the problem, but haven't checked if it breaks builds against old muparser libraries.
Hence I have marked this issue as pending, rather than closed.
I've noticed, that the same eror message appears, when during fitting I've checked an option to set a parameter as "constant", using scidavis 1.D8.