Skip to content

Commit

Permalink
cause not to trigger coneoproject/COFFEE#97
Browse files Browse the repository at this point in the history
  • Loading branch information
miklos1 committed Oct 21, 2016
1 parent c38f3ae commit 1d7ce21
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tsfc/coffee.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,6 @@ def statement_evaluate(leaf, parameters):
return coffee.Block(ops, open_scope=False)
elif isinstance(expr, gem.Constant):
assert parameters.declare[leaf]
# Take all axes except the last one
axes = tuple(range(len(expr.array.shape) - 1))
nz_indices, = expr.array.any(axis=axes).nonzero()
nz_bounds = tuple([(i, 0)] for i in expr.array.shape[:-1])
nz_bounds += ([(max(nz_indices) - min(nz_indices) + 1, min(nz_indices))],)
table = numpy.array(expr.array)
# FFC uses one less digits for rounding than for printing
epsilon = eval("1e-%d" % (parameters.precision - 1))
Expand All @@ -195,7 +190,7 @@ def statement_evaluate(leaf, parameters):
table[abs(table + 1.0) < epsilon] = -1.0
table[abs(table - 0.5) < epsilon] = 0.5
table[abs(table + 0.5) < epsilon] = -0.5
init = coffee.SparseArrayInit(table, parameters.precision, nz_bounds)
init = coffee.ArrayInit(table, parameters.precision)
return coffee.Decl(SCALAR_TYPE,
_decl_symbol(expr, parameters),
init,
Expand Down

0 comments on commit 1d7ce21

Please sign in to comment.