View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006666ParaView(No Category)public2008-03-27 10:552009-05-13 13:47
ReporterTakuya OSHIMA 
Assigned ToZhanping Liu 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version3.6Fixed in Version 
Summary0006666: vtkFunctionParser::OperatorWithinVariable() should search variable name until the location of idx
DescriptionI have a dataset which contains an array with the name say "A/B," which in turn contains a character that may be interpreted as a mathematical operator '/'. If I try to run Filter->Calculator and to evaluate an expression "A/B + A/B" over the dataset, I can't get the expected result (an array with all components doubled). The actual result depends on the expression (a parser error, an incorrect result array, etc.).
Additional InformationI think finding only the first occurrence of the array name within the given expression is not enough in vtkFunctionParser::OperatorWithinVariable(). At least the array name should be searched until the location of idx even if there was an occurrence prior to the location.

The attached is a patch that worked for me. I know this is far from perfect as a fix (there are still many possible cases that can't be covered with this patch). Please take it just as a clarification of the solution that worked for me.
TagsNo tags attached.
Project
Topic Name
Type
Attached Files? file icon patch1 [^] (1,927 bytes) 2008-03-27 10:55 [Show Content]

 Relationships

  Notes
(0013780)
Zhanping Liu (developer)
2008-10-09 09:47

BUG: 0006666 has been fixed. The problem was due to the insufficient
search, in this->Function, for a variable name containing a dumb operator. This
incompleteness fails to capture such a variable name at index "idx" if there
happens to be one or more occurrences (of the same variable name)
preceding idx. As a consequence, vtkFunctionParser::
OperatorWithinVariable() --- (line1335 ~ line 1403) --- mistakenly reports 0.

As suggested by 7islands, a greedy search scheme is now adopted to check through idx before reporting the result. The updated code allows for multiple occurrences of a varialbe name (containing a dumb operator) in this->Function and therefore leads to a more flexible function parser.

Thanks, 7islands, for reporting the bug and the suggestions.

new revision: 1.41; previous revision: 1.40
(0013929)
Alan Scott (manager)
2008-10-24 20:04

No clue how to check this, assuming correct. Untested.

 Issue History
Date Modified Username Field Change
2008-03-27 10:55 Takuya OSHIMA New Issue
2008-03-27 10:55 Takuya OSHIMA File Added: patch1
2008-04-10 17:44 Ken Moreland Category 3.4 => 3.6
2008-09-23 11:21 Berk Geveci Status backlog => tabled
2008-09-23 11:21 Berk Geveci Assigned To => Zhanping Liu
2008-10-09 09:47 Zhanping Liu Note Added: 0013780
2008-10-09 09:48 Zhanping Liu Status tabled => @80@
2008-10-24 20:04 Alan Scott Note Added: 0013929
2008-10-24 20:04 Alan Scott Status @80@ => closed
2008-10-24 20:04 Alan Scott Resolution open => fixed
2009-05-13 13:47 Utkarsh Ayachit Target Version => 3.6
2011-06-16 13:10 Zack Galbreath Category => (No Category)


Copyright © 2000 - 2018 MantisBT Team