- changed milestone to 1.6
-
assigned issue to
- changed version to dev
- marked as minor
Problem with ternary operator within Expression
Issue #458
resolved
hi, using the ternary operator within an Expression leads to compile errors in some cases. See the following example.
from dolfin import *
f1 = Expression("(x[0]<2.0)?1.2:-11.0") # works
f2 = Expression("(x[0]<2.0)?1.2:-10.0") # works
f3 = Expression("(x[0]<2.0)?1.0:1.0") # fails
f4 = Expression("(x[0]<2.0)?1.0:10.0") # fails
If braces are placed around the numbers the problem vanishes. Seems that the number without - sign after the : is interpreted as a parameter!?
Comments (8)
-
-
- changed status to resolved
Fix issue
#458.→ <<cset 1e5aea7803ad>>
-
- changed status to open
Fix in next.
-
- changed status to resolved
Fix issue
#458.→ <<cset 71fdef36a383>>
-
Fix issue
#458.→ <<cset 1e5aea7803ad>>
-
@blechta - Jan, I'm not quite sure what happened there... I was just merging my changes into next, which I hadn't touched for a while. I hope I haven't screwed anything up...
-
OK:)
-
- removed milestone
Removing milestone: 1.6 (automated comment)
- Log in to comment
Problem is on this line https://bitbucket.org/fenics-project/dolfin/src/2925b1aaa49993fa294e52ae335b4762c1298598/site-packages/dolfin/compilemodules/compilemodule.py?at=master#cl-161. Will try to fix it later.